[OpenBIOS] [RFC 2/3] ppc64: Switch to 64-bit cell size
Segher Boessenkool
segher at kernel.crashing.org
Sat May 28 18:02:47 CEST 2011
> I'm saying that changing sizeof(cell) will change the device tree:
>
> drivers/escc.c:escc_add_channel
>
> [...]
> cell props[2];
> [...]
> props[0] = IO_ESCC_OFFSET + offset * 0x20;
> props[1] = 0x00000020;
> set_property(dnode, "reg", (char *)&props, 2 * sizeof(cell));
>
> So while the guest expects reg to be 2 32-bit numbers, it suddenly
> gets 4 32-bit numbers that don't make sense. IIUC to the guest, any DT
> property is nothing more than a stream of bytes.
That code seems to fail for little-endian systems as well. I recommend
you use C accessor functions similar to the Forth words to build (and
read) properties, they are very convenient and easy to use (encode-int
and friends).
Segher
More information about the OpenBIOS
mailing list