[PATCH 05/27] sunxi: suniv: add boot sequence for SPL to try
Yifan Gu
me at yifangu.com
Mon Jul 26 01:16:14 CEST 2021
From: Icenowy Zheng <icenowy at aosc.io>
The BROM of suniv do not pass the info of boot media to SPL.
Add boot sequence for SPL to try again for the available boot media.
Signed-off-by: Icenowy Zheng <icenowy at aosc.io>
Signed-off-by: Yifan Gu <me at yifangu.com>
---
arch/arm/mach-sunxi/board.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c
index 3b1a79eb5e..e84687973a 100644
--- a/arch/arm/mach-sunxi/board.c
+++ b/arch/arm/mach-sunxi/board.c
@@ -334,10 +334,32 @@ unsigned long spl_mmc_get_uboot_raw_sector(struct mmc *mmc,
return sector;
}
+
+#ifndef CONFIG_MACH_SUNIV
u32 spl_boot_device(void)
{
return sunxi_get_boot_device();
}
+#else
+/*
+ * suniv BROM do not pass the boot media type to SPL, so we try with the
+ * boot sequence in BROM: mmc0->spinor->fail.
+ */
+void board_boot_order(u32 *spl_boot_list)
+{
+ /*
+ * See the comments above in sunxi_get_boot_device() for infomation
+ * about FEL boot.
+ */
+ if (!is_boot0_magic(SPL_ADDR + 4)) {
+ spl_boot_list[0] = BOOT_DEVICE_BOARD;
+ return;
+ }
+
+ spl_boot_list[0] = BOOT_DEVICE_MMC1;
+ spl_boot_list[1] = BOOT_DEVICE_SPI;
+}
+#endif
void board_init_f(ulong dummy)
{
--
2.25.1
More information about the U-Boot
mailing list