[PATCH v2] env: mmc: fix offsets relative to the end of the partition
Michael Walle
mwalle at kernel.org
Tue Jun 10 09:04:27 CEST 2025
Hi Javier,
>> According to the help text, you can set negative offsets to indicated
>> that the offset is relative to the end of the parition. But kconfig
>> doesn't let you specify negative hex values. I think this fell through
>> the cracks when converting the symbol from a '#define' to a kconfig
>> option.
>
> Not sure with u-boot upstream master, but with a downstream NXP-based
> tree (version v2024.04) I think it just works with something like:
>
> ccimx91-dvk_defconfig:CONFIG_ENV_OFFSET=0xFFFFFFFFFFFFC000
> ccimx91-dvk_defconfig:CONFIG_ENV_OFFSET_REDUND=0xFFFFFFFFFFFFC000
> ccimx93-dvk_defconfig:CONFIG_ENV_OFFSET=0xFFFFFFFFFFFFC000
> ccimx93-dvk_defconfig:CONFIG_ENV_OFFSET_REDUND=0xFFFFFFFFFFFFC000
Yeah, but I wouldn't call that very user friendly if you have to
convert the offset the two's complement representation yourself.
> After all, the symbol gets translated to a signed s64 variable.
Also I've just noticed, that env/sf.c uses ulong to store ENV_OFFSET.
-michael
More information about the U-Boot
mailing list