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.

Signed-off-by: Anshul Dalal <ansh...@ti.com>
---
 arch/arm/mach-k3/am62ax/am62a7_init.c | 4 ++++
 arch/arm/mach-k3/am62px/am62p5_init.c | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/arch/arm/mach-k3/am62ax/am62a7_init.c 
b/arch/arm/mach-k3/am62ax/am62a7_init.c
index 698e6d5c587..47280da2f83 100644
--- a/arch/arm/mach-k3/am62ax/am62a7_init.c
+++ b/arch/arm/mach-k3/am62ax/am62a7_init.c
@@ -207,6 +207,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)
diff --git a/arch/arm/mach-k3/am62px/am62p5_init.c 
b/arch/arm/mach-k3/am62px/am62p5_init.c
index 14a46fa28d2..ec705b9d284 100644
--- a/arch/arm/mach-k3/am62px/am62p5_init.c
+++ b/arch/arm/mach-k3/am62px/am62p5_init.c
@@ -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)
-- 
2.43.0

Reply via email to