[U-Boot] [PATCH 00/27] spl: Use linker list and parameters for SPL image loading

Tom Rini trini at konsulko.com
Mon Sep 19 00:14:31 CEST 2016


On Sun, Sep 18, 2016 at 01:44:49PM -0600, Simon Glass wrote:

> At present the SPL code uses a global spl_image variable which is shared
> amongst lots of files, some in common/spl and some elsewhere. There is no
> need for this to be global, and in fact a parameter makes it easier to
> understand what information the functions act on. It also reduces the BSS
> use in the SPL (at the expense of stack) which is useful on boards which
> don't have BSS available early on.

Thanks for taking a stab at cleaning this up.

[snip]
> There is a priorty value attached to each loader which should allow the
> existing ordering to be maintained.

I worry here about some of the corner cases, but it's probably no more
or less fragile than currently at least.  I'm actually not sure how
that's working in this version of the series, everyone gets priority 0
filled in so it seems like we're on linker order.  But I'm also not
convinced that it's a problem here.  As far as I can recall, the use
cases are that a given binary will support say NAND and MMC, and at run
time knows that it came from NAND or MMC, and thus we need to look at
the same device for U-Boot itself.  So order doesn't matter there.  So
we can just drop that part I think.

> Code size is about 20 bytes larger on average which I think is acceptable.
> The BSS size drops by about 64 bytes, but really this just transfers to
> the stack.

How about the worst case growths in what we have today?

> There is an obvious follow-on from this, to move boot_name_table[] into the
> same linker list struct (i.e. add a name field to struct spl_image_loader).
> The complication here is that we don't want naming if
> CONFIG_SPL_LIBCOMMON_SUPPORT is not enabled, since it bloats the code. In
> addition I think that common/spl/spl.c can be tidied up a little.

Yeah, I worry about size growth in doing that too.  But maybe we can be
a little clever when declaring the ll and just not have the strings if
!LIBCOMMON ?

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160918/82b41b0e/attachment.sig>


More information about the U-Boot mailing list