[U-Boot] Separately compile Master boot loader

Wolfgang Denk wd at denx.de
Thu Jul 11 12:08:19 CEST 2013


Dear Albert,

In message <20130711103507.48bd224f at lilith> you wrote:
> 
> SPL has never been used for NOR FLASH booting, since basically if you
> have NOR, then you can start U-boot directly from there whatever its
> size, and the first thing it does is setting up DDR and relocating
> there; therefore there is (currently) no need for SPL with NOR.

This is not correct.  SPL on NOR is in no way special from SPL on
other boot devices.  We have successfully used SPL (in Falcon mode) on
NOR flash to reduce boot times.  for example, the MPC5200 (PPC) based
a4m2k board uses SPL on NOR; see include/configs/a3m071.h

> - make the SPL framework able to run from NOR and chain-load U-boot from
>   NOR too;

This has been done before.  It is not a special case, actually.

> - make SPL able to select the U-Boot it chainloads to, for instance
>   through env variables that override the SPL defaults (maybe looking
>   at the Falcon mode might give you ideas on how to best do this);

Adding environment support to SPL on NOR is trivial; it boils down to
adding CONFIG_SPL_ENV_SUPPORT to the board configuration.

> The very first build would produce SPL as your initial (and hopefully
> final, too) "Master -U-Boot", and U-Boot as your initial, u-boot-1,
> payload. This, flashed onto your target, should boot.
> 
> The subsequent builds would build newer SPL (arguably useless if same
> as the previous one) and newer U-boot (which would be the "upgrade"
> one). You could then, from the u-boot-1 prompt, manually flash this
> 'new' u-boot-2 and set the environment for an upgrade, then reboot and
> test your upgrade procedure.

Correct.  And no additional code needs to be written to do all this.
It's all ready available out of box.

> If rebuilding SPL when not needed is really a pain to you despite not
> being the most time-critical task in your overall process, you could
> also patch the U-boot build system to allow skipping the SPL build.
> Maybe some other boards would be interested in that too, BTW.

I think the overhead of always building the SPL is small enough so
this can probably be ignored.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
One difference between a man and a machine is that a machine is quiet
when well oiled.


More information about the U-Boot mailing list