[PATCH 1/4] arm: mach-k3: Fix MMC macros

Kumar, Udit u-kumar1 at ti.com
Thu Sep 11 06:38:33 CEST 2025


On 9/11/2025 3:15 AM, Judith Mendez wrote:
> For all K3 SoC's eMMC boot and MMCSD boot modes are supported. The macros
> however, mix MMC device with the two bootmodes. Decouple the two types
> of macros so that bootmodes can be identified with:
> - BOOT_DEVICE_MMCSD
> - BOOT_DEVICE_EMMC

Few devices already (kind of have this )

arch/arm/mach-k3/include/mach/j722s_spl.h

#define BOOT_DEVICE_MMC                 0x08
#define BOOT_DEVICE_EMMC                0x09

can we use in same way, BOOT_DEVICE_MMC  as SD instead of adding SD as 
postfix and

and add BOOT_DEVICE_EMMC, on devices where this is missing


> according to devstat parsed boot mode values and on-board devices can be
> identified with:
> - BOOT_DEVICE_MMC1
> - BOOT_DEVICE_MMC2
> - BOOT_DEVICE_MMC2_2

Why you need to change

#define for BOOT_DEVICE_MMC1 and and BOOT_DEVICE_MMC2



> according to arbitrary numbers mainly used to differentiate between eMMC
> and SD card.

Please check subject line, this is not a fix

> Signed-off-by: Judith Mendez <jm at ti.com>
> ---
>   arch/arm/mach-k3/am62ax/am62a7_init.c          |  4 ++--
>   arch/arm/mach-k3/am62ax/boot.c                 |  8 ++++----
>   arch/arm/mach-k3/am62px/am62p5_init.c          | 12 ++++++------
>   arch/arm/mach-k3/am62x/am625_init.c            |  4 ++--
>   arch/arm/mach-k3/am62x/boot.c                  |  8 ++++----
>   arch/arm/mach-k3/am64x/boot.c                  |  8 ++++----
>   arch/arm/mach-k3/am65x/am654_init.c            | 18 ++++++++++--------
>   arch/arm/mach-k3/include/mach/am62_hardware.h  |  8 ++++----
>   arch/arm/mach-k3/include/mach/am62_spl.h       | 10 +++++-----
>   arch/arm/mach-k3/include/mach/am62a_hardware.h |  8 ++++----
>   arch/arm/mach-k3/include/mach/am62a_spl.h      | 10 +++++-----
>   arch/arm/mach-k3/include/mach/am62p_hardware.h |  8 ++++----
>   arch/arm/mach-k3/include/mach/am62p_spl.h      | 10 +++++-----
>   arch/arm/mach-k3/include/mach/am64_hardware.h  |  4 ++--
>   arch/arm/mach-k3/include/mach/am64_spl.h       | 13 +++++++------
>   arch/arm/mach-k3/include/mach/am6_hardware.h   |  8 ++++----
>   arch/arm/mach-k3/include/mach/am6_spl.h        | 13 +++++++++----
>   arch/arm/mach-k3/include/mach/j721e_hardware.h |  6 +++---
>   arch/arm/mach-k3/include/mach/j721e_spl.h      | 14 ++++++++++----
>   .../arm/mach-k3/include/mach/j721s2_hardware.h |  6 +++---
>   arch/arm/mach-k3/include/mach/j721s2_spl.h     | 13 +++++++++----
>   arch/arm/mach-k3/include/mach/j722s_hardware.h |  8 ++++----
>   arch/arm/mach-k3/include/mach/j722s_spl.h      | 10 +++++-----
>   .../arm/mach-k3/include/mach/j784s4_hardware.h |  6 +++---
>   arch/arm/mach-k3/include/mach/j784s4_spl.h     | 13 +++++++++----
>   arch/arm/mach-k3/j721e/j721e_init.c            | 14 +++++++++-----
>   arch/arm/mach-k3/j721s2/j721s2_init.c          | 14 +++++++++-----
>   arch/arm/mach-k3/j722s/j722s_init.c            | 12 ++++++------
>   arch/arm/mach-k3/j784s4/j784s4_init.c          | 14 +++++++++-----
>   29 files changed, 160 insertions(+), 124 deletions(-)
>
> diff --git a/arch/arm/mach-k3/am62ax/am62a7_init.c b/arch/arm/mach-k3/am62ax/am62a7_init.c
> index 00173e6836b..1fd466bbdfc 100644
> --- a/arch/arm/mach-k3/am62ax/am62a7_init.c
> +++ b/arch/arm/mach-k3/am62ax/am62a7_init.c
> @@ -225,8 +225,8 @@ u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)
>   		if (IS_ENABLED(CONFIG_SPL_FS_FAT) || IS_ENABLED(CONFIG_SPL_FS_EXT4))
>   			return MMCSD_MODE_FS;
>   		return MMCSD_MODE_EMMCBOOT;
> [..]
>   
> +	if (bootmode == BOOT_DEVICE_EMMC)
> +		bootmode = BOOT_DEVICE_MMC1;
> +

Could you test once, eMMC on J784s4


>   	return bootmode;
>   }
>   


More information about the U-Boot mailing list