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

Judith Mendez jm at ti.com
Mon Sep 15 20:31:59 CEST 2025


Hi Moteen,

On 9/15/25 6:35 AM, Moteen Shah wrote:
> Hey Judith,
> 
> On 11/09/25 20:18, Judith Mendez wrote:
>> Hi Udit, Moteen,
>>
>> On 9/10/25 11:38 PM, Kumar, Udit wrote:
>>>
>>> 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
>>
>> No, there are two boot modes. MMCSD boot and EMMC boot. That is what I
>> am trying to make clear with switching:
>>
>> > #define BOOT_DEVICE_MMC                 0x08
>> > #define BOOT_DEVICE_EMMC                0x09
>> To:
>>
>> > #define BOOT_DEVICE_MMCSD                 0x08
>> > #define BOOT_DEVICE_EMMC                0x09
>>
>> When we say: BOOT_DEVICE_MMC, it is not obvious it is from am62x/j722s
>> TRM:
>>
>> MMCSD Boot (SD Card Boot or eMMC Boot using UDA). The goal of these
>> two specific macros is to mimic the supported boot modes.
>>
>>>
>>>
>>>> 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
>>
>> Because the goals is to decouple the bootmodes from the macros used to
>> distinguish eMMC and SD card devices.
> 
> Isn't MMC1=eMMC and MMC2=MMCSD u-boot's own notation? In which case 
> there already is a clear distinction.
> With the case with am62x/j722s, I agree that there needs to be a clarity 
> with the modes, BOOT_DEVICE_MMC is vague.


Firstly, MMC1=eMMC device and MMC2=SD card for K3.
Secondly, when we say we need a better distinction, it is for
distinguishing the boot modes from the BOOT_DEVICE_MMC1 and
BOOT_DEVICE_MMC2 devices. Both of which may be used interchangeably
in spl_mmc_boot_mode() but they are not the same.

~ Judith


> 
>>
>>>
>>>
>>>
>>>> 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
>>
>> I do not have J784s4, Moteen, would you be able to test?
> 
> I tested this series on J784s4, MMCSD boot and eMMC boot 0 boot works fine.
> 
> Regards,
> Moteen
> 
>>
>> ~ Judith



More information about the U-Boot mailing list