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

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


Hi Stefan,

On Fri, Nov 30, 2018 at 8:29 AM Stefan Roese <sr at denx.de> wrote:

> > -#define CONFIG_ENV_OFFSET                    (8 * SZ_64K)
> > +#define CONFIG_ENV_OFFSET                    (12 * SZ_64K)
>
> I find this hard to read: (12 * SZ_64K). Wouldn't (768 * SZ_1K) be
> better?

Yes, this is a good idea, but it does not work in conjunction with
your suggestion below.

> And I found using CONFIG_BOARD_SIZE_LIMIT quite handy, as it detects
> such increased image growths beyond its limit upon build time. Perhaps
> you could add this as well? This should do it for this board:
>
> #define CONFIG_BOARD_SIZE_LIMIT            CONFIG_ENV_OFFSET

Thanks for this suggestion.

I was not aware of CONFIG_BOARD_SIZE_LIMIT, which is very helpful!

The only issue I see with this approach is that it does not accept
expressions like (768 * SZ_1K):

  SYM     u-boot.sym
/bin/sh: 1: printf: (768 * SZ_1K): expected numeric value
u-boot-nodtb.bin exceeds file size limit:
  limit:  0 bytes
  actual: 482952 bytes
  excess: 482952 bytes
Makefile:1040: recipe for target 'u-boot-nodtb.bin' failed

So I will hardcode CONFIG_ENV_OFFSET and use CONFIG_BOARD_SIZE_LIMIT:

#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

IMHO it is better to get an error in build time when U-Boot and env
area overlaps than providing a pretty CONFIG_ENV_OFFSET format :-)

Thanks!


More information about the U-Boot mailing list