|
@@ -88,8 +88,9 @@ static void __devinit pcibios_scanbus(struct pci_controller *hose)
|
|
|
if (hose->get_busno && pci_has_flag(PCI_PROBE_ONLY))
|
|
|
next_busno = (*hose->get_busno)();
|
|
|
|
|
|
- pci_add_resource(&resources, hose->mem_resource);
|
|
|
- pci_add_resource(&resources, hose->io_resource);
|
|
|
+ pci_add_resource_offset(&resources,
|
|
|
+ hose->mem_resource, hose->mem_offset);
|
|
|
+ pci_add_resource_offset(&resources, hose->io_resource, hose->io_offset);
|
|
|
bus = pci_scan_root_bus(NULL, next_busno, hose->pci_ops, hose,
|
|
|
&resources);
|
|
|
if (!bus)
|
|
@@ -247,45 +248,13 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
|
|
|
return pcibios_plat_dev_init(dev);
|
|
|
}
|
|
|
|
|
|
-static void pcibios_fixup_device_resources(struct pci_dev *dev,
|
|
|
- struct pci_bus *bus)
|
|
|
-{
|
|
|
- /* Update device resources. */
|
|
|
- struct pci_controller *hose = (struct pci_controller *)bus->sysdata;
|
|
|
- unsigned long offset = 0;
|
|
|
- int i;
|
|
|
-
|
|
|
- for (i = 0; i < PCI_NUM_RESOURCES; i++) {
|
|
|
- if (!dev->resource[i].start)
|
|
|
- continue;
|
|
|
- if (dev->resource[i].flags & IORESOURCE_IO)
|
|
|
- offset = hose->io_offset;
|
|
|
- else if (dev->resource[i].flags & IORESOURCE_MEM)
|
|
|
- offset = hose->mem_offset;
|
|
|
-
|
|
|
- dev->resource[i].start += offset;
|
|
|
- dev->resource[i].end += offset;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
void __devinit pcibios_fixup_bus(struct pci_bus *bus)
|
|
|
{
|
|
|
- /* Propagate hose info into the subordinate devices. */
|
|
|
-
|
|
|
- struct list_head *ln;
|
|
|
struct pci_dev *dev = bus->self;
|
|
|
|
|
|
if (pci_has_flag(PCI_PROBE_ONLY) && dev &&
|
|
|
(dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
|
|
|
pci_read_bridge_bases(bus);
|
|
|
- pcibios_fixup_device_resources(dev, bus);
|
|
|
- }
|
|
|
-
|
|
|
- for (ln = bus->devices.next; ln != &bus->devices; ln = ln->next) {
|
|
|
- dev = pci_dev_b(ln);
|
|
|
-
|
|
|
- if ((dev->class >> 8) != PCI_CLASS_BRIDGE_PCI)
|
|
|
- pcibios_fixup_device_resources(dev, bus);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -295,40 +264,7 @@ pcibios_update_irq(struct pci_dev *dev, int irq)
|
|
|
pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
|
|
|
}
|
|
|
|
|
|
-void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
|
|
|
- struct resource *res)
|
|
|
-{
|
|
|
- struct pci_controller *hose = (struct pci_controller *)dev->sysdata;
|
|
|
- unsigned long offset = 0;
|
|
|
-
|
|
|
- if (res->flags & IORESOURCE_IO)
|
|
|
- offset = hose->io_offset;
|
|
|
- else if (res->flags & IORESOURCE_MEM)
|
|
|
- offset = hose->mem_offset;
|
|
|
-
|
|
|
- region->start = res->start - offset;
|
|
|
- region->end = res->end - offset;
|
|
|
-}
|
|
|
-
|
|
|
-void __devinit
|
|
|
-pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
|
|
|
- struct pci_bus_region *region)
|
|
|
-{
|
|
|
- struct pci_controller *hose = (struct pci_controller *)dev->sysdata;
|
|
|
- unsigned long offset = 0;
|
|
|
-
|
|
|
- if (res->flags & IORESOURCE_IO)
|
|
|
- offset = hose->io_offset;
|
|
|
- else if (res->flags & IORESOURCE_MEM)
|
|
|
- offset = hose->mem_offset;
|
|
|
-
|
|
|
- res->start = region->start + offset;
|
|
|
- res->end = region->end + offset;
|
|
|
-}
|
|
|
-
|
|
|
#ifdef CONFIG_HOTPLUG
|
|
|
-EXPORT_SYMBOL(pcibios_resource_to_bus);
|
|
|
-EXPORT_SYMBOL(pcibios_bus_to_resource);
|
|
|
EXPORT_SYMBOL(PCIBIOS_MIN_IO);
|
|
|
EXPORT_SYMBOL(PCIBIOS_MIN_MEM);
|
|
|
#endif
|