writel(), readl() in <asm-ppc/io.h>

Matt Porter mporter at kernel.crashing.org
Sat Aug 13 13:33:35 EST 2005


On Fri, Aug 12, 2005 at 06:11:14PM -0700, Shawn Jin wrote:
> Hi,
> 
> In <asm-ppc/io.h>, writew(), readw(), writel(), and readl() are
> defined to little endian access for all platforms unless either
> CONFIG_APUS or CONFIG_8260_PCI9 is defined.
> 
> Why? Aren't they correct in big endian systems, are they? Maybe I miss
> something here.

I'm not sure what your qustion is but I'll take a stab at an answer. :)

read*()/write*() are accessors for PCI and PCI only.  PCI is little
endian. PPC is big endian.  All platforms must byte swap on access
to PCI memory space except in special cases.  The two exceptions
must byte swap in hardware. Looks like it is due to errata in the
8260 PCI bridge case. APUS is probably byte swapping in hardware
because APUS is simply odd.

-Matt



More information about the Linuxppc-embedded mailing list