2 * linux/arch/arm/mm/iomap.c
4 * Map IO port and PCI memory spaces so that {read,write}[bwl] can
5 * be used to access this memory.
7 #include <linux/module.h>
9 #include <linux/ioport.h>
14 void __iomem *ioport_map(unsigned long port, unsigned int nr)
18 EXPORT_SYMBOL(ioport_map);
20 void ioport_unmap(void __iomem *addr)
23 EXPORT_SYMBOL(ioport_unmap);
27 void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
29 unsigned long start = pci_resource_start(dev, bar);
30 unsigned long len = pci_resource_len(dev, bar);
31 unsigned long flags = pci_resource_flags(dev, bar);
35 if (maxlen && len > maxlen)
37 if (flags & IORESOURCE_IO)
38 return ioport_map(start, len);
39 if (flags & IORESOURCE_MEM) {
40 if (flags & IORESOURCE_CACHEABLE)
41 return ioremap(start, len);
42 return ioremap_nocache(start, len);
46 EXPORT_SYMBOL(pci_iomap);
48 void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
50 if ((unsigned long)addr >= VMALLOC_START &&
51 (unsigned long)addr < VMALLOC_END)
54 EXPORT_SYMBOL(pci_iounmap);