X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=arch%2Fparisc%2Fkernel%2Fpci.c;h=79c7db2705fd4b7b475a87af50e09cf57cc62a4a;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=3cb08a4a513ab4e4f7e3f8d15e8ea227ad692ef9;hpb=cee37fe97739d85991964371c1f3a745c00dd236;p=linux-2.6.git diff --git a/arch/parisc/kernel/pci.c b/arch/parisc/kernel/pci.c index 3cb08a4a5..79c7db270 100644 --- a/arch/parisc/kernel/pci.c +++ b/arch/parisc/kernel/pci.c @@ -47,18 +47,17 @@ * this makes the boot time much longer than necessary. * 20ms seems to work for all the HP PCI implementations to date. * - * XXX: turn into a #defined constant in ? + * #define pci_post_reset_delay 50 */ -int pci_post_reset_delay = 50; -struct pci_port_ops *pci_port; -struct pci_bios_ops *pci_bios; +struct pci_port_ops *pci_port __read_mostly; +struct pci_bios_ops *pci_bios __read_mostly; -int pci_hba_count = 0; +static int pci_hba_count __read_mostly; /* parisc_pci_hba used by pci_port->in/out() ops to lookup bus data. */ #define PCI_HBA_MAX 32 -struct pci_hba_data *parisc_pci_hba[PCI_HBA_MAX]; +static struct pci_hba_data *parisc_pci_hba[PCI_HBA_MAX] __read_mostly; /******************************************************************** @@ -202,7 +201,8 @@ static void pcibios_link_hba_resources( struct resource *hba_res, struct resource *r) { if (!r->parent) { - printk(KERN_EMERG "PCI: Tell willy he's wrong\n"); + printk(KERN_EMERG "PCI: resource not parented! [%lx-%lx]\n", + r->start, r->end); r->parent = hba_res; /* reverse link is harder *sigh* */ @@ -255,8 +255,28 @@ void __devinit pcibios_resource_to_bus(struct pci_dev *dev, pcibios_link_hba_resources(&hba->lmmio_space, bus->resource[1]); } +void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, + struct pci_bus_region *region) +{ +#ifdef CONFIG_64BIT + struct pci_bus *bus = dev->bus; + struct pci_hba_data *hba = HBA_DATA(bus->bridge->platform_data); +#endif + + if (res->flags & IORESOURCE_MEM) { + res->start = PCI_HOST_ADDR(hba, region->start); + res->end = PCI_HOST_ADDR(hba, region->end); + } + + if (res->flags & IORESOURCE_IO) { + res->start = region->start; + res->end = region->end; + } +} + #ifdef CONFIG_HOTPLUG EXPORT_SYMBOL(pcibios_resource_to_bus); +EXPORT_SYMBOL(pcibios_bus_to_resource); #endif /*