9 Jun
2011
9 Jun
'11
12:27 a.m.
Steve Calfee wrote:
Device tree integer properties are encoded in big-endian format, but some of
the Freescale ASoC drivers were assuming that the host is in big-endian format as well. Although this is true, it's better to use endian-safe accessors.
Hi Timur,
Can this be true?
Yes, it's true. When the device tree compiler compiles a property that looks like this:
fsl,ssi-fifo-depth = <15>;
It writes the following bytes into the dtb:
00 00 00 0f
I would assume a software constructed data structure would be in host-endian mode.
I wouldn't assume that at all. The device tree format is a defined binary format. It makes sense that the endianness of multi-byte integers is defined.
--
Timur Tabi
Linux kernel developer at Freescale