aboutsummaryrefslogtreecommitdiffstats
path: root/arch/tile
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-10 21:04:27 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-10 21:04:27 -0500
commite343a895a9f342f239c5e3c5ffc6c0b1707e6244 (patch)
tree46c81c6ae375b1f14e209b13c8ac020842807ece /arch/tile
parent06792c4dde2ad143928cc95c1ba218c6269c494b (diff)
parent193a667fba76b3df482cbf865228e26ee246e889 (diff)
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
lib: use generic pci_iomap on all architectures Many architectures don't want to pull in iomap.c, so they ended up duplicating pci_iomap from that file. That function isn't trivial, and we are going to modify it https://lkml.org/lkml/2011/11/14/183 so the duplication hurts. This reduces the scope of the problem significantly, by moving pci_iomap to a separate file and referencing that from all architectures. * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: alpha: drop pci_iomap/pci_iounmap from pci-noop.c mn10300: switch to GENERIC_PCI_IOMAP mn10300: add missing __iomap markers frv: switch to GENERIC_PCI_IOMAP tile: switch to GENERIC_PCI_IOMAP tile: don't panic on iomap sparc: switch to GENERIC_PCI_IOMAP sh: switch to GENERIC_PCI_IOMAP powerpc: switch to GENERIC_PCI_IOMAP parisc: switch to GENERIC_PCI_IOMAP mips: switch to GENERIC_PCI_IOMAP microblaze: switch to GENERIC_PCI_IOMAP arm: switch to GENERIC_PCI_IOMAP alpha: switch to GENERIC_PCI_IOMAP lib: add GENERIC_PCI_IOMAP lib: move GENERIC_IOMAP to lib/Kconfig Fix up trivial conflicts due to changes nearby in arch/{m68k,score}/Kconfig
Diffstat (limited to 'arch/tile')
-rw-r--r--arch/tile/Kconfig1
-rw-r--r--arch/tile/include/asm/io.h3
-rw-r--r--arch/tile/include/asm/pci.h2
-rw-r--r--arch/tile/kernel/pci.c21
4 files changed, 4 insertions, 23 deletions
diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig
index 70a0de46cd1..11270ca22c0 100644
--- a/arch/tile/Kconfig
+++ b/arch/tile/Kconfig
@@ -321,6 +321,7 @@ config PCI
321 bool "PCI support" 321 bool "PCI support"
322 default y 322 default y
323 select PCI_DOMAINS 323 select PCI_DOMAINS
324 select GENERIC_PCI_IOMAP
324 ---help--- 325 ---help---
325 Enable PCI root complex support, so PCIe endpoint devices can 326 Enable PCI root complex support, so PCIe endpoint devices can
326 be attached to the Tile chip. Many, but not all, PCI devices 327 be attached to the Tile chip. Many, but not all, PCI devices
diff --git a/arch/tile/include/asm/io.h b/arch/tile/include/asm/io.h
index c9ea1652af0..d2152deb1f3 100644
--- a/arch/tile/include/asm/io.h
+++ b/arch/tile/include/asm/io.h
@@ -204,7 +204,8 @@ static inline long ioport_panic(void)
204 204
205static inline void __iomem *ioport_map(unsigned long port, unsigned int len) 205static inline void __iomem *ioport_map(unsigned long port, unsigned int len)
206{ 206{
207 return (void __iomem *) ioport_panic(); 207 pr_info("ioport_map: mapping IO resources is unsupported on tile.\n");
208 return NULL;
208} 209}
209 210
210static inline void ioport_unmap(void __iomem *addr) 211static inline void ioport_unmap(void __iomem *addr)
diff --git a/arch/tile/include/asm/pci.h b/arch/tile/include/asm/pci.h
index 7f03cefed1b..1d25fea42e5 100644
--- a/arch/tile/include/asm/pci.h
+++ b/arch/tile/include/asm/pci.h
@@ -16,6 +16,7 @@
16#define _ASM_TILE_PCI_H 16#define _ASM_TILE_PCI_H
17 17
18#include <linux/pci.h> 18#include <linux/pci.h>
19#include <asm-generic/pci_iomap.h>
19 20
20/* 21/*
21 * Structure of a PCI controller (host bridge) 22 * Structure of a PCI controller (host bridge)
@@ -49,7 +50,6 @@ struct pci_controller {
49int __devinit tile_pci_init(void); 50int __devinit tile_pci_init(void);
50int __devinit pcibios_init(void); 51int __devinit pcibios_init(void);
51 52
52void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
53static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr) {} 53static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr) {}
54 54
55void __devinit pcibios_fixup_bus(struct pci_bus *bus); 55void __devinit pcibios_fixup_bus(struct pci_bus *bus);
diff --git a/arch/tile/kernel/pci.c b/arch/tile/kernel/pci.c
index 9d610d3fb11..25567934a21 100644
--- a/arch/tile/kernel/pci.c
+++ b/arch/tile/kernel/pci.c
@@ -466,27 +466,6 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
466 return 0; 466 return 0;
467} 467}
468 468
469void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max)
470{
471 unsigned long start = pci_resource_start(dev, bar);
472 unsigned long len = pci_resource_len(dev, bar);
473 unsigned long flags = pci_resource_flags(dev, bar);
474
475 if (!len)
476 return NULL;
477 if (max && len > max)
478 len = max;
479
480 if (!(flags & IORESOURCE_MEM)) {
481 pr_info("PCI: Trying to map invalid resource %#lx\n", flags);
482 start = 0;
483 }
484
485 return (void __iomem *)start;
486}
487EXPORT_SYMBOL(pci_iomap);
488
489
490/**************************************************************** 469/****************************************************************
491 * 470 *
492 * Tile PCI config space read/write routines 471 * Tile PCI config space read/write routines