[PATCH 1/2] mx6sabresd: Fix U-Boot corruption after saving the environment
Tom Rini
trini at konsulko.com
Fri Feb 2 14:51:28 CET 2024
On Thu, Feb 01, 2024 at 10:48:48PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <festevam at denx.de>
>
> U-Boot binary has grown in such a way that it goes beyond the reserved
> area for the environment variables.
>
> Running "saveenv" and rebooting the board causes U-Boot to hang because
> of this overlap.
>
> Fix this problem by increasing the CONFIG_ENV_OFFSET.
>
> Also, to prevent this same problem to happen in the future, use
> CONFIG_BOARD_SIZE_LIMIT, which can detect the overlap in build-time.
>
> CONFIG_BOARD_SIZE_LIMIT is calculated as follows:
>
> CONFIG_BOARD_SIZE_LIMIT = CONFIG_ENV_OFFSET - u-boot-img.dtb offset
> CONFIG_BOARD_SIZE_LIMIT = 0xd000 - 69 * 1024
> CONFIG_BOARD_SIZE_LIMIT = 781312
>
> Signed-off-by: Fabio Estevam <festevam at denx.de>
> ---
> configs/mx6sabresd_defconfig | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
I don't like when we have to move the environment like this, can we trim
things down instead? Perhaps LTO?
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20240202/4ffd2739/attachment.sig>
More information about the U-Boot
mailing list