]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
rockchip: Print a message when returning to the bootrom
authorSimon Glass <sjg@chromium.org>
Sat, 15 Apr 2017 19:11:31 +0000 (13:11 -0600)
committerTom Rini <trini@konsulko.com>
Tue, 18 Apr 2017 14:29:26 +0000 (10:29 -0400)
At present if the return to bootrom fails (e.g. because you are not using
the Rockchip's bootrom's pointer table in MMC) then the board prints
SPL message and hangs. Print a message first if we can, to help in
understanding what happened when it hangs.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Heiko Stuebner <heiko@sntech.de>
arch/arm/include/asm/arch-rockchip/bootrom.h
arch/arm/mach-rockchip/Makefile
arch/arm/mach-rockchip/bootrom.c [new file with mode: 0644]
arch/arm/mach-rockchip/save_boot_param.S

index 79fb1a07acf5813f0e20de6dc6c7b12709a5912e..92eb8783a3ae3818399b54319911c2b28a0a6b33 100644 (file)
  */
 extern u32 SAVE_SP_ADDR;
 
-/*
+/**
  * Hand control back to the bootrom to load another
  * boot stage.
  */
-extern void back_to_bootrom(void);
+void back_to_bootrom(void);
+
+/**
+ * Assembler component for the above (do not call this directly)
+ */
+void _back_to_bootrom_s(void);
 
 #endif
index 6b251c7e7e953e9b97ecea45a7a18df38706fe4f..327b26705dcb18a614628ba4bdbd52a966f83abe 100644 (file)
@@ -4,6 +4,8 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
+obj-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o
+
 ifdef CONFIG_TPL_BUILD
 obj-$(CONFIG_ROCKCHIP_RK3188) += rk3188-board-tpl.o
 obj-$(CONFIG_ROCKCHIP_BROM_HELPER) += save_boot_param.o
diff --git a/arch/arm/mach-rockchip/bootrom.c b/arch/arm/mach-rockchip/bootrom.c
new file mode 100644 (file)
index 0000000..da36f92
--- /dev/null
@@ -0,0 +1,16 @@
+/**
+ * Copyright (c) 2017 Google, Inc
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/arch/bootrom.h>
+
+void back_to_bootrom(void)
+{
+#if defined(CONFIG_SPL_LIBGENERIC_SUPPORT) && !defined(CONFIG_TPL_BUILD)
+       printf("Returning to boot ROM...");
+#endif
+       _back_to_bootrom_s();
+}
index 85b407b4d3bc2d941dde8a2719b51f3d945ace9e..5e6c8dba13e787d41b2b82257c6ac54bd8c65483 100644 (file)
@@ -23,10 +23,10 @@ ENTRY(save_boot_params)
 ENDPROC(save_boot_params)
 
 
-.globl back_to_bootrom
-ENTRY(back_to_bootrom)
+.globl _back_to_bootrom_s
+ENTRY(_back_to_bootrom_s)
        ldr     r0, =SAVE_SP_ADDR
        ldr     sp, [r0]
        mov     r0, #0
        pop     {r1-r12, pc}
-ENDPROC(back_to_bootrom)
+ENDPROC(_back_to_bootrom_s)