[U-Boot] [PATCH 1/7] spl: pbl: Add new SPL image for pblimage tool

Huan Wang
2014-09-22T06:17:51Z

Hi, Albert,

> > > On Thu, 18 Sep 2014 13:47:13 +0800, Alison Wang
> > > <b18965@freescale.com>
> > > wrote:
> > >
> > > > For the pblimage tool, the SPL image is splitted into 64 byte
> > > > chunks, and PBL needs a command for each piece. In current
> > > > pblimage structure, the size of the SPL image should be a fixed
> > > > value. Well, for LS102xA and some other ARM platforms, the size
> of the SPL image is changeable.
> > > > So a new image spl/u-boot-spl-pbl-pad.bin is built, and the size
> > > > of
> > > it
> > > > is a fixed value "CONFIG_SPL_MAX_SIZE". Use it instead of
> > > > spl/u-boot-spl.bin for LS102xA.
> > > >
> > > > CONFIG_SPL_PBL_PAD is used to enable this function.
> > > >
> > > > Signed-off-by: Alison Wang <alison.wang@freescale.com>
> > > > ---
> > >
> > > There is already a CONFIG_SPL_PAD_TO (see ./README). Can you not
> use
> > > this?
>
> (BTW, thanks for fixing the way your mailer quotes. That's much more
> readable to me.)

[Alison Wang] You are welcome. :)
>
> > [Alison Wang] I have already used CONFIG_SPL_PAD_TO to determine the
> offset to which u-boot-spl.pbl should be padded when generating u-boot-
> with-spl-pbl.bin. Well, I used CONFIG_SPL_MAX_SIZE to determine the
> size of u-boot-spl-pbl-pad.bin. u-boot-spl-pbl-pad.bin is generated by
> padding u-boot-spl.bin to CONFIG_SPL_MAX_SIZE.
>
> I'm still lost. Can you summarize the sequence of operations performed,
> starting from the u-boot SPL elf file, and on each step indicate which
> file is produced and which config option(s) from
> CONFIG_SPL_[PBL_]{PAD_TO,MAX_SIZE} is(are) involved and why?

[Alison Wang] Let me explain the sequence.

1. u-boot-spl.bin is produced. The size of it is not a fixed value.

2. u-boot-spl-pbl-pad.bin is produced. The size of it is defined by
CONFIG_SPL_MAX_SIZE. For detail, u-boot-spl-pbl-pad.bin is generated
by padding u-boot-spl.bin to the size of CONFIG_SPL_MAX_SIZE.

The following is the reason for using u-boot-spl-pbl-pad.bin.

First of all, the SPL part need to be reorganized for the recognition
of PBL through the pblimage tool.

For the pblimage tool, the SPL image is splitted into 64 byte chunks,
and PBL needs a command for each piece. In current pblimage tool,
the size of the SPL image(u-boot-spl.bin) should be a fixed value
like PowerPC. Well, for LS102xA and some other ARM platforms, the size
of the SPL image (u-boot-spl.bin) is changeable. So a new image
spl/u-boot-spl-pbl-pad.bin is produced, and the size of it is a fixed
value "CONFIG_SPL_MAX_SIZE". Then use u-boot-spl-pbl-pad.bin instead
of spl/u-boot-spl.bin to generate spl/u-boot-spl.pbl.

3. spl/u-boot-spl.pbl is produced through pblimage tool. As
CONFIG_SPL_PBL_PAD is enabled, spl/u-boot-spl-pbl-pad.bin is used as
the source file instead of spl/u-boot-spl.bin.

4. u-boot-with-spl-pbl.bin is produced. For detail, u-boot-with-spl-pbl.bin
is generated by padding spl/u-boot-spl.pbl to the offset of CONFIG_SPL_PAD_TO
and adding u-boot.img.

As the size of spl/u-boot-spl.pbl is not a fixed value, we pad it to
the offset of CONFIG_SPL_PAD_TO. So it is convenient for us to determine
the location of u-boot.img in SD card.

>
> Also, in any case, if CONFIG_SPL_PBL_PAD is needed then it must be
> added to README with its description.
>
[Alison Wang] Yes, I will add it in v2.

Thanks.

Best Regards,
Alison Wang