Skip to contentSkip to conversation

mach-k3: add eMMC FS boot support for am62[ap]

PATCH In review Anshul Dalal 2 participants 2 messages Apr 15, 2025 – Apr 24, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mach-k3: add eMMC FS boot support for am62[ap]

This makes spl_mmc_boot_mode consistent across am62x, 62a and 62p.

If MMCSD_MODE_EMMCBOOT is returned, FS boot fails since it checks for FS on the hardware partitions, not the UDA. So to allow FS boot from EMMC, the function should return MMCSD_MODE_FS instead which allows us to read from FS on the UDA.

---
 arch/arm/mach-k3/am62ax/am62a7_init.c | 4 ++++
 arch/arm/mach-k3/am62px/am62p5_init.c | 4 ++++
 2 files changed, 8 insertions(+)
arch/arm/mach-k3/am62ax/am62a7_init.c +4 -0
index 52a21277227..28aee34f30b 100644
@@ -216,6 +216,10 @@ u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)
 
 	switch (bootmode) {
 	case BOOT_DEVICE_EMMC:
+		if (IS_ENABLED(CONFIG_SUPPORT_EMMC_BOOT))
+			return MMCSD_MODE_EMMCBOOT;
+		if (IS_ENABLED(CONFIG_SPL_FS_FAT) || IS_ENABLED(CONFIG_SPL_FS_EXT4))
+			return MMCSD_MODE_FS;
 		return MMCSD_MODE_EMMCBOOT;
 	case BOOT_DEVICE_MMC:
 		if (bootmode_cfg & MAIN_DEVSTAT_PRIMARY_MMC_FS_RAW_MASK)
arch/arm/mach-k3/am62px/am62p5_init.c +4 -0
index 01e47deca94..6e3c66e5107 100644
@@ -262,6 +262,10 @@ u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)
 
 	switch (bootmode) {
 	case BOOT_DEVICE_EMMC:
+		if (IS_ENABLED(CONFIG_SUPPORT_EMMC_BOOT))
+			return MMCSD_MODE_EMMCBOOT;
+		if (IS_ENABLED(CONFIG_SPL_FS_FAT) || IS_ENABLED(CONFIG_SPL_FS_EXT4))
+			return MMCSD_MODE_FS;
 		return MMCSD_MODE_EMMCBOOT;
 	case BOOT_DEVICE_MMC:
 		if (bootmode_cfg & MAIN_DEVSTAT_PRIMARY_MMC_FS_RAW_MASK)
Signature · 1 line
2.49.0
#1 lore raw
Quoted 8 lines · Anshul Dalal

This makes spl_mmc_boot_mode consistent across am62x, 62a and 62p.

If MMCSD_MODE_EMMCBOOT is returned, FS boot fails since it checks for FS on the hardware partitions, not the UDA. So to allow FS boot from EMMC, the function should return MMCSD_MODE_FS instead which allows us to read from FS on the UDA.

[...]

Applied to u-boot/master, thanks!

[1/1] mach-k3: add eMMC FS boot support for am62[ap]

      commit: 3b7893145e3621574f01e0bfde1277ec730dc5b6
Signature · 1 line
Tom