Merge commit 'a849088aa1' from rmk/fixes into cleanup/io-pci
[linux-2.6-block.git] / arch / arm / mm / ioremap.c
index 566750fa57d4289eeff21ed482b09f8a8cdefe72..9d869f93a3da29a275101418cceba6fb122189b4 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