Messages in this thread | | | Subject | Re: [PATCH] drivers/block/xsysace - replace in(out)_8/in(out)_be16/in(out)_le16 with generic iowrite(read)8/16(be) | From | Benjamin Herrenschmidt <> | Date | Tue, 05 Feb 2013 23:29:43 +1100 |
| |
On Tue, 2013-02-05 at 17:39 +0530, Vineet Gupta wrote: > Am I correct in understanding that "be" suffix here reflects the byte ordering of > the device and not the CPU. So for a BE device, driver using ioread32be on LE > processor will get MSB first data - and accessor will swap the bytes to make it > lsb first in register, while on BE processor, the lanes to memory are swapped, > causing the msb first word to be flipped before ending up in the cpu register - so > in the end, CPU register on either will have the exact same value. Correct ?
Yes. That's how ioread32 and ioread32be are defined. They relate to the device endianness regardless of the CPU endianness.
ioread32 -> little endian device ioread32be -> big endian device
Cheers, Ben.
| |