[PATCH 1/2] filetype: add arm u-boot support

Sascha Hauer s.hauer at pengutronix.de
Sat Sep 21 04:10:26 EDT 2013


On Sat, Sep 21, 2013 at 08:53:43AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 13:56 Fri 20 Sep     , Sascha Hauer wrote:
> > On Fri, Sep 20, 2013 at 10:02:57AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > On 08:29 Fri 20 Sep     , Sascha Hauer wrote:
> > > > On Thu, Sep 19, 2013 at 01:56:38PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > > > On 09:00 Wed 18 Sep     , Sascha Hauer wrote:
> > > > > > On Tue, Sep 17, 2013 at 09:52:18AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > > > > > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
> > > > > > > ---
> > > > > > >  common/filetype.c  | 3 +++
> > > > > > >  include/filetype.h | 1 +
> > > > > > >  2 files changed, 4 insertions(+)
> > > > > > > 
> > > > > > > diff --git a/common/filetype.c b/common/filetype.c
> > > > > > > index 7507d85..59ea25a 100644
> > > > > > > --- a/common/filetype.c
> > > > > > > +++ b/common/filetype.c
> > > > > > > @@ -35,6 +35,7 @@ static const struct filetype_str filetype_str[] = {
> > > > > > >  	[filetype_lzo_compressed] = { "lzo compressed", "lzo" },
> > > > > > >  	[filetype_lz4_compressed] = { "lz4 compressed", "lz4" },
> > > > > > >  	[filetype_arm_barebox] = { "arm barebox image", "arm-barebox" },
> > > > > > > +	[filetype_arm_uboot] = { "arm u-boot image", "arm-u-boot" },
> > > > > > >  	[filetype_uimage] = { "U-Boot uImage", "u-boot" },
> > > > > > >  	[filetype_ubi] = { "UBI image", "ubi" },
> > > > > > >  	[filetype_jffs2] = { "JFFS2 image", "jffs2" },
> > > > > > > @@ -226,6 +227,8 @@ enum filetype file_detect_type(const void *_buf, size_t bufsize)
> > > > > > >  
> > > > > > >  	if (is_barebox_arm_head(_buf))
> > > > > > >  		return filetype_arm_barebox;
> > > > > > > +	if (buf[15] == 0xdeadbeef)
> > > > > > > +		return filetype_arm_uboot;
> > > > > > 
> > > > > > 0xdeadbeef is such a widely used placeholder that we should use it for
> > > > > > filetype detection. Also, I don't think that U-Boot ever specified
> > > > > > 0xdeadbeef at this offset as a fixed value. It could be changed without
> > > > > > notice.
> > > > > 
> > > > > on ARM it's keeped for years > 7 IIRC
> > > > 
> > > > Yes, and there's no indication that it will change. Anyway, this was
> > > > never meant as an API and everybody uses 0xdeadbeef as placeholder.
> > > 
> > > so the question remain how to boot a u-boot that can be a second stage
> > 
> > 'go'? You could also embed it in an uImage if you really want to use the
> > bootm command.
> 
> I really hate the go you need to load in ram and then do the go

You could also use the -f option to bootm instead.

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 |



More information about the barebox mailing list