Skip to content

Commit

Permalink
pico-imx7d: Increase the CONFIG_ENV_OFFSET size
Browse files Browse the repository at this point in the history
U-Boot binary has grown in such a way that it goes beyond the reserved
area for the environment variables.

Running "saveenv" causes U-Boot to hang because of this overlap.

Fix this problem by increasing the CONFIG_ENV_OFFSET size.

Also, in order to prevent this same problem in the future, use
CONFIG_BOARD_SIZE_LIMIT, which will detect the overlap in build-time.

CONFIG_BOARD_SIZE_LIMIT does not accept math expressions, so declare
CONFIG_ENV_OFFSET with its direct value instead.

Signed-off-by: Fabio Estevam <[email protected]>
Acked-by: Otavio Salvador <[email protected]>
  • Loading branch information
fabioestevam authored and sbabic committed Jan 1, 2019
1 parent acdf10e commit 57d2beb
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion include/configs/pico-imx7d.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,19 @@
/* FLASH and environment organization */
#define CONFIG_ENV_SIZE SZ_8K

#define CONFIG_ENV_OFFSET (8 * SZ_64K)
/* Environment starts at 768k = 768 * 1024 = 786432 */
#define CONFIG_ENV_OFFSET 786432
/*
* Detect overlap between U-Boot image and environment area in build-time
*
* CONFIG_BOARD_SIZE_LIMIT = CONFIG_ENV_OFFSET - u-boot.img offset
* CONFIG_BOARD_SIZE_LIMIT = 768k - 69k = 699k = 715776
*
* Currently CONFIG_BOARD_SIZE_LIMIT does not handle expressions, so
* write the direct value here
*/
#define CONFIG_BOARD_SIZE_LIMIT 715776

#define CONFIG_SYS_FSL_USDHC_NUM 2

#define CONFIG_SYS_MMC_ENV_DEV 0
Expand Down

0 comments on commit 57d2beb

Please sign in to comment.