[U-Boot] [PATCH] NAND: Allow nand_ids and nand_bbt to be compiled in SPL

Tom Rini tom.rini at gmail.com
Thu Jan 5 15:15:15 CET 2012


On Thu, Jan 5, 2012 at 2:09 AM, Marek Vasut <marek.vasut at gmail.com> wrote:
>> On Wed, Jan 4, 2012 at 4:56 PM, Scott Wood <scottwood at freescale.com> wrote:
>> > On 12/05/2011 05:17 PM, Marek Vasut wrote:
>> >> This will be beneficial for the PXA3XX NAND driver, which uses the NAND
>> >> IDs to identify the chip and configure the controller accordingly.
>> >>
>> >> Signed-off-by: Marek Vasut <marek.vasut at gmail.com>
>> >> Cc: Scott Wood <scottwood at freescale.com>
>> >> ---
>> >>  drivers/mtd/nand/Makefile |    4 ++--
>> >>  1 files changed, 2 insertions(+), 2 deletions(-)
>> >>
>> >> diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
>> >> index a63c0e4..46e79e3 100644
>> >> --- a/drivers/mtd/nand/Makefile
>> >> +++ b/drivers/mtd/nand/Makefile
>> >> @@ -35,10 +35,10 @@ COBJS-y   += nand_spl_load.o
>> >>  endif
>> >>  else
>> >>  COBJS-y += nand.o
>> >> -COBJS-y += nand_bbt.o
>> >> -COBJS-y += nand_ids.o
>> >>  COBJS-y += nand_util.o
>> >>  endif
>> >> +COBJS-y += nand_bbt.o
>> >> +COBJS-y += nand_ids.o
>> >>  COBJS-y += nand_ecc.o
>> >>  COBJS-y += nand_base.o
>> >
>> > So, in theory with gc-sections this shouldn't increase the size of any
>> > SPL that currently successfully links (at least in the absence of things
>> > like weak symbols).  However, I observed a devkit8000 build go from this:
>> >
>> >   text    data     bss     dec     hex filename
>> >  40709    1792  197764  240265   3aa89 /tmp/u-boot-arm/spl/u-boot-spl
>> >
>> > to this:
>> >
>> >   text    data     bss     dec     hex filename
>> >  42277    1792  197764  241833   3b0a9 /tmp/u-boot-arm/spl/u-boot-spl
>> >
>> > I verified that --function-sections/-fdata-sections/--gc-sections are
>> > being used on the SPL.  It looks like strings are not getting dropped.
>> >
>> > If there's no way to fix this, this is going to be a big problem for the
>> > existing users of nand_spl to migrate to the new SPL model, unless the
>> > notion of "include a bunch of stuff and let gc-sections take care of it"
>> > is dropped.
>>
>> I'll confirm gc-sections/etc are not as awesome as we think.  You can
>> drop the size of current SPL builds (for say devkit8000) by taking
>> things that should be dropped for us and forcing them out with #ifndef
>> CONFIG_SPL_BUILD.
>
> Maybe if we had those LTO tables at the gc-sections time, it'd drop. But we
> can't rely on those.
>
> So instead of compiling in the nand-ids, it'd be better to allow SPL to pull in
> the whole NAND/MTD stack.

Possible, but without doing #Ifndef hacks, the size grows a good bit
(don't have the #s handy right now), and with #ifndef hacks it's just
a kb or so in growth.

-- 
Tom


More information about the U-Boot mailing list