diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/Kconfig | 4 | ||||
-rw-r--r-- | arch/arm/mm/ioremap.c | 47 |
2 files changed, 47 insertions, 4 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 475950c8a831..1a1773f81393 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -67,10 +67,6 @@ config GENERIC_BUST_SPINLOCK | |||
67 | config GENERIC_ISA_DMA | 67 | config GENERIC_ISA_DMA |
68 | bool | 68 | bool |
69 | 69 | ||
70 | config GENERIC_IOMAP | ||
71 | bool | ||
72 | default y | ||
73 | |||
74 | config FIQ | 70 | config FIQ |
75 | bool | 71 | bool |
76 | 72 | ||
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c index 00bb8fd37a59..7110e54182b1 100644 --- a/arch/arm/mm/ioremap.c +++ b/arch/arm/mm/ioremap.c | |||
@@ -170,3 +170,50 @@ void __iounmap(void __iomem *addr) | |||
170 | vfree((void *) (PAGE_MASK & (unsigned long) addr)); | 170 | vfree((void *) (PAGE_MASK & (unsigned long) addr)); |
171 | } | 171 | } |
172 | EXPORT_SYMBOL(__iounmap); | 172 | EXPORT_SYMBOL(__iounmap); |
173 | |||
174 | #ifdef __io | ||
175 | void __iomem *ioport_map(unsigned long port, unsigned int nr) | ||
176 | { | ||
177 | return __io(port); | ||
178 | } | ||
179 | EXPORT_SYMBOL(ioport_map); | ||
180 | |||
181 | void ioport_unmap(void __iomem *addr) | ||
182 | { | ||
183 | } | ||
184 | EXPORT_SYMBOL(ioport_unmap); | ||
185 | #endif | ||
186 | |||
187 | #ifdef CONFIG_PCI | ||
188 | #include <linux/pci.h> | ||
189 | #include <linux/ioport.h> | ||
190 | |||
191 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) | ||
192 | { | ||
193 | unsigned long start = pci_resource_start(dev, bar); | ||
194 | unsigned long len = pci_resource_len(dev, bar); | ||
195 | unsigned long flags = pci_resource_flags(dev, bar); | ||
196 | |||
197 | if (!len || !start) | ||
198 | return NULL; | ||
199 | if (maxlen && len > maxlen) | ||
200 | len = maxlen; | ||
201 | if (flags & IORESOURCE_IO) | ||
202 | return ioport_map(start, len); | ||
203 | if (flags & IORESOURCE_MEM) { | ||
204 | if (flags & IORESOURCE_CACHEABLE) | ||
205 | return ioremap(start, len); | ||
206 | return ioremap_nocache(start, len); | ||
207 | } | ||
208 | return NULL; | ||
209 | } | ||
210 | EXPORT_SYMBOL(pci_iomap); | ||
211 | |||
212 | void pci_iounmap(struct pci_dev *dev, void __iomem *addr) | ||
213 | { | ||
214 | if ((unsigned long)addr >= VMALLOC_START && | ||
215 | (unsigned long)addr < VMALLOC_END) | ||
216 | iounmap(addr); | ||
217 | } | ||
218 | EXPORT_SYMBOL(pci_iounmap); | ||
219 | #endif | ||