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

From: Matt Porter <[email-masked]>
Date: Fri, 12 Aug 2005 20:33:35 -0700

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