[PATCH v2 2/2] arch: imx8qxp: Override weak fb_mmc_get_boot_offset function

Heiko Schocher hs at nabladev.com
Tue Feb 17 11:12:10 CET 2026


Hello Matjis,

On 17.02.26 10:55, Mattijs Korpershoek wrote:
> Hi Heiko,
> 
> On Tue, Feb 10, 2026 at 06:43, Heiko Schocher <hs at nabladev.com> wrote:
> 
>> From: Adrian Freihofer <adrian.freihofer at siemens.com>
>>
>> Add IMX8QXP SoCs specific implementation of fb_mmc_get_boot_offset()
>>
>> This is needed as bootloader offset is different dependent on SoC
>> revision!
>>
>> For revision B0 the bootloader starts at 32k offset. On offset
>> 0x0 the bootloaders environment is stored.
>>
>> On C0 revisions of the SoC bootloader image starts at offset 0x0
>>
>> Signed-off-by: Adrian Freihofer <adrian.freihofer at siemens.com>
>> Signed-off-by: Heiko Schocher <hs at nabladev.com>
>> Reviewed-by: Mattijs Korpershoek <mkorpershoek at kernel.org>
> 
> Peng did provide some review feedback here:
> https://lore.kernel.org/all/aXbHDnU+SpgnEt+Q@shlinux89/
> 
> I have not seen a response to that. Could you please respond there why
> you did not apply his suggestion?

Seems I missed that email :-(

Yep, that seems a better approach, I will change and send a v3!

Thanks!

bye,
Heiko
> 
>>
>> ---
>>
>> Changes in v2:
>> - added Reviewed-by from Mattijs
>>
>>   arch/arm/mach-imx/imx8/cpu.c | 21 +++++++++++++++++++++
>>   1 file changed, 21 insertions(+)
>>
>> diff --git a/arch/arm/mach-imx/imx8/cpu.c b/arch/arm/mach-imx/imx8/cpu.c
>> index 0e112af661c..27c431881b0 100644
>> --- a/arch/arm/mach-imx/imx8/cpu.c
>> +++ b/arch/arm/mach-imx/imx8/cpu.c
>> @@ -899,3 +899,24 @@ bool m4_parts_booted(void)
>>   
>>   	return false;
>>   }
>> +
>> +#ifdef CONFIG_IMX8QXP
>> +#include <blk.h>
>> +
>> +/*
>> + * On B0 revision SoCs the bootloader is on 32k offset
>> + * and at offset 0x0 is the U-Boot Environment stored
>> + *
>> + * So we cannot flash bootloader images to offset 0x0
>> + *
>> + * On C0 revisions of the SoC bootloader image starts
>> + * at offset 0x0 ...
>> + */
>> +lbaint_t fb_mmc_get_boot_offset(void)
>> +{
>> +	if ((get_cpu_rev() & 0xF) == CHIP_REV_C)
>> +		return 0;
>> +
>> +	return 0x40;
>> +}
>> +#endif
>> -- 
>> 2.20.1

-- 
Nabla Software Engineering
HRB 40522 Augsburg
Phone: +49 821 45592596
E-Mail: office at nabladev.com
Geschäftsführer : Stefano Babic


More information about the U-Boot mailing list