On 05/14/2015 03:45 PM, Guenter Roeck wrote:
It concerns me that you point to other drivers as argument for using the endianness conversion your code. That raises the question if you really understand the hardware.
The only information I have on how the hardware works is the SBSA document and the internal documentation for our ARM64 server chip.
Is the register known to be a little endian register, even on a big endian machine, or is it in host byte order ? You don't really answer that question.
The ARM SBSA says in section 4.1.1:
* CPUs shall implement little-endian support.
That's the only reference to endianness in the document. I don't know if that means that the device registers must also be little-endian. Does Linux even support running ARM64 in big-endian mode?
So maybe it's safe to say that everything must be little endian? If so, do I still need the __le32 in the structs, and should I still use cpu_to_le32()?