Skip to content
Snippets Groups Projects
Commit f77549fe authored by Bin Meng's avatar Bin Meng Committed by Tom Rini
Browse files

riscv: sifive: Fix OF_BOARD boot failure

When using QEMU to have a quick test of booting U-Boot S-mode payload
directly without the needs of preparing the SPI flash or SD card images
for SiFive Unleashed board, as per the instructions [1], it currently
does not boot any more.

This was caused by the OF_PRIOR_STAGE removal, as gd->fdt_blob no longer
points to a valid DTB. OF_BOARD is supposed to replace OF_PRIOR_STAGE,
hence we need to add the OF_BOARD logic in board_fdt_blob_setup().

[1] https://qemu.readthedocs.io/en/latest/system/riscv/sifive_u.html#running-u-boot



Fixes: 2e8d2f88 ("riscv: Remove OF_PRIOR_STAGE from RISC-V boards")
Fixes: d6f8ab30 ("treewide: Remove OF_PRIOR_STAGE")
Signed-off-by: default avatarBin Meng <bmeng.cn@gmail.com>
Reviewed-by: default avatarIlias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
parent dae0829c
No related branches found
No related tags found
No related merge requests found
...@@ -117,7 +117,7 @@ int misc_init_r(void) ...@@ -117,7 +117,7 @@ int misc_init_r(void)
void *board_fdt_blob_setup(int *err) void *board_fdt_blob_setup(int *err)
{ {
*err = 0; *err = 0;
if (IS_ENABLED(CONFIG_OF_SEPARATE)) { if (IS_ENABLED(CONFIG_OF_SEPARATE) || IS_ENABLED(CONFIG_OF_BOARD)) {
if (gd->arch.firmware_fdt_addr) if (gd->arch.firmware_fdt_addr)
return (ulong *)(uintptr_t)gd->arch.firmware_fdt_addr; return (ulong *)(uintptr_t)gd->arch.firmware_fdt_addr;
} }
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
void *board_fdt_blob_setup(int *err) void *board_fdt_blob_setup(int *err)
{ {
*err = 0; *err = 0;
if (IS_ENABLED(CONFIG_OF_SEPARATE)) { if (IS_ENABLED(CONFIG_OF_SEPARATE) || IS_ENABLED(CONFIG_OF_BOARD)) {
if (gd->arch.firmware_fdt_addr) if (gd->arch.firmware_fdt_addr)
return (ulong *)(uintptr_t)gd->arch.firmware_fdt_addr; return (ulong *)(uintptr_t)gd->arch.firmware_fdt_addr;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment