Thread (17 messages) 17 messages, 4 authors, 2006-01-27

Re: Yosemite/440EP why are readl()/ioread32() setup to read little-endian?

From: Stefan Roese <sr@denx.de>
Date: 2006-01-25 09:58:05

Hi David,

On Tuesday 24 January 2006 19:08, David Hawkins wrote:
readl() and ioread32() read the registers in little-endian format!
Correct. That's how it is implemented on all platforms. Think for example of 
an pci device driver. Using these IO functions, the driver will become 
platform independent, running without modifications on little- and big-endian 
machines.
If the processor was reading from the PCI bus, then sure, I
could understand why this might be used, but even then, that
should be up to the user, eg. by using cpu_to_le32 etc.
No. Please see above.
Should I just be using pointers for remapped processor
registers, and only use readl(), ioread32(), etc, on external
memory?
That's how I do it. Only use readl() and friends for pci spaces (or other 
little endian memory mapped areas).

Best regards,
Stefan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help