Merge branch 'cleanup/io-pci' into next/cleanups
[pandora-kernel.git] / arch / arm / mm / ioremap.c
index 566750f..9d869f9 100644 (file)
@@ -36,6 +36,7 @@
 #include <asm/system_info.h>
 
 #include <asm/mach/map.h>
+#include <asm/mach/pci.h>
 #include "mm.h"
 
 int ioremap_page(unsigned long virt, unsigned long phys,
@@ -383,3 +384,16 @@ void __arm_iounmap(volatile void __iomem *io_addr)
        arch_iounmap(io_addr);
 }
 EXPORT_SYMBOL(__arm_iounmap);
+
+#ifdef CONFIG_PCI
+int pci_ioremap_io(unsigned int offset, phys_addr_t phys_addr)
+{
+       BUG_ON(offset + SZ_64K > IO_SPACE_LIMIT);
+
+       return ioremap_page_range(PCI_IO_VIRT_BASE + offset,
+                                 PCI_IO_VIRT_BASE + offset + SZ_64K,
+                                 phys_addr,
+                                 __pgprot(get_mem_type(MT_DEVICE)->prot_pte));
+}
+EXPORT_SYMBOL_GPL(pci_ioremap_io);
+#endif