[U-Boot] [PATCH v2] pico-imx7d: Increase the CONFIG_ENV_OFFSET size

Fabio Estevam festevam at gmail.com
Fri Nov 30 14:25:10 UTC 2018


Hi Wolfgang,

On Fri, Nov 30, 2018 at 11:13 AM Wolfgang Denk <wd at denx.de> wrote:

> This is why I always prefer to use expressions that are both
> readable and computable, like (768 << 10).
>
> > #define CONFIG_ENV_OFFSET 786432
>
> Would
>
> #define CONFIG_ENV_OFFSET (768 << 10)
>
> or at least
>
> #define CONFIG_ENV_OFFSET (768 * 1024)
>
> work?

CONFIG_BOARD_SIZE_LIMIT does not accept such definitions and it fails like this:

/bin/sh: 1: printf: (768 << 10): expected numeric value
u-boot-nodtb.bin exceeds file size limit:
  limit:  0 bytes
  actual: 482952 bytes
  excess: 482952 bytes

That is the reason I used  #define CONFIG_ENV_OFFSET 786432

> > /* Detect overlap between U-Boot image and environment area in build-time */
> > #define CONFIG_BOARD_SIZE_LIMIT CONFIG_ENV_OFFSET
>
> Note this is only correct if the U-Boot image gets written at offset
> zero - is this the case?

That is a good point!

In this case SPL is flashed at offset 1k and u-boot.img is flashed at
offset 69k.

So I guess I should hardcode CONFIG_BOARD_SIZE_LIMIT to 768k - 69k =
699k = 715776.

#define CONFIG_ENV_OFFSET 715776
/* Detect overlap between U-Boot image and environment area in build-time */
#define CONFIG_BOARD_SIZE_LIMIT CONFIG_ENV_OFFSET


More information about the U-Boot mailing list