[PATCH] omap: use 512k barebox partition

Juergen Beisert jbe at pengutronix.de
Mon Jul 30 04:11:32 EDT 2012

Hi Sascha,

Sascha Hauer wrote:
> On Fri, Jul 27, 2012 at 06:54:16PM +0200, Juergen Beisert wrote:
> > 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.

This would require a "movable marker" inside the binary image.

> 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'

This might be very dangerous, as this kind of string can be part of the binary 
more than one times, if it is used as part of an output string for example 
("Hi, barebox here").

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

What we need for this "movable marker" is:
 - a string like "barebox" as its start indication
 - in-between some payload data we want to know
   - size of the "payload"
   - version marker
   - real data
 - something that indicates the end of the whole marker to verify, this entry
   is not a phantom (for example the string "xoberab" ;) )


Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | http://www.pengutronix.de/  |

More information about the barebox mailing list