[U-Boot] [PATCH 2/6] nand: Add SPL_NAND support to mxc_nand_spl

Philip Paeps
2013-04-19T15:41:50Z

On 2013-04-19 17:21:49 (+0200), Beno?t Th?baudeau <benoit.thebaudeau@advansee.com> wrote:
> On Friday, April 19, 2013 5:09:59 PM,Philip Paeps wrote:
> > On 2013-04-19 16:48:42 (+0200), Philip Paeps <philip@paeps.cx> wrote:
> > > A first build with CONFIG_SPL_FRAMEWORK came out to nearly 4K. Large
> > > contributors being (unsurprisingly) libcommon and libgeneric. I had to
> > > get rid of a puts() in libspl to make it build without those libraries.
> > > Unfortunately, that still came out to 2.2K. Close. :-)
> > >
> > > I couldn't identify any obvious 100 bytes to scrap from glancing at
> > > u-boot-spl.map or objdump -D u-boot-spl, but I'll take a look.
> >
> > Just as I hit 'send', it occurred to me that this configuration is with
> > a fairly lengthy lowlevel_init.S to support external boot. Paring that
> > to the bare minimum gives a u-boot-spl.bin of 1821 bytes.
>
> But this requires a board-specific lowlevel_init() and a hack for puts() (which
> is perhaps already solved by Andreas' series), just to bloat the SPL with
> stuff useless for those boards, vs. a simple nand_boot() that can be made common
> to all SPLs with size restrictions.

Comparing the contents of "framework" SPL with "old" SPL, it looks like
the only thing we gain is support for booting uImage files. At the cost
of significantly reduced room for flexibility in lowlevel_init().

I agree that a simple nand_boot() is probably the way forward.

> > I'm not familiar enough with 'internal boot' and the 'imximage' format
> > to judge whether this leaves enough margin for telling the ROM loader to
> > do its thing usefully. Beno?t: do you have an idea how long a typically
> > useful imximage preamble gets? Is ~230 bytes sufficient margin?
>
> What do you mean? mx31pdk and tx25, contrary to m53evk, use external NAND boot,
> hence the 2-kiB SPL size limit (which could actually be extended to 4 kiB for
> tx25, but not for mx31pdk), and they don't require any imximage.

Mmm. Oh. It looks like I was looking at the wrong lowlevel_init()
functions. They could be made to work with a very stripped down
lowlevel_init(), but it's a _very_ tight fit.

- Philip

--
Philip Paeps
Senior Reality Engineer
Ministry of Information