aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/drivers/pci/pci.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-01-29 08:38:13 -0500
committerPaul Mundt <lethal@linux-sh.org>2010-01-29 08:38:13 -0500
commit320e68da59353fe6ad51b81f6865c4b674ad66ea (patch)
tree9fc7f0f07a6a656a6384736f17f7d52da9a9f79e /arch/sh/drivers/pci/pci.c
parentac8ab54a8e41a5ed0ee2161d45b6dc855490989f (diff)
sh: support PCI domains.
Newer SH parts are now commonly shipping with multiple controllers, so we wire up PCI domain support to deal with them. Shamelessly cloned from the MIPS implementation. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/drivers/pci/pci.c')
-rw-r--r--arch/sh/drivers/pci/pci.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c
index 82e59bc6210e..45a15cab01df 100644
--- a/arch/sh/drivers/pci/pci.c
+++ b/arch/sh/drivers/pci/pci.c
@@ -33,15 +33,22 @@ static int pci_initialized;
33static void __devinit pcibios_scanbus(struct pci_channel *hose) 33static void __devinit pcibios_scanbus(struct pci_channel *hose)
34{ 34{
35 static int next_busno; 35 static int next_busno;
36 static int need_domain_info;
36 struct pci_bus *bus; 37 struct pci_bus *bus;
37 38
38 bus = pci_scan_bus(next_busno, hose->pci_ops, hose); 39 bus = pci_scan_bus(next_busno, hose->pci_ops, hose);
40 hose->bus = bus;
41
42 need_domain_info = need_domain_info || hose->index;
43 hose->need_domain_info = need_domain_info;
39 if (bus) { 44 if (bus) {
40 next_busno = bus->subordinate + 1; 45 next_busno = bus->subordinate + 1;
41 /* Don't allow 8-bit bus number overflow inside the hose - 46 /* Don't allow 8-bit bus number overflow inside the hose -
42 reserve some space for bridges. */ 47 reserve some space for bridges. */
43 if (next_busno > 224) 48 if (next_busno > 224) {
44 next_busno = 0; 49 next_busno = 0;
50 need_domain_info = 1;
51 }
45 52
46 pci_bus_size_bridges(bus); 53 pci_bus_size_bridges(bus);
47 pci_bus_assign_resources(bus); 54 pci_bus_assign_resources(bus);
@@ -307,9 +314,15 @@ static void __iomem *ioport_map_pci(struct pci_dev *dev,
307{ 314{
308 struct pci_channel *chan = dev->sysdata; 315 struct pci_channel *chan = dev->sysdata;
309 316
310 if (!chan->io_map_base) 317 if (unlikely(!chan->io_map_base)) {
311 chan->io_map_base = generic_io_base; 318 chan->io_map_base = generic_io_base;
312 319
320 if (pci_domains_supported)
321 panic("To avoid data corruption io_map_base MUST be "
322 "set with multiple PCI domains.");
323 }
324
325
313 return (void __iomem *)(chan->io_map_base + port); 326 return (void __iomem *)(chan->io_map_base + port);
314} 327}
315 328