mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Juergen Beisert <jbe@pengutronix.de>, g@pengutronix.de
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] omap: use 512k barebox partition
Date: Mon, 30 Jul 2012 09:40:40 +0200	[thread overview]
Message-ID: <20120730074040.GG30009@pengutronix.de> (raw)
In-Reply-To: <201207271854.16758.jbe@pengutronix.de>

On Fri, Jul 27, 2012 at 06:54:16PM +0200, Juergen Beisert wrote:
> Hi Sascha,
> 
> Sascha Hauer wrote:
> > On Fri, Jul 27, 2012 at 01:09:07PM +0200, Jan Weitzel wrote:
> > > Use 512k NAND Partion for barebox. Problem is we don't know the size of
> > > the barebox inside xload. Set it also to 512k
> > > Fix enviroment for boards with size in config
> >
> > The barebox binary has the size encoded into it at offset 0x2c. We could
> > use this to transfer the correct size.
> 
> Will this be a reliable "API" to the outerworld? Also in future versions of 
> Barebox?

Yes, definitely.

That said, it is not a feature you can generally rely upon, because some
SoCs may require some special image layout conflicting with this. If
your SoC can support this header, barebox will support it in the future
aswell.

The header is in arch/arm/include/asm/barebox-arm-head.h. As you can see
it also contains the ascii string 'barebox' which means that you can
test for it, and if you find it, the next word will contain the address
this binary should be copied to (only used to skip copying the binary to
the correct place, it's not mandatory to start the image there). The
word after it will contain the image size.

This means, what you can do is:

- Test if the image contains 'barebox'
- if yes, use the encoded image size
- if no, fall back to whatever suitable size (It could be a U-Boot image
  for example)

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

  reply	other threads:[~2012-07-30  7:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-27 11:09 Jan Weitzel
2012-07-27 15:19 ` Sascha Hauer
2012-07-27 16:54   ` Juergen Beisert
2012-07-30  7:40     ` Sascha Hauer [this message]
2012-07-30  8:11       ` Juergen Beisert
2012-07-30  8:52         ` Sascha Hauer
2012-07-30  9:16           ` Juergen Beisert
2012-07-30  9:33             ` Sascha Hauer

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=20120730074040.GG30009@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=g@pengutronix.de \
    --cc=jbe@pengutronix.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