aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2011-11-24 13:57:23 -0500
committerMichael S. Tsirkin <mst@redhat.com>2011-11-28 14:13:06 -0500
commite5bfb72ce2ce558b5a5a46cc5694001f0479c7f2 (patch)
treecdbea1fb4d12581913eaa2007618cdf358fd075a
parentf2971c4c3197935f409bff202b9ab67416981dd7 (diff)
arm: switch to GENERIC_PCI_IOMAP
arm copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r--arch/arm/Kconfig1
-rw-r--r--arch/arm/include/asm/io.h2
-rw-r--r--arch/arm/mm/iomap.c21
3 files changed, 2 insertions, 22 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 44789eff983f..2ebf66b8008f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -30,6 +30,7 @@ config ARM
30 select HAVE_SPARSE_IRQ 30 select HAVE_SPARSE_IRQ
31 select GENERIC_IRQ_SHOW 31 select GENERIC_IRQ_SHOW
32 select CPU_PM if (SUSPEND || CPU_IDLE) 32 select CPU_PM if (SUSPEND || CPU_IDLE)
33 select GENERIC_PCI_IOMAP
33 help 34 help
34 The ARM series is a line of low-power-consumption RISC chip designs 35 The ARM series is a line of low-power-consumption RISC chip designs
35 licensed by ARM Ltd and targeted at embedded applications and 36 licensed by ARM Ltd and targeted at embedded applications and
diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
index 065d100fa63e..9275828feb3d 100644
--- a/arch/arm/include/asm/io.h
+++ b/arch/arm/include/asm/io.h
@@ -27,6 +27,7 @@
27#include <asm/byteorder.h> 27#include <asm/byteorder.h>
28#include <asm/memory.h> 28#include <asm/memory.h>
29#include <asm/system.h> 29#include <asm/system.h>
30#include <asm-generic/pci_iomap.h>
30 31
31/* 32/*
32 * ISA I/O bus memory addresses are 1:1 with the physical address. 33 * ISA I/O bus memory addresses are 1:1 with the physical address.
@@ -306,7 +307,6 @@ extern void ioport_unmap(void __iomem *addr);
306 307
307struct pci_dev; 308struct pci_dev;
308 309
309extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen);
310extern void pci_iounmap(struct pci_dev *dev, void __iomem *addr); 310extern void pci_iounmap(struct pci_dev *dev, void __iomem *addr);
311 311
312/* 312/*
diff --git a/arch/arm/mm/iomap.c b/arch/arm/mm/iomap.c
index 430df1a5978d..e62956e12030 100644
--- a/arch/arm/mm/iomap.c
+++ b/arch/arm/mm/iomap.c
@@ -35,27 +35,6 @@ EXPORT_SYMBOL(pcibios_min_mem);
35unsigned int pci_flags = PCI_REASSIGN_ALL_RSRC; 35unsigned int pci_flags = PCI_REASSIGN_ALL_RSRC;
36EXPORT_SYMBOL(pci_flags); 36EXPORT_SYMBOL(pci_flags);
37 37
38void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
39{
40 resource_size_t start = pci_resource_start(dev, bar);
41 resource_size_t len = pci_resource_len(dev, bar);
42 unsigned long flags = pci_resource_flags(dev, bar);
43
44 if (!len || !start)
45 return NULL;
46 if (maxlen && len > maxlen)
47 len = maxlen;
48 if (flags & IORESOURCE_IO)
49 return ioport_map(start, len);
50 if (flags & IORESOURCE_MEM) {
51 if (flags & IORESOURCE_CACHEABLE)
52 return ioremap(start, len);
53 return ioremap_nocache(start, len);
54 }
55 return NULL;
56}
57EXPORT_SYMBOL(pci_iomap);
58
59void pci_iounmap(struct pci_dev *dev, void __iomem *addr) 38void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
60{ 39{
61 if ((unsigned long)addr >= VMALLOC_START && 40 if ((unsigned long)addr >= VMALLOC_START &&