mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Trent Piepho <tpiepho@kymetacorp.com>
To: Sascha Hauer <s.hauer@pengutronix.de>, Wadim Egorov <w.egorov@phytec.de>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: RE: barebox PBL question
Date: Mon, 13 Feb 2017 20:53:19 +0000	[thread overview]
Message-ID: <a28cc10e07874a53bd28dabd35a558a8@srred1mail01.kymeta.local> (raw)
In-Reply-To: <20170213192247.gjld5b33genwav2a@pengutronix.de>

> From: barebox [mailto:barebox-bounces@lists.infradead.org] On Behalf Of
> Sascha Hauer
> Sent: Monday, February 13, 2017 11:23 AM
> >
> > The maximum size of the SPL image which the ROM code will read is 32KB.
> > I was thinking to use the PBL feature for the SPL part. But using the
> > the pbl code (with decompression) seems to be not a good idea, because
> > it's size is already about 30K. I think this is an overhead.
> 
> In a test build here the pbl code is 6KiB. The rest is the devicetree included in
> the binary (which I disabled in the test build). The dtb can be compressed
> which should give you enough space even in 32KiB.

On socfpga I have 23kB PBL.  But this has code to support multiple board variations
and a memory test function.  A PBL that doesn't need to initialize the board is 18kB.

> > But now I wonder how to generate two different images with a single
> build.
> > A SPL image, which should not exceed 32K and a barebox.
> >
> > I have problems to fully understand the PBL mechanism.
> > Why are the builds always adding the barebox.bin images to the PBL part?
> 
> The idea is to create an image that contains the PBL and attached to it the
> compressed barebox image. If your ROM only allows a certain image size
> then make sure the PBL is small enough and tell the ROM to only load the PBL
> part of the image. Ideally the PBL then detects from where the PBL is loaded
> (by reading back the bootsource the SoC provides) and reads the rest of the
> image into SDRAM (or, for sake of simplicity, the whole image inculding PBL
> again)

The way socfpga does it, which is in some ways easier to implement, is to build
barebox twice.  The first build is minimized with no DT support, no console, etc. to
fit into 64 kB.  It has only drivers needed to load another barebox.  I.e. eMMC bus
driver, code to init SDRAM, etc.
 
The second barebox loaded by this one has SDRAM working when it starts and has
no ROM loader size limit, since it was loaded by barebox.  One can enable all barebox
features without worry about size limits.

But now you have the deal with two copies of barebox to build and install.

> You should use PBL_MULTI_IMAGES instead. In fact, the existing Rockchip
> port already does this.

Is there any advantage to the single image pbl system?  It seems like multi image
with one image achieves the same result.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2017-02-13 20:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-13 15:13 Wadim Egorov
2017-02-13 19:22 ` Sascha Hauer
2017-02-13 20:53   ` Trent Piepho [this message]
2017-02-14  7:27     ` Sascha Hauer
2017-02-14 18:12       ` Trent Piepho
2017-02-15  7:57         ` s.hauer
2017-02-14  9:54   ` Wadim Egorov
2017-02-14 10:48     ` Sascha Hauer
2017-02-14 11:34       ` Wadim Egorov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a28cc10e07874a53bd28dabd35a558a8@srred1mail01.kymeta.local \
    --to=tpiepho@kymetacorp.com \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    --cc=w.egorov@phytec.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox