aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/parisc/lba_pci.c
diff options
context:
space:
mode:
authorMatthew Wilcox <matthew@wil.cx>2006-11-18 12:11:03 -0500
committerKyle McMartin <kyle@ubuntu.com>2006-12-08 00:34:37 -0500
commit353dfe1290bdce1d40609e35ca6e42829623ff5f (patch)
tree0956025244bcaacc23eebc4edfcb268778cab880 /drivers/parisc/lba_pci.c
parentcaa451f30aabba47e96355511a63456357074df6 (diff)
[PARISC] Fix PCI bus numbering in the presence of Cardbus bridges
Firmware ignores Cardbus bridges, so when Linux assigns bus numbers, it must override firmware's notion of what the busses are numbered. This is not sufficient to support the Cardbus bridge as there is also no interrupt routing table entry for them. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
Diffstat (limited to 'drivers/parisc/lba_pci.c')
-rw-r--r--drivers/parisc/lba_pci.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c
index ad4a1a12a1ae..eae0812f01a5 100644
--- a/drivers/parisc/lba_pci.c
+++ b/drivers/parisc/lba_pci.c
@@ -1406,13 +1406,20 @@ lba_hw_init(struct lba_device *d)
1406 return 0; 1406 return 0;
1407} 1407}
1408 1408
1409 1409/*
1410 * Unfortunately, when firmware numbers busses, it doesn't take into account
1411 * Cardbus bridges. So we have to renumber the busses to suit ourselves.
1412 * Elroy/Mercury don't actually know what bus number they're attached to;
1413 * we use bus 0 to indicate the directly attached bus and any other bus
1414 * number will be taken care of by the PCI-PCI bridge.
1415 */
1416static unsigned int lba_next_bus = 0;
1410 1417
1411/* 1418/*
1412** Determine if lba should claim this chip (return 0) or not (return 1). 1419 * Determine if lba should claim this chip (return 0) or not (return 1).
1413** If so, initialize the chip and tell other partners in crime they 1420 * If so, initialize the chip and tell other partners in crime they
1414** have work to do. 1421 * have work to do.
1415*/ 1422 */
1416static int __init 1423static int __init
1417lba_driver_probe(struct parisc_device *dev) 1424lba_driver_probe(struct parisc_device *dev)
1418{ 1425{
@@ -1478,9 +1485,7 @@ lba_driver_probe(struct parisc_device *dev)
1478 return -ENODEV; 1485 return -ENODEV;
1479 } 1486 }
1480 1487
1481 /* 1488 /* Tell I/O SAPIC driver we have a IRQ handler/region. */
1482 ** Tell I/O SAPIC driver we have a IRQ handler/region.
1483 */
1484 tmp_obj = iosapic_register(dev->hpa.start + LBA_IOSAPIC_BASE); 1489 tmp_obj = iosapic_register(dev->hpa.start + LBA_IOSAPIC_BASE);
1485 1490
1486 /* NOTE: PCI devices (e.g. 103c:1005 graphics card) which don't 1491 /* NOTE: PCI devices (e.g. 103c:1005 graphics card) which don't
@@ -1529,16 +1534,17 @@ lba_driver_probe(struct parisc_device *dev)
1529 lba_legacy_resources(dev, lba_dev); 1534 lba_legacy_resources(dev, lba_dev);
1530 } 1535 }
1531 1536
1532 /* 1537 if (lba_dev->hba.bus_num.start < lba_next_bus)
1533 ** Tell PCI support another PCI bus was found. 1538 lba_dev->hba.bus_num.start = lba_next_bus;
1534 ** Walks PCI bus for us too. 1539
1535 */
1536 dev->dev.platform_data = lba_dev; 1540 dev->dev.platform_data = lba_dev;
1537 lba_bus = lba_dev->hba.hba_bus = 1541 lba_bus = lba_dev->hba.hba_bus =
1538 pci_scan_bus_parented(&dev->dev, lba_dev->hba.bus_num.start, 1542 pci_scan_bus_parented(&dev->dev, lba_dev->hba.bus_num.start,
1539 cfg_ops, NULL); 1543 cfg_ops, NULL);
1540 if (lba_bus) 1544 if (lba_bus) {
1545 lba_next_bus = lba_bus->subordinate + 1;
1541 pci_bus_add_devices(lba_bus); 1546 pci_bus_add_devices(lba_bus);
1547 }
1542 1548
1543 /* This is in lieu of calling pci_assign_unassigned_resources() */ 1549 /* This is in lieu of calling pci_assign_unassigned_resources() */
1544 if (is_pdc_pat()) { 1550 if (is_pdc_pat()) {