aboutsummaryrefslogtreecommitdiffstats
path: root/arch/tile
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2011-11-29 13:42:56 -0500
committerMichael S. Tsirkin <mst@redhat.com>2011-12-04 09:00:10 -0500
commit845501213033d0058945776349f15502823359d8 (patch)
tree549adde58442e159de0d782c48608a98a21bef3a /arch/tile
parent8593dd375ad10045e69b7b43fc1d885929aebbd5 (diff)
tile: switch to GENERIC_PCI_IOMAP
tile now has working stubs for ioport_map and ioremap such that the generic pci_iomap will DTRT: cast to pointer on memory and return NULL and log message on IO map. Switch it over to GENERIC_PCI_IOMAP. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'arch/tile')
-rw-r--r--arch/tile/Kconfig1
-rw-r--r--arch/tile/include/asm/pci.h2
-rw-r--r--arch/tile/kernel/pci.c21
3 files changed, 2 insertions, 22 deletions
diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig
index 70a0de46cd1b..11270ca22c0a 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/pci.h b/arch/tile/include/asm/pci.h
index 7f03cefed1b9..1d25fea42e54 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 2a8014cb1ff5..1b6244e69de4 100644
--- a/arch/tile/kernel/pci.c
+++ b/arch/tile/kernel/pci.c
@@ -465,27 +465,6 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
465 return 0; 465 return 0;
466} 466}
467 467
468void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max)
469{
470 unsigned long start = pci_resource_start(dev, bar);
471 unsigned long len = pci_resource_len(dev, bar);
472 unsigned long flags = pci_resource_flags(dev, bar);
473
474 if (!len)
475 return NULL;
476 if (max && len > max)
477 len = max;
478
479 if (!(flags & IORESOURCE_MEM)) {
480 pr_info("PCI: Trying to map invalid resource %#lx\n", flags);
481 start = 0;
482 }
483
484 return (void __iomem *)start;
485}
486EXPORT_SYMBOL(pci_iomap);
487
488
489/**************************************************************** 468/****************************************************************
490 * 469 *
491 * Tile PCI config space read/write routines 470 * Tile PCI config space read/write routines