diff options
author | Jonas Karlman <jonas@kwiboo.se> | 2023-09-27 21:44:13 +0000 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-09-29 07:53:33 -0400 |
commit | 5ee59c1713aa598671f0cc42d085a43b7b019f1a (patch) | |
tree | b09b90c8985d9b652100a344bbba132d305e654c | |
parent | 0bd950aeace1a2ba1cea48cf52ab63e0f375f7a7 (diff) | |
download | u-boot-TEST/spl-reworks.zip u-boot-TEST/spl-reworks.tar.gz u-boot-TEST/spl-reworks.tar.bz2 |
spl: Jump to image at end of board_init_rTEST/spl-reworks
spl_board_prepare_for_boot() is not called before jumping/invoking atf,
optee, opensbi or linux images.
Jump to image at the end of board_init_r() to fix this.
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | common/spl/spl.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/common/spl/spl.c b/common/spl/spl.c index 8511c66..af9507a 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -747,6 +747,8 @@ void board_init_r(gd_t *dummy1, ulong dummy2) BOOT_DEVICE_NONE, BOOT_DEVICE_NONE, }; + typedef void __noreturn (*jump_to_image_t)(struct spl_image_info *); + jump_to_image_t jump_to_image = &jump_to_image_no_args; struct spl_image_info spl_image; int ret, os; @@ -847,20 +849,20 @@ void board_init_r(gd_t *dummy1, ulong dummy2) } else if (CONFIG_IS_ENABLED(ATF) && os == IH_OS_ARM_TRUSTED_FIRMWARE) { debug("Jumping to U-Boot via ARM Trusted Firmware\n"); spl_fixup_fdt(spl_image_fdt_addr(&spl_image)); - spl_invoke_atf(&spl_image); + jump_to_image = &spl_invoke_atf; } else if (CONFIG_IS_ENABLED(OPTEE_IMAGE) && os == IH_OS_TEE) { debug("Jumping to U-Boot via OP-TEE\n"); spl_board_prepare_for_optee(spl_image_fdt_addr(&spl_image)); - jump_to_image_optee(&spl_image); + jump_to_image = &jump_to_image_optee; } else if (CONFIG_IS_ENABLED(OPENSBI) && os == IH_OS_OPENSBI) { debug("Jumping to U-Boot via RISC-V OpenSBI\n"); - spl_invoke_opensbi(&spl_image); + jump_to_image = &spl_invoke_opensbi; } else if (CONFIG_IS_ENABLED(OS_BOOT) && os == IH_OS_LINUX) { debug("Jumping to Linux\n"); if (IS_ENABLED(CONFIG_SPL_OS_BOOT)) spl_fixup_fdt((void *)SPL_PAYLOAD_ARGS_ADDR); spl_board_prepare_for_linux(); - jump_to_image_linux(&spl_image); + jump_to_image = &jump_to_image_linux; } else { debug("Unsupported OS image.. Jumping nevertheless..\n"); } @@ -890,7 +892,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2) } spl_board_prepare_for_boot(); - jump_to_image_no_args(&spl_image); + jump_to_image(&spl_image); } /* |