Skip to contentSkip to conversation

riscv: ae350: Fix xip config boot failure

PATCH New Andes 1 participant 1 message Apr 20, 2022

lore
Share & tools
lore

Andes

author
#0 lore raw

PATCH 1/1 riscv: ae350: Fix xip config boot failure

From: Rick Chen <[email protected]>

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")
---
 board/AndesTech/ax25-ae350/ax25-ae350.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
board/AndesTech/ax25-ae350/ax25-ae350.c +9 -2
index d6a4291..9ca7fdf 100644
@@ -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;
Signature · 1 line
2.7.4