* [PATCH] riscv: ae350: Fix xip config boot failure
@ 2022-04-20 1:33 Andes
0 siblings, 0 replies; only message in thread
From: Andes @ 2022-04-20 1:33 UTC (permalink / raw)
To: u-boot; +Cc: rick, rickchen36, ycliang
From: Rick Chen <rick@andestech.com>
It will fail to boot with ae350_rv[32|64]_spl_xip_defconfig.
It need to add OONFIG_XIP to get the specific HW address for DTB.
Also drop OF_SEPARATE in board_fdt_blob_setup() because it will
never reach here anyway.It only allow OF_BOARD to call
board_fdt_blob_setup() in fdtdec_setup().
Fixes: 2e8d2f88439d ("riscv: Remove OF_PRIOR_STAGE from RISC-V boards")
Signed-off-by: Rick Chen <rick@andestech.com>
---
board/AndesTech/ax25-ae350/ax25-ae350.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/board/AndesTech/ax25-ae350/ax25-ae350.c b/board/AndesTech/ax25-ae350/ax25-ae350.c
index d6a4291..9ca7fdf 100644
--- a/board/AndesTech/ax25-ae350/ax25-ae350.c
+++ b/board/AndesTech/ax25-ae350/ax25-ae350.c
@@ -54,13 +54,20 @@ ulong board_flash_get_legacy(ulong base, int banknum, flash_info_t *info)
return 0;
}
+#define ANDES_HW_DTB_ADDRESS 0xF2000000
void *board_fdt_blob_setup(int *err)
{
*err = 0;
+
#if defined(CONFIG_OF_BOARD)
- return (void *)(ulong)gd->arch.firmware_fdt_addr;
-#elif defined(CONFIG_OF_SEPARATE)
+#if (defined(CONFIG_XIP) && CONFIG_IS_ENABLED(RISCV_MMODE))
+ if (fdt_magic(CONFIG_SYS_FDT_BASE) == FDT_MAGIC)
return (void *)CONFIG_SYS_FDT_BASE;
+ return (void *)ANDES_HW_DTB_ADDRESS;
+#else
+
+ return (void *)(ulong)gd->arch.firmware_fdt_addr;
+#endif
#else
*err = -EINVAL;
return NULL;
--
2.7.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-04-20 1:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-20 1:33 [PATCH] riscv: ae350: Fix xip config boot failure Andes
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.