spl: spl_nor: use panic instead of hang if booting fails
PATCH 1/1 spl: spl_nor: use panic instead of hang if booting fails
On systems without a watchdog, using hang() prevents a system to recover from an error. For example, a board could implement a boot counter to switch to an alternative load address after some failed tries.
Signed-off-by Mario Kicherer <[email protected]>
--- common/spl/spl.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
common/spl/spl.c +3 -4
@@ -822,11 +822,10 @@ void board_init_r(gd_t *dummy1, ulong dummy2)if (ret) {if (CONFIG_IS_ENABLED (SHOW_ERRORS ) &&CONFIG_IS_ENABLED (LIBCOMMON_SUPPORT )) -printf (SPL_TPL_PROMPT "failed to boot from all boot devices (err=%d)\n" , - ret); +panic (SPL_TPL_PROMPT "failed to boot from all boot devices (err=%d)\n" , + ret);else -puts (SPL_TPL_PROMPT "failed to boot from all boot devices\n" ); -hang (); +panic_str (SPL_TPL_PROMPT "failed to boot from all boot devices\n" ); }spl_perform_fixups (&spl_image);
Signature · 1 line
2.34.1
Quoted 19 lines · Mario Kicherer
On systems without a watchdog, using
hang()prevents a system to recover from an error. For example, a board could implement a boot counter to switch to an alternative load address after some failed tries.Signed-off-by Mario Kicherer <[email protected]>--- common/spl/spl.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)common/spl/spl.c +0
-1@@ -822,11 +822,10 @@ void board_init_r(gd_t *dummy1, ulong dummy2)if (ret) {if (CONFIG_IS_ENABLED (SHOW_ERRORS ) &&CONFIG_IS_ENABLED (LIBCOMMON_SUPPORT )) - printf(SPL_TPL_PROMPT "failed to boot from all boot devices (err=%d)\n",
common/spl/spl.c void board_init_r(gd_t *dummy1, ulong dummy2) · line 831
Quoted 10 lines
common/spl/spl.c +3
-3- ret); +panic (SPL_TPL_PROMPT "failed to boot from all boot devices (err=%d)\n" , + ret); else - puts(SPL_TPL_PROMPT "failed to boot from all boot devices\n"); -hang (); + panic_str(SPL_TPL_PROMPT "failed to boot from all boot devices\n"); }spl_perform_fixups (&spl_image);
Not all platforms that use SPI in SPL have panic() (and related functions) available, so this introduces a number of fail to builds.
Signature · 1 line
Tom