[U-Boot] [PATCH 13/14] sunxi: Transition from the MMC to a FAT-based environment

Maxime Ripard maxime.ripard at free-electrons.com
Fri Dec 8 08:42:50 UTC 2017


Hi, Andre,

On Tue, Dec 05, 2017 at 10:28:20AM +0000, Andre Przywara wrote:
> Hi,
> 
> On 28/11/17 10:24, Maxime Ripard wrote:
> > The current environment has been hardcoded to an offset that starts to be
> > an issue given the current size of our main U-Boot binary.
> > 
> > By implementing a custom environment location routine, we can always favor
> > the FAT-based environment, and fallback to the MMC if we don't find
> > something in the FAT partition. We also implement the same order when
> > saving the environment, so that hopefully we can slowly migrate the users
> > over to FAT-based environment and away from the raw MMC one.
> > 
> > Eventually, and hopefully before we reach that limit again, we will have
> > most of our users using that setup, and we'll be able to retire the raw
> > environment, and gain more room for the U-Boot binary.
> > 
> > Reviewed-by: Lukasz Majewski <lukma at denx.de>
> > Signed-off-by: Maxime Ripard <maxime.ripard at free-electrons.com>
> > ---
> >  board/sunxi/board.c | 16 ++++++++++++++++
> >  1 file changed, 16 insertions(+)
> > 
> > diff --git a/board/sunxi/board.c b/board/sunxi/board.c
> > index dcacdf3e626d..8891961dcc6b 100644
> > --- a/board/sunxi/board.c
> > +++ b/board/sunxi/board.c
> > @@ -173,6 +173,22 @@ void i2c_init_board(void)
> >  #endif
> >  }
> >  
> > +#if defined(CONFIG_ENV_IS_IN_MMC) && defined(CONFIG_ENV_IS_IN_FAT)
> > +enum env_location env_get_location(enum env_operation op, int prio)
> > +{
> > +	switch (prio) {
> > +	case 0:
> > +		return ENVL_FAT;
> > +
> > +	case 1:
> > +		return ENVL_MMC;
> 
> So even though the actual u-boot.bin for 64-bit boards is still somewhat
> below the limit (~480KB), adding the ATF image (~32KB) pushes it over
> the edge. So since v2017.11 u-boot.itb is already too big for the
> traditional MMC env location.

Even with the alignment fix you merged recently?

> So shall this "case 1:" be guarded by #ifndef CONFIG_ARM64, to not even
> consider MMC for sunxi64 anymore?

I guess it's even simpler: you just don't enable ENV_IS_IN_MMC if
ARM64 is set :)

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171208/6aeecc9d/attachment.sig>


More information about the U-Boot mailing list