[PATCH] mach-k3: am62*: am62*_init: Prohibit boot from UDA w/ eMMC boot

Michael Nazzareno Trimarchi michael at amarulasolutions.com
Fri Aug 22 09:43:37 CEST 2025


Hi

Il gio 21 ago 2025, 20:51 Andrew Davis <afd at ti.com> ha scritto:

> On 8/21/25 1:30 PM, Nishanth Menon wrote:
> > On 12:11-20250710, Judith Mendez wrote:
> >> This removes support from booting from UDA when in eMMC boot.
> >>
> >> When user selects eMMC boot [0], that is, boot from eMMC boot0 or
> >> boot1 HW partitions, we should not boot from eMMC UDA. The current
> >> logic confuses the end user and mixes two different boot modes.
> >
> > Wrong! what ROM uses to boot has no bearing as to what bootloader needs
> > to do for rest of the system.
> >
>
> Yes it does, this is how *every* single other boot mode works. We pick
> the next stage from the same media we booted this stage from. If I OSPI
> boot SPL, it will look for U-Boot on OSPI, UART, DFU, NET, etc..
>
> eMMC boot0 is the *only* exception to this rule. We pivot from boot0 to
> UDA.
>
> >
> https://docs.u-boot.org/en/latest/board/beagle/am62x_beagleplay.html#flash-to-emmc
> >
> > There is a reason we chose this flow in BeaglePlay and other Beagle
> > platforms - U-boot and other components keep growing and our emmc's boot
> > partition is too small to handle things.
> >
>
> eMMC's boot partition are 4-8MB, more than enough for tiboot3.bin,
> tispl.bin
> and u-boot.img. Sure it is not big enough to handle the next stages like
> Kernel,
> but that is now located on a different rootfs partition anyway, even for
> regular
> SD card booting.
>

Well no. There are emmc with smaller partitions, and my commit was coming
from
this scenario. The general case it's to be able to switch and load the
second stage where
the user decides to put it. Is there any reason that you need to force it?


> >
> > NAK if you are trying to bring the old problems we solved back.
>
> You did not solve it, you hacked it for your specific Beagle use-case.
> Now if someone instead wants to boot all stages from Boot0 they have no
> good option for that. It will switch to UDA after R5 SPL if they like it
> or not. The only way to stop it would be to enable "SUPPORT_EMMC_BOOT"
> config (confusing why that changes the boot flow), or disable SPL_FS_*
> configs (again confusing why filesystem support changes boot media flow).
>

I think that I use this way to override

CONFIG_SUPPORT_EMMC_BOOT
CONFIG_SUPPORT_EMMC_BOOT_OVERRIDE_PART_CONFIG=y
CONFIG_SYS_MMCSD_RAW_MODE_EMMC_BOOT_PARTITION=0

Michael



>
> Plan is to add a clean and explicit config option that signals the
> boot0 -> UDA pivot should happen. Since you want your Beagle's to do
> that, the option will be enabled for you. For those who want to stick
> to all boot stages on boot0, then they disable the option. Simple :)
>
> Judith is working on that now for v2.
>
> Andrew
>
> >>
> >> The logic was added for AM62A/AM62P with commit: 3b7893145e36, but
> >> this is not a clean solution and fix will come later for falcon boot.
> >>
> >> Logic was also added for AM62X with commit: 664593464634, but this
> >> logic is incorrect according to TRM [0] under Primary Boot Mode
> Selection
> >> for 'eMMC Boot'.
> >>
> >> Fixes: 3b7893145e36 ("mach-k3: add eMMC FS boot support for am62[ap]")
> >> Fixes: 664593464634 ("arm: mach-k3: am625: Relax emmc boot condition")
> >> Signed-off-by: Judith Mendez <jm at ti.com>
> >> ---
> >>   arch/arm/mach-k3/am62ax/am62a7_init.c | 4 ----
> >>   arch/arm/mach-k3/am62px/am62p5_init.c | 4 ----
> >>   arch/arm/mach-k3/am62x/am625_init.c   | 4 ----
> >>   3 files changed, 12 deletions(-)
> >>
> >> diff --git a/arch/arm/mach-k3/am62ax/am62a7_init.c
> b/arch/arm/mach-k3/am62ax/am62a7_init.c
> >> index edd43a1d78d..1d8644bd073 100644
> >> --- a/arch/arm/mach-k3/am62ax/am62a7_init.c
> >> +++ b/arch/arm/mach-k3/am62ax/am62a7_init.c
> >> @@ -217,10 +217,6 @@ 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 6e3c66e5107..01e47deca94 100644
> >> --- a/arch/arm/mach-k3/am62px/am62p5_init.c
> >> +++ b/arch/arm/mach-k3/am62px/am62p5_init.c
> >> @@ -262,10 +262,6 @@ 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/am62x/am625_init.c
> b/arch/arm/mach-k3/am62x/am625_init.c
> >> index a422919fab1..eb7e245843c 100644
> >> --- a/arch/arm/mach-k3/am62x/am625_init.c
> >> +++ b/arch/arm/mach-k3/am62x/am625_init.c
> >> @@ -316,10 +316,6 @@ 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.49.0
> >>
> >
>
>


More information about the U-Boot mailing list