[PATCH] stm32mp1: spl: support loading U-Boot proper from eMMC hardware partitions

Patrice CHOTARD patrice.chotard at foss.st.com
Mon Jun 29 08:50:31 CEST 2026



On 6/25/26 08:14, Patrice CHOTARD wrote:
> 
> 
> On 6/18/26 11:28, Sean Nyekjaer wrote:
>> When CONFIG_SUPPORT_EMMC_BOOT is enabled, make spl_mmc_boot_mode()
>> return MMCSD_MODE_EMMCBOOT instead of MMCSD_MODE_RAW.
>>
>> This allows the SPL MMC loader to honor the standard configuration
>> options CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION and
>> CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR when locating U-Boot proper,
>> whether it is stored in a GPT partition or in an eMMC hardware boot
>> partition.
>>
>> As a result, both U-Boot SPL and U-Boot proper can be placed in the
>> eMMC hardware boot partitions.
>>
>> Signed-off-by: Sean Nyekjaer <sean at geanix.com>
>> ---
>>  arch/arm/mach-stm32mp/stm32mp1/spl.c | 5 -----
>>  1 file changed, 5 deletions(-)
>>
>> diff --git a/arch/arm/mach-stm32mp/stm32mp1/spl.c b/arch/arm/mach-stm32mp/stm32mp1/spl.c
>> index d2e41b8e65f..d2af705a5d1 100644
>> --- a/arch/arm/mach-stm32mp/stm32mp1/spl.c
>> +++ b/arch/arm/mach-stm32mp/stm32mp1/spl.c
>> @@ -56,11 +56,6 @@ u32 spl_boot_device(void)
>>  	return BOOT_DEVICE_MMC1;
>>  }
>>  
>> -u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)
>> -{
>> -	return MMCSD_MODE_RAW;
>> -}
>> -
>>  #ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
>>  int spl_mmc_boot_partition(const u32 boot_device)
>>  {
> 
> Hi Sean
> 
> Reviewed-by: Patrice Chotard <patrice.chotard at foss.st.com>
> 
> Thanks
> Patrice

Hi Sean

After a discussion with Patrick, it should be safer to keep spl_mmc_boot_mode()
implemented as following: 

u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)
{
	return IS_SD(mmc) ? MMCSD_MODE_RAW : MMCSD_MODE_EMMCBOOT;
}

Thanks
Patrice


More information about the U-Boot mailing list