rockchip: Print a message when returning to the bootrom
Subsystems (3)
PATCH v2 1/1 rockchip: Print a message when returning to the bootrom
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.
---
Changes in v2:
- Make inclusion of bootrom.c conditional in the Makefile
- Update #ifdef check around printf() to include !CONFIG_TPL_BUILD
arch/arm/include/asm/arch-rockchip/bootrom.h | 9 +++++++-- arch/arm/mach-rockchip/Makefile | 2 ++ arch/arm/mach-rockchip/bootrom.c | 16 ++++++++++++++++ arch/arm/mach-rockchip/save_boot_param.S | 6 +++--- 4 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 arch/arm/mach-rockchip/bootrom.c
arch/arm/include/asm/arch-rockchip/bootrom.h +7 -2
@@ -13,10 +13,15 @@*/ 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
arch/arm/mach-rockchip/Makefile +2 -0
@@ -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
arch/arm/mach-rockchip/bootrom.c new file +16 -0
@@ -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 (); +}
arch/arm/mach-rockchip/save_boot_param.S +3 -3
@@ -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)
Signature · 1 line
2.12.2.762.g0e3151a226-goog
PATCH v2 1/1 rockchip: Print a message when returning to the bootrom
Quoted 8 lines · Simon Glass
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 <[email protected]>Tested-by Heiko Stuebner <[email protected]>Acked-by Heiko Stuebner <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170419/c553f05a/attachment.sig>