Skip to contentSkip to conversation

DT and endianness

DISCUSSION Grant Likely 1 participant 1 message May 18, 2011 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 12 lines · Rajendra Nayak

Hey Grant,

I have been working over the last few days trying to evaluate what part of the data files in OMAP can be moved to Device tree. One basic issue I am stuck with trying to extract data out of the device tree blob is the endianess differences. The dtb file seems to be in big-endian format while my kernel is compiled for little-endian. I know this might be quite a common issue with all ARM arch;s but I could not find any obvious pointers on how to get around this.
Any help is greatly appreciated.

Yes, the dtb data is always big-endian encoded, regardless of architecture. This is on purpose so that any arch can parse any other architecture's dtb format. be32_to_cpu() is your friend.

g.

Quoted 4 lines

Thanks,
Rajendra

Signature · 2 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.