mach-k3: am62*: am62*_init: Prohibit boot from UDA w/ eMMC boot
Subsystems (2)
PATCH 1/1 mach-k3: am62*: am62*_init: Prohibit boot from UDA w/ eMMC boot
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.
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'.
--- 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(-)
arch/arm/mach-k3/am62ax/am62a7_init.c +0 -4
@@ -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 )
arch/arm/mach-k3/am62px/am62p5_init.c +0 -4
@@ -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 )
arch/arm/mach-k3/am62x/am625_init.c +0 -4
@@ -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 )
Signature · 1 line
2.49.0
Quoted 6 lines · Judith Mendez
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.
This is correct, we should not be changing the eMMC boot mode based on what U-Boot config is enabled.
The end user can always use MMCSD as the backup boot mode if they want a fallback.
Quoted 10 lines
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 <[email protected]>
Thanks for the fix,
Anshul
Hi
Could be html for my mobile. Some comments inline.
Il ven 11 lug 2025, 11:44 Anshul Dalal <[email protected]> ha scritto:
Quoted 21 lines · Judith Mendez
Quoted 6 lines
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.
This is correct, we should not be changing the eMMC boot mode based on what U-Boot config is enabled.
The end user can always use MMCSD as the backup boot mode if they want a fallback.
Quoted 7 lines
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'.
Quoted 6 lines
Quoted 3 lines
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 <[email protected]>Reviewed-by Anshul Dalal <[email protected]>
First of all this is not a fix. A fix when you have something that is not working . Then the commit was having a reason the boot0 and boot1 can have limited size that does not allow to have all the TI ecosystem on boot partition and then you must use the the rest of emmc. Booting from this scenario is totally fine
Michael
Quoted 5 lines
Thanks for the fix,
Anshul
Hi,
Michael,
Quoted 34 lines · Michael Nazzareno Trimarchi
Hi
Could be html for my mobile. Some comments inline.
Il ven 11 lug 2025, 11:44 Anshul Dalal <[email protected] <mailto:[email protected]>> ha scritto:
On Thu Jul 10, 2025 at 10:41 PM IST, 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. >This is correct, we should not be changing the eMMC boot mode based on what U-Boot config is enabled.
The end user can always use MMCSD as the backup boot mode if they want a fallback.
> 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 <[email protected] <mailto:[email protected]>>
Quoted 4 lines
Reviewed-by Anshul Dalal <[email protected] <mailto:[email protected]>>First of all this is not a fix. A fix when you have something that is not working . Then the commit was having a reason the boot0 and boot1 can have limited size that does not allow to have all the TI ecosystem on boot partition and then you must use the the rest of emmc. Booting from this scenario is totally fine
It is not working as expected, so it is a fix IMO, but will not fight on that.
AND no, eMMC boot is not expected to boot from UDA. If you want to boot from eMMC UDA, please use MMCSD boot which is the proper boot mode to boot from eMMC UDA in RAW or FS mode.
Quoted 8 lines
Michael
Thanks for the fix,
Anshul
On July 10, 2025 thus sayeth Judith Mendez:
Quoted 7 lines
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.
The logic was added for AM62A/AM62P with commit:
3b7893145e36, but
If we end up respinning this we should probably use the standard 'commit: <sha> "(<msg>)"' syntax.
Quoted 20 lines
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 <[email protected]>--- 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(-)arch/arm/mach-k3/am62ax/am62a7_init.c +0
-0
arch/arm/mach-k3/am62ax/am62a7_init.c u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device) · line 223
Quoted 7 lines
arch/arm/mach-k3/am62ax/am62a7_init.c +0
-4@@ -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 ;
If we're booting from what ROM calls eMMC boot, which ROM has the limitation where we can only boot from MMC0 in 8bit 1v8 and in RAW mode. So I see the need to soften this requirement.
arch/arm/mach-k3/am62ax/am62a7_init.c u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device) · line 221
Quoted 2 lines
arch/arm/mach-k3/am62ax/am62a7_init.c +0
-0return MMCSD_MODE_EMMCBOOT ;case BOOT_DEVICE_MMC :
But it also has what they call MMC/SD mode which gives us the option of booting from both MMC0 and MMC1 and in RAW or FS mode by setting the PORT and RAW pins which we can read in the WKUP_CTRL_MMR0. And can give us the same configuration as the previous boot mode.
I agree if we know the next phases of boot won't fit in the boot partition we should be using this bootmode.
But I know this takes away some functionality after people have already had their boards made and who cannot realistically change their bootmode pins. I wonder if we should mark this as __weak so people can override this in the board/ directory if needed?
~Bryan
On July 17, 2025 thus sayeth Bryan Brattlof:
Quoted 44 lines
On July 10, 2025 thus sayeth Judith Mendez:
Quoted 7 lines
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.
The logic was added for AM62A/AM62P with commit:
3b7893145e36, butIf we end up respinning this we should probably use the standard 'commit: <sha> "(<msg>)"' syntax.
Quoted 20 lines
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 <[email protected]>--- 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(-)arch/arm/mach-k3/am62ax/am62a7_init.c +0
-0arch/arm/mach-k3/am62ax/am62a7_init.c u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device) · line 223
Quoted 7 lines
arch/arm/mach-k3/am62ax/am62a7_init.c +0
-4@@ -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 ;If we're booting from what ROM calls eMMC boot, which ROM has the limitation where we can only boot from MMC0 in 8bit 1v8 and in RAW mode. So I see the need to soften this requirement.
Quoted 8 lines
arch/arm/mach-k3/am62ax/am62a7_init.c u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device) · line 221
Quoted 2 lines
arch/arm/mach-k3/am62ax/am62a7_init.c +0
-0return MMCSD_MODE_EMMCBOOT ;case BOOT_DEVICE_MMC :But it also has what they call MMC/SD mode which gives us the option of booting from both MMC0 and MMC1 and in RAW or FS mode by setting the PORT and RAW pins which we can read in the
WKUP_CTRL_MMR0. And can give us the same configuration as the previous boot mode.
Wait no this is wrong. I think I should point out that this bootmode only works in UDA mode. MMC/SD mode can be configured to use RAW offsets or a FS to find the binary, but will not look in the boot partitions.
Quoted 7 lines
I agree if we know the next phases of boot won't fit in the boot partition we should be using this bootmode.
But I know this takes away some functionality after people have already had their boards made and who cannot realistically change their bootmode pins. I wonder if we should mark this as
__weakso people can override this in the board/ directory if needed?
I still tend to agree we don't really want to modify the boodmode for the next phase but with falcon mode and how massive U-Boot can be sometimes. I don't think we can get away from this unless we let individual boards modify this for their own need.
~Bryan
Quoted 66 lines · Bryan Brattlof
On July 17, 2025 thus sayeth Bryan Brattlof:
Quoted 44 lines
On July 10, 2025 thus sayeth Judith Mendez:
Quoted 7 lines
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.
The logic was added for AM62A/AM62P with commit:
3b7893145e36, butIf we end up respinning this we should probably use the standard 'commit: <sha> "(<msg>)"' syntax.
Quoted 20 lines
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 <[email protected]>--- 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(-)arch/arm/mach-k3/am62ax/am62a7_init.c +0
-0arch/arm/mach-k3/am62ax/am62a7_init.c u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device) · line 223
Quoted 7 lines
arch/arm/mach-k3/am62ax/am62a7_init.c +0
-4@@ -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 ;If we're booting from what ROM calls eMMC boot, which ROM has the limitation where we can only boot from MMC0 in 8bit 1v8 and in RAW mode. So I see the need to soften this requirement.
Quoted 8 lines
arch/arm/mach-k3/am62ax/am62a7_init.c u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device) · line 221
Quoted 2 lines
arch/arm/mach-k3/am62ax/am62a7_init.c +0
-0return MMCSD_MODE_EMMCBOOT ;case BOOT_DEVICE_MMC :But it also has what they call MMC/SD mode which gives us the option of booting from both MMC0 and MMC1 and in RAW or FS mode by setting the PORT and RAW pins which we can read in the
WKUP_CTRL_MMR0. And can give us the same configuration as the previous boot mode.Wait no this is wrong. I think I should point out that this bootmode only works in UDA mode. MMC/SD mode can be configured to use RAW offsets or a FS to find the binary, but will not look in the boot partitions.
Quoted 7 lines
I agree if we know the next phases of boot won't fit in the boot partition we should be using this bootmode.
But I know this takes away some functionality after people have already had their boards made and who cannot realistically change their bootmode pins. I wonder if we should mark this as
__weakso people can override this in the board/ directory if needed?
Quoted 5 lines
I still tend to agree we don't really want to modify the boodmode for the next phase but with falcon mode and how massive U-Boot can be sometimes. I don't think we can get away from this unless we let individual boards modify this for their own need.
Core issue is we assume all boot stages are stored on the same boot media. Usually this is a good assumption, and without it we would have to hard-code where the next boot stage is located at compile time. The big exception being the eMMC BOOT partition which is not big enough for all stages, so at some point we have to switch (usually to the eMMC's UDA partition), but *when* we switch is not clear. It could be after R5 SPL, or A53 SPL, or after U-Boot proper (only kernel/rootfs need stored on UDA).
The logic we have in U-Boot now is that you pick when you want to switch by disabling CONFIG_SUPPORT_EMMC_BOOT for the stage before the stage on the UDA FS partition. But this is confusing, forces FS mode, and only works if you don't switch between the two A53 stages.
Some better way to configure when to switch would be useful, and not just for eMMC, for instance I test R5 SPL by loading test builds over UART, but I want the next stages that I'm not testing to be loaded from the SD card, could we make a simple way to encode this without overwriting spl_boot_device()?
Andrew
Hi Andrew,
Quoted 89 lines · Andrew Davis
Quoted 67 lines · Bryan Brattlof
On July 17, 2025 thus sayeth Bryan Brattlof:
Quoted 45 lines
On July 10, 2025 thus sayeth Judith Mendez:
Quoted 7 lines
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.
The logic was added for AM62A/AM62P with commit:
3b7893145e36, butIf we end up respinning this we should probably use the standard 'commit: <sha> "(<msg>)"' syntax.
Quoted 22 lines
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 <[email protected]>---
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(-)arch/arm/mach-k3/am62ax/am62a7_init.c +0
-0@@ -217,10 +217,6 @@ u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device) switch (bootmode) {Quoted 6 lines
case
BOOT_DEVICE_EMMC:
- if (IS_ENABLED(CONFIG_SUPPORT_EMMC_BOOT)) - returnMMCSD_MODE_EMMCBOOT;
- if (IS_ENABLED(CONFIG_SPL_FS_FAT)||IS_ENABLED(CONFIG_SPL_FS_EXT4))
- returnMMCSD_MODE_FS;If we're booting from what ROM calls eMMC boot, which ROM has the limitation where we can only boot from MMC0 in 8bit 1v8 and in RAW mode. So I see the need to soften this requirement.
Quoted 8 lines
Quoted 2 lines
return
MMCSD_MODE_EMMCBOOT;
caseBOOT_DEVICE_MMC:But it also has what they call MMC/SD mode which gives us the option of booting from both MMC0 and MMC1 and in RAW or FS mode by setting the PORT and RAW pins which we can read in the
WKUP_CTRL_MMR0. And can give us the same configuration as the previous boot mode.Wait no this is wrong. I think I should point out that this bootmode only works in UDA mode. MMC/SD mode can be configured to use RAW offsets or a FS to find the binary, but will not look in the boot partitions.
Quoted 7 lines
I agree if we know the next phases of boot won't fit in the boot partition we should be using this bootmode.
But I know this takes away some functionality after people have already had their boards made and who cannot realistically change their bootmode pins. I wonder if we should mark this as
__weakso people can override this in the board/ directory if needed?Quoted 5 lines
I still tend to agree we don't really want to modify the boodmode for the next phase but with falcon mode and how massive U-Boot can be sometimes. I don't think we can get away from this unless we let individual boards modify this for their own need.
Core issue is we assume all boot stages are stored on the same boot media. Usually this is a good assumption, and without it we would have to hard-code where the next boot stage is located at compile time. The big exception being the eMMC BOOT partition which is not big enough for all stages, so at some point we have to switch (usually to the eMMC's UDA partition), but *when* we switch is not clear. It could be after R5 SPL, or A53 SPL, or after U-Boot proper (only kernel/rootfs need stored on UDA).
The logic we have in U-Boot now is that you pick when you want to switch by disabling
CONFIG_SUPPORT_EMMC_BOOTfor the stage before the stage on the UDA FS partition. But this is confusing, forces FS mode, and only works if you don't switch between the two A53 stages.
Quoted 5 lines
Some better way to configure when to switch would be useful, and not just for eMMC, for instance I test R5 SPL by loading test builds over UART, but I want the next stages that I'm not testing to be loaded from the SD card, could we make a simple way to encode this without overwriting
spl_boot_device()?
The goal of this patch was to clean up code due to questions we get asked: I am booting with eMMC boot, but why is the wrong image used, eMMC boot doesn't boot from UDA, why is the code returning MMCSD_MODE_FS, etc... What you are suggesting is to further enhance the feature that we have atm. If the end-user selects eMMC boot based-off the TRM boot mode pins and with some flags or bits, we can select not only MMCSD boot from UDA, but other boot modes, won't this make the issue worse???
~ Judith
Quoted 5 lines · Judith Mendez
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.
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.
NAK if you are trying to bring the old problems we solved back.
Quoted 65 lines
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 <[email protected]>--- 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(-)arch/arm/mach-k3/am62ax/am62a7_init.c +0
-4@@ -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 )arch/arm/mach-k3/am62px/am62p5_init.c +0
-4@@ -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 )arch/arm/mach-k3/am62x/am625_init.c +0
-4@@ -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 )Signature · 1 line
2.49.0
Signature · 4 lines
Regards, Nishanth Menon Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D https://ti.com/opensource
Quoted 10 lines · Nishanth Menon
Quoted 5 lines · Judith Mendez
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.
Quoted 6 lines
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.
Quoted 2 lines
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).
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
Quoted 66 lines
Quoted 65 lines
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 <[email protected]>--- 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(-)arch/arm/mach-k3/am62ax/am62a7_init.c +0
-4@@ -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 )arch/arm/mach-k3/am62px/am62p5_init.c +0
-4@@ -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 )arch/arm/mach-k3/am62x/am625_init.c +0
-4@@ -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 )Signature · 1 line
2.49.0
Hi
Il gio 21 ago 2025, 20:51 Andrew Davis <[email protected]> ha scritto:
Quoted 27 lines · Nishanth Menon
Quoted 10 lines · Judith Mendez
Quoted 5 lines
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.
Quoted 1 line
https://docs.u-boot.org/en/latest/board/beagle/am62x_beagleplay.html#flash-to-emmc
Quoted 5 lines
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.
Quoted 8 lines
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?
Quoted 10 lines
Quoted 2 lines
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_BOOTCONFIG_SUPPORT_EMMC_BOOT_OVERRIDE_PART_CONFIG=yCONFIG_SYS_MMCSD_RAW_MODE_EMMC_BOOT_PARTITION=0
Michael
Quoted 88 lines
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
Quoted 6 lines
Quoted 6 lines
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
Quoted 11 lines
Quoted 11 lines
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 <[email protected]>--- 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(-)Quoted 1 line
Review
Quoted 1 line
(quoted diff) +0
-0
b/arch/arm/mach-k3/am62ax/am62a7_init.cQuoted 4 lines
arch/arm/mach-k3/am62ax/am62a7_init.c u32 spl_mmc_boot_mode(struct mmc *mmc, const u32
Quoted 4 lines
index
edd43a1d78d..1d8644bd073100644arch/arm/mach-k3/am62ax/am62a7_init.c +0
-0@@ -217,10 +217,6 @@ u32 spl_mmc_boot_mode(struct mmc *mmc, const u32
boot_device)Quoted 6 lines
arch/arm/mach-k3/am62ax/am62a7_init.c u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)
Quoted 6 lines
arch/arm/mach-k3/am62ax/am62a7_init.c +0
-3switch (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))Quoted 5 lines
Review
Quoted 5 lines
arch/arm/mach-k3/am62ax/am62a7_init.c +0
-1-return MMCSD_MODE_FS ;return MMCSD_MODE_EMMCBOOT ;case BOOT_DEVICE_MMC :if (bootmode_cfg &MAIN_DEVSTAT_PRIMARY_MMC_FS_RAW_MASK )(quoted diff) +0
-0
b/arch/arm/mach-k3/am62px/am62p5_init.cQuoted 4 lines
arch/arm/mach-k3/am62px/am62p5_init.c u32 spl_mmc_boot_mode(struct mmc *mmc, const u32
Quoted 4 lines
index
6e3c66e5107..01e47deca94100644arch/arm/mach-k3/am62px/am62p5_init.c +0
-0@@ -262,10 +262,6 @@ u32 spl_mmc_boot_mode(struct mmc *mmc, const u32
boot_device)Quoted 6 lines
arch/arm/mach-k3/am62px/am62p5_init.c u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 · line 266
Quoted 6 lines
arch/arm/mach-k3/am62px/am62p5_init.c +0
-3switch (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))Quoted 5 lines
Review
Quoted 5 lines
arch/arm/mach-k3/am62px/am62p5_init.c +0
-1-return MMCSD_MODE_FS ;return MMCSD_MODE_EMMCBOOT ;case BOOT_DEVICE_MMC :if (bootmode_cfg &MAIN_DEVSTAT_PRIMARY_MMC_FS_RAW_MASK )(quoted diff) +0
-0
b/arch/arm/mach-k3/am62x/am625_init.cQuoted 4 lines
arch/arm/mach-k3/am62x/am625_init.c u32 spl_mmc_boot_mode(struct mmc *mmc, const u32
Quoted 4 lines
index
a422919fab1..eb7e245843c100644arch/arm/mach-k3/am62x/am625_init.c +0
-0@@ -316,10 +316,6 @@ u32 spl_mmc_boot_mode(struct mmc *mmc, const u32
boot_device)Quoted 6 lines
arch/arm/mach-k3/am62x/am625_init.c u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 · line 320
Quoted 6 lines
arch/arm/mach-k3/am62x/am625_init.c +0
-3switch (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))Quoted 8 lines
Quoted 7 lines
arch/arm/mach-k3/am62x/am625_init.c +0
-2-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
Quoted 7 lines · Nishanth Menon
Quoted 5 lines · Judith Mendez
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.
Quoted 8 lines
Wrong! what ROM uses to boot has no bearing as to what bootloader needs to do for rest of the system.
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.
Maybe it is time to think about how to shrink the bootloader binaries again. And I am not talking about introducing new defconfigs for specific boot sources such as ethernet or usb.
We would really like to keep it as is and have all three bootloader binaries on the boot partitions.
By the way, are you aware that some eMMC devices allow you to change the size of their boot partitions?
Quoted 69 lines
NAK if you are trying to bring the old problems we solved back.
Quoted 65 lines
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 <[email protected]>--- 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(-)arch/arm/mach-k3/am62ax/am62a7_init.c +0
-4@@ -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 )arch/arm/mach-k3/am62px/am62p5_init.c +0
-4@@ -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 )arch/arm/mach-k3/am62x/am625_init.c +0
-4@@ -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 )Signature · 1 line
2.49.0