From 2ef9c88bfaee6fbd7f9d5da32f9b93794be49185 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 16 Mar 2003 21:56:53 +0000 Subject: [PATCH] [PCI] pci-8: pci_resource_to_bus() Convert pcibios_fixup_pbus_ranges() into something more generic, namely pcibios_resource_to_bus() - we are really trying to convert resources to something to program into bus registers for bridge windows, and in fact, PCI device BARs. This is necessary since some architectures, namely Alpha, ARM and PARISC have an offset between PCI addressing and host-based addressing, so resources need to be adjusted when read or when written back to the bus. We provide a generic version in asm-generic/pci.h, which most architectures use. This patch finds the following architectures with something to think consider: - ppc, ppc64 adjusts resources for devices, but not buses. This is inconsistent, and leads to improperly programmed windows/BARs. PPC people (Anton) has a replacement PCI resource implementation which should do the right thing. --- arch/alpha/kernel/pci.c | 28 +++++++++++--------- arch/arm/kernel/bios32.c | 24 +++++++++++------ arch/i386/pci/common.c | 5 ---- arch/ia64/pci/pci.c | 5 ---- arch/mips/ddb5074/pci.c | 5 ---- arch/mips/ddb5476/pci.c | 9 ++++--- arch/mips64/sgi-ip27/ip27-pci.c | 6 ----- arch/mips64/sgi-ip32/ip32-pci.c | 6 ----- arch/parisc/kernel/pci.c | 46 +++++++++++++++++++-------------- arch/ppc/kernel/pci.c | 5 ---- arch/ppc64/kernel/pci.c | 5 ---- arch/sh/kernel/pci-dc.c | 4 --- arch/sh/kernel/pci-sh7751.c | 6 ----- arch/sh/kernel/pci_st40.c | 6 ----- arch/sh/kernel/pcibios.c | 1 - drivers/pci/setup-bus.c | 41 ++++++++++++----------------- include/asm-alpha/pci.h | 5 ++++ include/asm-arm/pci.h | 4 +++ include/asm-generic/pci.h | 25 ++++++++++++++++++ include/asm-i386/pci.h | 3 +++ include/asm-ia64/pci.h | 3 +++ include/asm-mips/pci.h | 3 +++ include/asm-mips64/pci.h | 4 +++ include/asm-parisc/pci.h | 4 +++ include/asm-ppc/pci.h | 3 +++ include/asm-ppc64/pci.h | 3 +++ include/asm-sh/pci.h | 2 ++ include/asm-sparc64/pci.h | 3 +++ include/asm-x86_64/pci.h | 3 +++ include/linux/pci.h | 9 +++---- 30 files changed, 148 insertions(+), 128 deletions(-) create mode 100644 include/asm-generic/pci.h diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c index 81e0795686881..10942ee451059 100644 --- a/arch/alpha/kernel/pci.c +++ b/arch/alpha/kernel/pci.c @@ -12,7 +12,7 @@ * Nov 2000, Ivan Kokshaysky * PCI-PCI bridges cleanup */ - +#include #include #include #include @@ -334,21 +334,25 @@ common_swizzle(struct pci_dev *dev, u8 *pinp) } void __devinit -pcibios_fixup_pbus_ranges(struct pci_bus * bus, - struct pbus_set_ranges_data * ranges) +pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, + struct resource *res) { - struct pci_controller *hose = (struct pci_controller *)bus->sysdata; + struct pci_controller *hose = (struct pci_controller *)dev->sysdata; + unsigned long offset = 0; + + if (res->flags & IORESOURCE_IO) + offset = hose->io_space->start; + else if (res->flags & IORESOURCE_MEM) + offset = hose->mem_space->start; - ranges->io_start -= hose->io_space->start; - ranges->io_end -= hose->io_space->start; - ranges->mem_start -= hose->mem_space->start; - ranges->mem_end -= hose->mem_space->start; -/* FIXME: On older alphas we could use dense memory space - to access prefetchable resources. */ - ranges->prefetch_start -= hose->mem_space->start; - ranges->prefetch_end -= hose->mem_space->start; + region->start = res->start - offset; + region->end = res->end - offset; } +#ifdef CONFIG_HOTPLUG +EXPORT_SYMBOL(pcibios_resource_to_bus); +#endif + int pcibios_enable_device(struct pci_dev *dev, int mask) { diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c index 8df79c2cdee37..090a29fee3e7a 100644 --- a/arch/arm/kernel/bios32.c +++ b/arch/arm/kernel/bios32.c @@ -439,18 +439,26 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus) * Convert from Linux-centric to bus-centric addresses for bridge devices. */ void __devinit -pcibios_fixup_pbus_ranges(struct pci_bus *bus, struct pbus_set_ranges_data *ranges) +pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, + struct resource *res) { - struct pci_sys_data *root = bus->sysdata; + struct pci_sys_data *root = dev->sysdata; + unsigned long offset = 0; + + if (res->flags & IORESOURCE_IO) + offset = root->io_offset; + if (res->flags & IORESOURCE_MEM) + offset = root->mem_offset; - ranges->io_start -= root->io_offset; - ranges->io_end -= root->io_offset; - ranges->mem_start -= root->mem_offset; - ranges->mem_end -= root->mem_offset; - ranges->prefetch_start -= root->mem_offset; - ranges->prefetch_end -= root->mem_offset; + region->start = res->start - offset; + region->end = res->end - offset; } +#ifdef CONFIG_HOTPLUG +EXPORT_SYMBOL(pcibios_fixup_bus); +EXPORT_SYMBOL(pcibios_resource_to_bus); +#endif + /* * This is the standard PCI-PCI bridge swizzling algorithm: * diff --git a/arch/i386/pci/common.c b/arch/i386/pci/common.c index 6d65faac8ec76..2907705168337 100644 --- a/arch/i386/pci/common.c +++ b/arch/i386/pci/common.c @@ -90,11 +90,6 @@ static void __devinit pcibios_fixup_ghosts(struct pci_bus *b) } } -void __devinit -pcibios_fixup_pbus_ranges (struct pci_bus *bus, struct pbus_set_ranges_data *ranges) -{ -} - /* * Called after each bus is probed, but before its children * are examined. diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index 84e49ffc52b14..03fcd62072f58 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c @@ -168,11 +168,6 @@ pcibios_update_irq (struct pci_dev *dev, int irq) /* ??? FIXME -- record old value for shutdown. */ } -void __devinit -pcibios_fixup_pbus_ranges (struct pci_bus * bus, struct pbus_set_ranges_data * ranges) -{ -} - static inline int pcibios_enable_resources (struct pci_dev *dev, int mask) { diff --git a/arch/mips/ddb5074/pci.c b/arch/mips/ddb5074/pci.c index b97df65f4f3f6..6baf4bea33cf9 100644 --- a/arch/mips/ddb5074/pci.c +++ b/arch/mips/ddb5074/pci.c @@ -297,11 +297,6 @@ void __init pcibios_update_irq(struct pci_dev *dev, int irq) pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); } -void __devinit pcibios_fixup_pbus_ranges(struct pci_bus *bus, - struct pbus_set_ranges_data *ranges) -{ -} - int pcibios_enable_resources(struct pci_dev *dev) { u16 cmd, old_cmd; diff --git a/arch/mips/ddb5476/pci.c b/arch/mips/ddb5476/pci.c index 473aa79e4d65e..08f4a867c03f9 100644 --- a/arch/mips/ddb5476/pci.c +++ b/arch/mips/ddb5476/pci.c @@ -341,8 +341,10 @@ void __init pcibios_update_irq(struct pci_dev *dev, int irq) pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); } -void __devinit pcibios_fixup_pbus_ranges(struct pci_bus *bus, - struct pbus_set_ranges_data *ranges) +#if 0 /* original DDB5074 code */ +void __devinit +pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, + struct resource *res) { /* * our caller figure out range by going through the dev structures. @@ -350,15 +352,14 @@ void __devinit pcibios_fixup_pbus_ranges(struct pci_bus *bus, * different view of the addressing space. */ -#if 0 /* original DDB5074 code */ if (bus->number == 0) { ranges->io_start -= bus->resource[0]->start; ranges->io_end -= bus->resource[0]->start; ranges->mem_start -= bus->resource[1]->start; ranges->mem_end -= bus->resource[1]->start; } -#endif } +#endif int pcibios_enable_resources(struct pci_dev *dev) { diff --git a/arch/mips64/sgi-ip27/ip27-pci.c b/arch/mips64/sgi-ip27/ip27-pci.c index 5b26dca1771e0..328fe39a12a18 100644 --- a/arch/mips64/sgi-ip27/ip27-pci.c +++ b/arch/mips64/sgi-ip27/ip27-pci.c @@ -235,12 +235,6 @@ pcibios_fixup_bus(struct pci_bus *b) pci_fixup_irqs(pci_swizzle, pci_map_irq); } -void __devinit -pcibios_fixup_pbus_ranges(struct pci_bus * bus, - struct pbus_set_ranges_data * ranges) -{ -} - int __init pcibios_enable_device(struct pci_dev *dev) { diff --git a/arch/mips64/sgi-ip32/ip32-pci.c b/arch/mips64/sgi-ip32/ip32-pci.c index 11fd67105e613..2aa4aeccdd742 100644 --- a/arch/mips64/sgi-ip32/ip32-pci.c +++ b/arch/mips64/sgi-ip32/ip32-pci.c @@ -348,12 +348,6 @@ void __init pcibios_fixup_bus (struct pci_bus *b) pci_fixup_irqs (macepci_swizzle, macepci_map_irq); } -/* XXX anybody know what this is supposed to do? */ -void __devinit pcibios_fixup_pbus_ranges(struct pci_bus * bus, - struct pbus_set_ranges_data * ranges) -{ -} - /* * Handle errors from the bridge. This includes master and target aborts, * various command and address errors, and the interrupt test. This gets diff --git a/arch/parisc/kernel/pci.c b/arch/parisc/kernel/pci.c index a457f1d67c259..67bf315c62e12 100644 --- a/arch/parisc/kernel/pci.c +++ b/arch/parisc/kernel/pci.c @@ -344,30 +344,34 @@ pcibios_link_hba_resources( struct resource *hba_res, struct resource *r) /* ** called by drivers/pci/setup-res.c:pci_setup_bridge(). */ -void __devinit pcibios_fixup_pbus_ranges( - struct pci_bus *bus, - struct pbus_set_ranges_data *ranges +void __devinit pcibios_resource_to_bus( + struct pci_dev *dev, + struct pci_bus_region *region, + struct resource *res ) { + struct pci_bus *bus = dev->bus; struct pci_hba_data *hba = HBA_DATA(bus->dev->platform_data); - /* - ** I/O space may see busnumbers here. Something - ** in the form of 0xbbxxxx where bb is the bus num - ** and xxxx is the I/O port space address. - ** Remaining address translation are done in the - ** PCI Host adapter specific code - ie dino_out8. - */ - ranges->io_start = PCI_PORT_ADDR(ranges->io_start); - ranges->io_end = PCI_PORT_ADDR(ranges->io_end); - - /* Convert MMIO addr to PCI addr (undo global virtualization) */ - ranges->mem_start = PCI_BUS_ADDR(hba, ranges->mem_start); - ranges->mem_end = PCI_BUS_ADDR(hba, ranges->mem_end); + if (res->flags & IORESOURCE_IO) { + /* + ** I/O space may see busnumbers here. Something + ** in the form of 0xbbxxxx where bb is the bus num + ** and xxxx is the I/O port space address. + ** Remaining address translation are done in the + ** PCI Host adapter specific code - ie dino_out8. + */ + region->start = PCI_PORT_ADDR(res->start); + region->end = PCI_PORT_ADDR(res->end); + } else if (res->flags & IORESOURCE_MEM) { + /* Convert MMIO addr to PCI addr (undo global virtualization) */ + region->start = PCI_BUS_ADDR(hba, res->start); + region->end = PCI_BUS_ADDR(hba, res->end); + } - DBG_RES("pcibios_fixup_pbus_ranges(%02x, [%lx,%lx %lx,%lx])\n", bus->number, - ranges->io_start, ranges->io_end, - ranges->mem_start, ranges->mem_end); + DBG_RES("pcibios_resource_to_bus(%02x %s [%lx,%lx])\n", + bus->number, res->flags & IORESOURCE_IO ? "IO" : "MEM", + region->start, region->end); /* KLUGE ALERT ** if this resource isn't linked to a "parent", then it seems @@ -377,6 +381,10 @@ void __devinit pcibios_fixup_pbus_ranges( pcibios_link_hba_resources(&hba->lmmio_space, bus->resource[1]); } +#ifdef CONFIG_HOTPLUG +EXPORT_SYMBOL(pcibios_resource_to_bus); +#endif + #define MAX(val1, val2) ((val1) > (val2) ? (val1) : (val2)) diff --git a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c index 71effba667d2e..d35111a4bf380 100644 --- a/arch/ppc/kernel/pci.c +++ b/arch/ppc/kernel/pci.c @@ -1107,11 +1107,6 @@ common_swizzle(struct pci_dev *dev, unsigned char *pinp) return PCI_SLOT(dev->devfn); } -void __devinit -pcibios_fixup_pbus_ranges(struct pci_bus * bus, struct pbus_set_ranges_data * ranges) -{ -} - unsigned long resource_fixup(struct pci_dev * dev, struct resource * res, unsigned long start, unsigned long size) { diff --git a/arch/ppc64/kernel/pci.c b/arch/ppc64/kernel/pci.c index fed8f78fd6bb6..7edf23857c245 100644 --- a/arch/ppc64/kernel/pci.c +++ b/arch/ppc64/kernel/pci.c @@ -127,11 +127,6 @@ struct pci_dev *pci_find_dev_by_addr(unsigned long addr) return NULL; } -void __devinit pcibios_fixup_pbus_ranges(struct pci_bus *pbus, - struct pbus_set_ranges_data *pranges) -{ -} - void pcibios_update_resource(struct pci_dev *dev, struct resource *res, int resource) diff --git a/arch/sh/kernel/pci-dc.c b/arch/sh/kernel/pci-dc.c index 34ec18b092537..ed3bcf26f8102 100644 --- a/arch/sh/kernel/pci-dc.c +++ b/arch/sh/kernel/pci-dc.c @@ -113,10 +113,6 @@ void pci_free_consistent(struct pci_dev *hwdev, size_t size, } -void __devinit pcibios_fixup_pbus_ranges(struct pci_bus *bus, struct pbus_set_ranges_data *ranges) -{ -} - void __init pcibios_fixup_bus(struct pci_bus *bus) { struct list_head *ln; diff --git a/arch/sh/kernel/pci-sh7751.c b/arch/sh/kernel/pci-sh7751.c index 9db302503b0af..19a8291aa359b 100644 --- a/arch/sh/kernel/pci-sh7751.c +++ b/arch/sh/kernel/pci-sh7751.c @@ -250,12 +250,6 @@ struct pci_fixup pcibios_fixups[] = { { 0 } }; -void __devinit pcibios_fixup_pbus_ranges(struct pci_bus *b, - struct pbus_set_ranges_data *range) -{ - /* No fixups needed */ -} - /* * Called after each bus is probed, but before its children * are examined. diff --git a/arch/sh/kernel/pci_st40.c b/arch/sh/kernel/pci_st40.c index ccef05c9e87cc..b1e8e2b1c1f87 100644 --- a/arch/sh/kernel/pci_st40.c +++ b/arch/sh/kernel/pci_st40.c @@ -380,12 +380,6 @@ static int __init map_harp_irq(struct pci_dev *dev, u8 slot, u8 pin) } -void __devinit -pcibios_fixup_pbus_ranges(struct pci_bus *bus, - struct pbus_set_ranges_data *ranges) -{ -} - void __init pcibios_init(void) { extern unsigned long memory_start, memory_end; diff --git a/arch/sh/kernel/pcibios.c b/arch/sh/kernel/pcibios.c index 6f4d7b84c32df..6b785b914ab48 100644 --- a/arch/sh/kernel/pcibios.c +++ b/arch/sh/kernel/pcibios.c @@ -19,7 +19,6 @@ * pcibios_fixup_bus() * pcibios_init() * pcibios_setup() - * pcibios_fixup_pbus_ranges() */ #include diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index b796e2270a653..0eab0b57e10a8 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -72,40 +72,29 @@ pbus_assign_resources_sorted(struct pci_bus *bus) requires that if there is no I/O ports or memory behind the bridge, corresponding range must be turned off by writing base value greater than limit to the bridge's base/limit registers. */ -static void __devinit -pci_setup_bridge(struct pci_bus *bus) +static void __devinit pci_setup_bridge(struct pci_bus *bus) { - struct pbus_set_ranges_data ranges; struct pci_dev *bridge = bus->self; + struct pci_bus_region region; u32 l; - if (!bridge || (bridge->class >> 8) != PCI_CLASS_BRIDGE_PCI) - return; - - ranges.io_start = bus->resource[0]->start; - ranges.io_end = bus->resource[0]->end; - ranges.mem_start = bus->resource[1]->start; - ranges.mem_end = bus->resource[1]->end; - ranges.prefetch_start = bus->resource[2]->start; - ranges.prefetch_end = bus->resource[2]->end; - pcibios_fixup_pbus_ranges(bus, &ranges); - DBGC((KERN_INFO "PCI: Bus %d, bridge: %s\n", bus->number, bridge->dev.name)); /* Set up the top and bottom of the PCI I/O segment for this bus. */ + pcibios_resource_to_bus(bridge, ®ion, bus->resource[0]); if (bus->resource[0]->flags & IORESOURCE_IO) { pci_read_config_dword(bridge, PCI_IO_BASE, &l); l &= 0xffff0000; - l |= (ranges.io_start >> 8) & 0x00f0; - l |= ranges.io_end & 0xf000; + l |= (region.start >> 8) & 0x00f0; + l |= region.end & 0xf000; /* Set up upper 16 bits of I/O base/limit. */ pci_write_config_word(bridge, PCI_IO_BASE_UPPER16, - ranges.io_start >> 16); + region.start >> 16); pci_write_config_word(bridge, PCI_IO_LIMIT_UPPER16, - ranges.io_end >> 16); + region.end >> 16); DBGC((KERN_INFO " IO window: %04lx-%04lx\n", - ranges.io_start, ranges.io_end)); + region.start, region.end)); } else { /* Clear upper 16 bits of I/O base/limit. */ @@ -117,11 +106,12 @@ pci_setup_bridge(struct pci_bus *bus) /* Set up the top and bottom of the PCI Memory segment for this bus. */ + pcibios_resource_to_bus(bridge, ®ion, bus->resource[1]); if (bus->resource[1]->flags & IORESOURCE_MEM) { - l = (ranges.mem_start >> 16) & 0xfff0; - l |= ranges.mem_end & 0xfff00000; + l = (region.start >> 16) & 0xfff0; + l |= region.end & 0xfff00000; DBGC((KERN_INFO " MEM window: %08lx-%08lx\n", - ranges.mem_start, ranges.mem_end)); + region.start, region.end)); } else { l = 0x0000fff0; @@ -134,11 +124,12 @@ pci_setup_bridge(struct pci_bus *bus) pci_write_config_dword(bridge, PCI_PREF_LIMIT_UPPER32, 0); /* Set up PREF base/limit. */ + pcibios_resource_to_bus(bridge, ®ion, bus->resource[2]); if (bus->resource[2]->flags & IORESOURCE_PREFETCH) { - l = (ranges.prefetch_start >> 16) & 0xfff0; - l |= ranges.prefetch_end & 0xfff00000; + l = (region.start >> 16) & 0xfff0; + l |= region.end & 0xfff00000; DBGC((KERN_INFO " PREFETCH window: %08lx-%08lx\n", - ranges.prefetch_start, ranges.prefetch_end)); + region.start, region.end)); } else { l = 0x0000fff0; diff --git a/include/asm-alpha/pci.h b/include/asm-alpha/pci.h index 3f88b46f8dfed..1e82bf33cb842 100644 --- a/include/asm-alpha/pci.h +++ b/include/asm-alpha/pci.h @@ -190,6 +190,11 @@ pci_dac_dma_sync_single(struct pci_dev *pdev, dma64_addr_t dma_addr, size_t len, /* Return the index of the PCI controller for device PDEV. */ extern int pci_controller_num(struct pci_dev *pdev); + +extern void +pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, + struct resource *res); + #endif /* __KERNEL__ */ /* Values for the `which' argument to sys_pciconfig_iobase. */ diff --git a/include/asm-arm/pci.h b/include/asm-arm/pci.h index 193c96e1609f5..72843a2888b53 100644 --- a/include/asm-arm/pci.h +++ b/include/asm-arm/pci.h @@ -175,6 +175,10 @@ void pci_pool_free (struct pci_pool *pool, void *vaddr, dma_addr_t addr); extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, enum pci_mmap_state mmap_state, int write_combine); +extern void +pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, + struct resource *res); + #endif /* __KERNEL__ */ #endif diff --git a/include/asm-generic/pci.h b/include/asm-generic/pci.h new file mode 100644 index 0000000000000..df757d240e9a0 --- /dev/null +++ b/include/asm-generic/pci.h @@ -0,0 +1,25 @@ +/* + * linux/include/asm-generic/pci.h + * + * Copyright (C) 2003 Russell King + */ +#ifndef _ASM_GENERIC_PCI_H +#define _ASM_GENERIC_PCI_H + +/** + * pcibios_resource_to_bus - convert resource to PCI bus address + * @dev: device which owns this resource + * @region: converted bus-centric region (start,end) + * @res: resource to convert + * + * Convert a resource to a PCI device bus address or bus window. + */ +static inline void +pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, + struct resource *res) +{ + region->start = res->start; + region->end = res->end; +} + +#endif diff --git a/include/asm-i386/pci.h b/include/asm-i386/pci.h index d41feaba85ef7..e0e0442260dff 100644 --- a/include/asm-i386/pci.h +++ b/include/asm-i386/pci.h @@ -105,4 +105,7 @@ extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, /* implement the pci_ DMA API in terms of the generic device dma_ one */ #include +/* generic pci stuff */ +#include + #endif /* __i386_PCI_H */ diff --git a/include/asm-ia64/pci.h b/include/asm-ia64/pci.h index 62a7d5a544d57..69a58612d87b6 100644 --- a/include/asm-ia64/pci.h +++ b/include/asm-ia64/pci.h @@ -97,4 +97,7 @@ extern int pcibios_prep_mwi (struct pci_dev *); extern int pci_mmap_page_range (struct pci_dev *dev, struct vm_area_struct *vma, enum pci_mmap_state mmap_state, int write_combine); +/* generic pci stuff */ +#include + #endif /* _ASM_IA64_PCI_H */ diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h index 84c9bd2b9bfb5..98b248e8cd29f 100644 --- a/include/asm-mips/pci.h +++ b/include/asm-mips/pci.h @@ -252,4 +252,7 @@ extern inline int pci_dma_supported(struct pci_dev *hwdev, u64 mask) #endif /* __KERNEL__ */ +/* generic pci stuff */ +#include + #endif /* _ASM_PCI_H */ diff --git a/include/asm-mips64/pci.h b/include/asm-mips64/pci.h index a7cc388c58243..730e040754803 100644 --- a/include/asm-mips64/pci.h +++ b/include/asm-mips64/pci.h @@ -272,4 +272,8 @@ static inline int pci_dma_supported(struct pci_dev *hwdev, u64 mask) #endif /* __KERNEL__ */ +/* generic pci stuff */ +#include + #endif /* _ASM_PCI_H */ + diff --git a/include/asm-parisc/pci.h b/include/asm-parisc/pci.h index 2dbd703983e71..d44ad70d0e35d 100644 --- a/include/asm-parisc/pci.h +++ b/include/asm-parisc/pci.h @@ -186,4 +186,8 @@ extern inline void pcibios_register_hba(struct pci_hba_data *x) /* export the pci_ DMA API in terms of the dma_ one */ #include +extern void +pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, + struct resource *res); + #endif /* __ASM_PARISC_PCI_H */ diff --git a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h index 92118321f0a59..c178b8e5d4b3f 100644 --- a/include/asm-ppc/pci.h +++ b/include/asm-ppc/pci.h @@ -273,4 +273,7 @@ int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma, #endif /* __KERNEL__ */ +/* generic pci stuff */ +#include + #endif /* __PPC_PCI_H */ diff --git a/include/asm-ppc64/pci.h b/include/asm-ppc64/pci.h index 0b715895f0437..2cab41c41cca3 100644 --- a/include/asm-ppc64/pci.h +++ b/include/asm-ppc64/pci.h @@ -124,4 +124,7 @@ int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma, #endif /* __KERNEL__ */ +/* generic pci stuff */ +#include + #endif /* __PPC64_PCI_H */ diff --git a/include/asm-sh/pci.h b/include/asm-sh/pci.h index f9690c521d193..60fffd091ad62 100644 --- a/include/asm-sh/pci.h +++ b/include/asm-sh/pci.h @@ -240,6 +240,8 @@ static inline int pci_dma_supported(struct pci_dev *hwdev, u64 mask) #endif /* __KERNEL__ */ +/* generic pci stuff */ +#include #endif /* __ASM_SH_PCI_H */ diff --git a/include/asm-sparc64/pci.h b/include/asm-sparc64/pci.h index 53a010006c418..6b97445a221a9 100644 --- a/include/asm-sparc64/pci.h +++ b/include/asm-sparc64/pci.h @@ -207,4 +207,7 @@ extern int pcibios_prep_mwi(struct pci_dev *dev); #endif /* __KERNEL__ */ +/* generic pci stuff */ +#include + #endif /* __SPARC64_PCI_H */ diff --git a/include/asm-x86_64/pci.h b/include/asm-x86_64/pci.h index 024a9c0456817..74594c63e38cb 100644 --- a/include/asm-x86_64/pci.h +++ b/include/asm-x86_64/pci.h @@ -279,4 +279,7 @@ extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, #endif /* __KERNEL__ */ +/* generic pci stuff */ +#include + #endif /* __x8664_PCI_H */ diff --git a/include/linux/pci.h b/include/linux/pci.h index 0bc50220c1026..b01ae2e4df9cb 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -485,11 +485,9 @@ struct pci_ops { int (*write)(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val); }; -struct pbus_set_ranges_data -{ - unsigned long io_start, io_end; - unsigned long mem_start, mem_end; - unsigned long prefetch_start, prefetch_end; +struct pci_bus_region { + unsigned long start; + unsigned long end; }; struct pci_driver { @@ -533,7 +531,6 @@ void pcibios_align_resource(void *, struct resource *, unsigned long, unsigned long); void pcibios_update_resource(struct pci_dev *, struct resource *, int); void pcibios_update_irq(struct pci_dev *, int irq); -void pcibios_fixup_pbus_ranges(struct pci_bus *, struct pbus_set_ranges_data *); /* Generic PCI functions used internally */ -- 2.53.0