aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/parisc/lba_pci.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2012-02-23 22:19:03 -0500
committerBjorn Helgaas <bhelgaas@google.com>2012-02-23 22:19:03 -0500
commit39c2462e163448c7df466c7262109ec6a24d5f88 (patch)
tree58edadf5be6f48cc845baeaa1c5b58cd00591605 /drivers/parisc/lba_pci.c
parent4b84b6e9b43cab04099ba7055322d31dbd789475 (diff)
parisc/PCI: get rid of device resource fixups
Tell the PCI core about host bridge address translation so it can take care of bus-to-resource conversion for us. CC: linux-parisc@vger.kernel.org Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/parisc/lba_pci.c')
-rw-r--r--drivers/parisc/lba_pci.c31
1 files changed, 6 insertions, 25 deletions
diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c
index d5f3d753a108..e8857647e210 100644
--- a/drivers/parisc/lba_pci.c
+++ b/drivers/parisc/lba_pci.c
@@ -635,7 +635,6 @@ lba_fixup_bus(struct pci_bus *bus)
635 u16 status; 635 u16 status;
636#endif 636#endif
637 struct lba_device *ldev = LBA_DEV(parisc_walk_tree(bus->bridge)); 637 struct lba_device *ldev = LBA_DEV(parisc_walk_tree(bus->bridge));
638 int lba_portbase = HBA_PORT_BASE(ldev->hba.hba_num);
639 638
640 DBG("lba_fixup_bus(0x%p) bus %d platform_data 0x%p\n", 639 DBG("lba_fixup_bus(0x%p) bus %d platform_data 0x%p\n",
641 bus, bus->secondary, bus->bridge->platform_data); 640 bus, bus->secondary, bus->bridge->platform_data);
@@ -726,27 +725,6 @@ lba_fixup_bus(struct pci_bus *bus)
726 if (!res->start) 725 if (!res->start)
727 continue; 726 continue;
728 727
729 if (res->flags & IORESOURCE_IO) {
730 DBG("lba_fixup_bus() I/O Ports [%lx/%lx] -> ",
731 res->start, res->end);
732 res->start |= lba_portbase;
733 res->end |= lba_portbase;
734 DBG("[%lx/%lx]\n", res->start, res->end);
735 } else if (res->flags & IORESOURCE_MEM) {
736 /*
737 ** Convert PCI (IO_VIEW) addresses to
738 ** processor (PA_VIEW) addresses
739 */
740 DBG("lba_fixup_bus() MMIO [%lx/%lx] -> ",
741 res->start, res->end);
742 res->start = PCI_HOST_ADDR(HBA_DATA(ldev), res->start);
743 res->end = PCI_HOST_ADDR(HBA_DATA(ldev), res->end);
744 DBG("[%lx/%lx]\n", res->start, res->end);
745 } else {
746 DBG("lba_fixup_bus() WTF? 0x%lx [%lx/%lx] XXX",
747 res->flags, res->start, res->end);
748 }
749
750 /* 728 /*
751 ** FIXME: this will result in whinging for devices 729 ** FIXME: this will result in whinging for devices
752 ** that share expansion ROMs (think quad tulip), but 730 ** that share expansion ROMs (think quad tulip), but
@@ -1514,11 +1492,14 @@ lba_driver_probe(struct parisc_device *dev)
1514 lba_dev->hba.lmmio_space.flags = 0; 1492 lba_dev->hba.lmmio_space.flags = 0;
1515 } 1493 }
1516 1494
1517 pci_add_resource(&resources, &lba_dev->hba.io_space); 1495 pci_add_resource_offset(&resources, &lba_dev->hba.io_space,
1496 HBA_PORT_BASE(lba_dev->hba.hba_num));
1518 if (lba_dev->hba.elmmio_space.start) 1497 if (lba_dev->hba.elmmio_space.start)
1519 pci_add_resource(&resources, &lba_dev->hba.elmmio_space); 1498 pci_add_resource_offset(&resources, &lba_dev->hba.elmmio_space,
1499 lba_dev->hba.lmmio_space_offset);
1520 if (lba_dev->hba.lmmio_space.flags) 1500 if (lba_dev->hba.lmmio_space.flags)
1521 pci_add_resource(&resources, &lba_dev->hba.lmmio_space); 1501 pci_add_resource_offset(&resources, &lba_dev->hba.lmmio_space,
1502 lba_dev->hba.lmmio_space_offset);
1522 if (lba_dev->hba.gmmio_space.flags) 1503 if (lba_dev->hba.gmmio_space.flags)
1523 pci_add_resource(&resources, &lba_dev->hba.gmmio_space); 1504 pci_add_resource(&resources, &lba_dev->hba.gmmio_space);
1524 1505