]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
riscv: sifive: Fix OF_BOARD boot failure
authorBin Meng <bmeng.cn@gmail.com>
Wed, 5 Jan 2022 01:07:57 +0000 (09:07 +0800)
committerTom Rini <trini@konsulko.com>
Fri, 7 Jan 2022 14:30:44 +0000 (09:30 -0500)
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: 2e8d2f88439d ("riscv: Remove OF_PRIOR_STAGE from RISC-V boards")
Fixes: d6f8ab30a2af ("treewide: Remove OF_PRIOR_STAGE")
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
board/sifive/unleashed/unleashed.c
board/sifive/unmatched/unmatched.c

index 3c3e0e1d0d116bd35fd5e0c3a7089616150c5e6d..f8aad862c6d5263e320d92f83d95eb677e7afc07 100644 (file)
@@ -117,7 +117,7 @@ int misc_init_r(void)
 void *board_fdt_blob_setup(int *err)
 {
        *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)
                        return (ulong *)(uintptr_t)gd->arch.firmware_fdt_addr;
        }
index 4895909f8d6af6a78a5caa4df9546c247d142bb3..6295deeae23404300c75b677896b15c62dd5573a 100644 (file)
@@ -14,7 +14,7 @@
 void *board_fdt_blob_setup(int *err)
 {
        *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)
                        return (ulong *)(uintptr_t)gd->arch.firmware_fdt_addr;
        }