ARM: pci: make pcibios_assign_all_busses use pci_has_flag
[deliverable/linux.git] / arch / arm / mm / iomap.c
1 /*
2 * linux/arch/arm/mm/iomap.c
3 *
4 * Map IO port and PCI memory spaces so that {read,write}[bwl] can
5 * be used to access this memory.
6 */
7 #include <linux/module.h>
8 #include <linux/pci.h>
9 #include <linux/ioport.h>
10 #include <linux/io.h>
11 #include <asm/pci.h>
12
13 #ifdef __io
14 void __iomem *ioport_map(unsigned long port, unsigned int nr)
15 {
16 return __io(port);
17 }
18 EXPORT_SYMBOL(ioport_map);
19
20 void ioport_unmap(void __iomem *addr)
21 {
22 }
23 EXPORT_SYMBOL(ioport_unmap);
24 #endif
25
26 #ifdef CONFIG_PCI
27 unsigned int pci_flags = PCI_REASSIGN_ALL_RSRC;
28 EXPORT_SYMBOL(pci_flags);
29
30 void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
31 {
32 resource_size_t start = pci_resource_start(dev, bar);
33 resource_size_t len = pci_resource_len(dev, bar);
34 unsigned long flags = pci_resource_flags(dev, bar);
35
36 if (!len || !start)
37 return NULL;
38 if (maxlen && len > maxlen)
39 len = maxlen;
40 if (flags & IORESOURCE_IO)
41 return ioport_map(start, len);
42 if (flags & IORESOURCE_MEM) {
43 if (flags & IORESOURCE_CACHEABLE)
44 return ioremap(start, len);
45 return ioremap_nocache(start, len);
46 }
47 return NULL;
48 }
49 EXPORT_SYMBOL(pci_iomap);
50
51 void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
52 {
53 if ((unsigned long)addr >= VMALLOC_START &&
54 (unsigned long)addr < VMALLOC_END)
55 iounmap(addr);
56 }
57 EXPORT_SYMBOL(pci_iounmap);
58 #endif
This page took 0.031879 seconds and 5 git commands to generate.