[U-Boot-Users] [PATCH][RFC] Add common memory fixup function

Scott Wood scottwood at freescale.com
Tue Nov 27 20:11:04 CET 2007


On Tue, Nov 27, 2007 at 09:13:06AM +0100, Martin Krause wrote:
> Kumar Gala wrote on Monday, November 26, 2007 9:56 PM:
> > +	addrcell = fdt_getprop(blob, 0, "#address-cells", NULL);
> > +	if ((addrcell) && (*addrcell == 2)) {
> > +		for (i = 0; i <= 7; i++)
> > +			tmp[i] = (start >> ((7 - i) * 8)) & 0xff;
> > +		len = 8;
> > +	} else {
> > +		for (i = 0; i <= 3; i++)
> > +			tmp[i] = (start >> ((3 - i) * 8)) & 0xff;
> > +		len = 4;
> > +	}
> 
> Could this perhaps lead to endianess issues under some special 
> circumstances?

I don't think so -- the device tree is defined as always being big-endian,
regardless of the host endianness (multi-cell values would get a bit weird
otherwise).

-Scott




More information about the U-Boot mailing list