Skip to content
Commit 41fdfae0 authored by Fabio Estevam's avatar Fabio Estevam
Browse files

mx6sabresd: Fix U-Boot corruption after saving the environment



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 selecting CONFIG_LTO so that the U-Boot proper
size can be reduced.

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 = 0xc000 - 69 * 1024
CONFIG_BOARD_SIZE_LIMIT = 715766

Signed-off-by: default avatarFabio Estevam <festevam@denx.de>
Reviewed-by: default avatarTom Rini <trini@konsulko.com>
Reviewed-by: default avatarIgor Opaniuk <igor.opaniuk@foundries.io>
parent 00653867
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment