[ARM] 4077/1: iop13xx: fix __io() macro
authorDan Williams <dan.j.williams@intel.com>
Fri, 29 Dec 2006 00:30:24 +0000 (01:30 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 30 Dec 2006 17:05:08 +0000 (17:05 +0000)
Since iop13xx defines the PCI I/O spaces with physical resource addresses
the __io macro needs to perform the physical to virtual conversion.  I
incorrectly assumed that this would be handled by ioremap, but drivers
(like e1000) directly dereference the address returned from __io.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-iop13xx/io.c
include/asm-arm/arch-iop13xx/io.h

index fbf9f88..e79a1b6 100644 (file)
 #include <asm/hardware.h>
 #include <asm/io.h>
 
+void * __iomem __iop13xx_io(unsigned long io_addr)
+{
+       void __iomem * io_virt;
+
+       switch (io_addr) {
+       case IOP13XX_PCIE_LOWER_IO_PA ... IOP13XX_PCIE_UPPER_IO_PA:
+               io_virt = (void *) IOP13XX_PCIE_IO_PHYS_TO_VIRT(io_addr);
+               break;
+       case IOP13XX_PCIX_LOWER_IO_PA ... IOP13XX_PCIX_UPPER_IO_PA:
+               io_virt = (void *) IOP13XX_PCIX_IO_PHYS_TO_VIRT(io_addr);
+               break;
+       default:
+               BUG();
+       }
+
+       return io_virt;
+}
+EXPORT_SYMBOL(__iop13xx_io);
+
 void * __iomem __iop13xx_ioremap(unsigned long cookie, size_t size,
        unsigned long flags)
 {
index db6de24..5a7bdb5 100644 (file)
 
 #define IO_SPACE_LIMIT 0xffffffff
 
-#define __io(a)      (a)
+#define __io(a) __iop13xx_io(a)
 #define __mem_pci(a) (a)
 #define __mem_isa(a) (a)
 
+extern void __iomem * __iop13xx_io(unsigned long io_addr);
 extern void __iomem * __ioremap(unsigned long, size_t, unsigned long);
 extern void __iomem *__iop13xx_ioremap(unsigned long cookie, size_t size,
        unsigned long flags);