[PATCH 1/4] spl: mmc: Respect sector value passed to mmc_load_image_raw_partition

Jan Kiszka jan.kiszka at siemens.com
Thu Nov 27 08:41:05 CET 2025


On 25.11.25 13:16, Marek Vasut wrote:
> On 11/14/25 6:13 PM, Jan Kiszka wrote:
>> From: Jan Kiszka <jan.kiszka at siemens.com>
>>
>> This function and the sector parameter evolved over the time. By now,
>> sector is influenced by spl_mmc_get_uboot_raw_sector which allows to
>> adjust the read sector with an offset that U-Boot proper may have inside
>> the partition. That used to work by chance if both
>> CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR and
>> CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION were enabled. Since
>> 2a00d73d081a they are a choice, and we need to drop the condition to
>> maintain this feature.
>>
>> Signed-off-by: Jan Kiszka <jan.kiszka at siemens.com>
>> ---
>>   common/spl/spl_mmc.c | 4 ----
>>   1 file changed, 4 deletions(-)
>>
>> diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
>> index d8ce3a84614..467114f8d9a 100644
>> --- a/common/spl/spl_mmc.c
>> +++ b/common/spl/spl_mmc.c
>> @@ -136,11 +136,7 @@ static int mmc_load_image_raw_partition(struct
>> spl_image_info *spl_image,
>>           return ret;
>>       }
>>   -#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
>>       return mmc_load_image_raw_sector(spl_image, bootdev, mmc,
>> info.start + sector);
>> -#else
>> -    return mmc_load_image_raw_sector(spl_image, bootdev, mmc,
>> info.start);
>> -#endif
> 
> Could it be, that what you need are two Kconfig options -- one sector
> offset for raw mode (default to 0) and one sector offset for partition
> (default to 0) ?

As the modes are now exclusive-or, I don't see that need. You configure
an offset, and that is relative to the different baselines. But use
sector mode only makes sense when a romloader forces you to hard offset
anyway. The SOCFPGA uses magic partitions, thus does not come with such
a limitation.

Jan

-- 
Siemens AG, Foundational Technologies
Linux Expert Center


More information about the U-Boot mailing list