[PATCH] ARM: put a valid "barebox" signature in the header on big-endian systems.

Sascha Hauer s.hauer at pengutronix.de
Sun May 13 08:20:05 EDT 2012


On Sun, May 13, 2012 at 12:05:33PM +0200, Krzysztof Halasa wrote:
> Uwe Kleine-König <u.kleine-koenig at pengutronix.de> writes:
> 
> >> +++ b/arch/arm/include/asm/barebox-arm-head.h
> >> @@ -24,8 +24,7 @@ static inline void barebox_arm_head(void)
> >>  		"1: b 1b\n"
> >>  		"1: b 1b\n"
> >>  #endif
> >> -		".word 0x65726162\n"			/* 'bare' */
> >> -		".word 0x00786f62\n"			/* 'box' */
> >> +		".asciz \"barebox\"\n"
> >>  		".word _text\n"				/* text base. If copied there,
> >>  							 * barebox can skip relocation
> >>  							 */
> > Another downside of this patch (apart from the file type detection that
> > still needs adaption?) is that the magic is different depending on
> > endianess.
> 
> Actually it's the opposite - i.e., the magic is now always "barebox\0"
> and doesn't depend on endianness :-)
> 
> Without this patch, the magic changes with endianness (it becomes
> "erab\0xob" on BE).

This may have the upside that with this we are able to detect foreign
endian images like done in the zImage support. Here we use this to know
that we have to swap byte endianess before jumping to the kernel.

I probably should have chosen some arbitrary number rather than a
string, then nobody would have wondered about this ;)

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