[PATCH] arm/io.h: add macros to read/write big/little endian register

Russell King - ARM Linux linux at arm.linux.org.uk
Thu Feb 23 09:14:19 EST 2012


On Thu, Feb 23, 2012 at 01:35:04PM +0000, Arnd Bergmann wrote:
> Since devices that can bei either PCI or not are relatively rare, I'd
> rather put them in the same category as those that can either use
> PCI I/O space or some form of memory space and require that the
> drivers use the "I don't care what you are, just do what I want"
> accessors in the ioread/iowrite family that are already going through
> an indirect function call on most architectures.

It's not a case of whether they themselves are PCI or not.  It's a case
that manufacturers are starting to take existing ARM IP and sticking a
PCI bridge in front of them.

That's why there's someone looking at a set of PCI drivers which create
AMBA primecell devices to allow the existing primecell drivers to bind
to these peripherals.

What that means is that in theory, you could have an AMBA primecell
peripheral behind a PCI device on an IXP4xx platform with its weird
windows, and that would necessitate the AMBA primecell drivers to use the
special PCI space accessors.

I would not be surprised if some of these PPC freescale peripheral IPs
using their private in_xxx() accessors end up in the same situation.
That seems to be the direction the hardware folk are going.

So, I think it's a big mistake to distinguish bus types by their
accessors.  Or put it another way, it's a big mistake to have bus
specific accessors.

Consider the AMBA primecell behind a PCI device, and if AMBA had its own
bus specific accessors.  Should we litter the drivers with ifdefs to
select between the PCI accessors or the AMBA accessors?  Or something
equally horrible?



More information about the linux-arm-kernel mailing list