]> git.hungrycats.org Git - linux/commitdiff
[PCI] pci-8: pci_resource_to_bus()
authorRussell King <rmk@flint.arm.linux.org.uk>
Sun, 16 Mar 2003 21:56:53 +0000 (21:56 +0000)
committerRussell King <rmk@flint.arm.linux.org.uk>
Sun, 16 Mar 2003 21:56:53 +0000 (21:56 +0000)
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.

30 files changed:
arch/alpha/kernel/pci.c
arch/arm/kernel/bios32.c
arch/i386/pci/common.c
arch/ia64/pci/pci.c
arch/mips/ddb5074/pci.c
arch/mips/ddb5476/pci.c
arch/mips64/sgi-ip27/ip27-pci.c
arch/mips64/sgi-ip32/ip32-pci.c
arch/parisc/kernel/pci.c
arch/ppc/kernel/pci.c
arch/ppc64/kernel/pci.c
arch/sh/kernel/pci-dc.c
arch/sh/kernel/pci-sh7751.c
arch/sh/kernel/pci_st40.c
arch/sh/kernel/pcibios.c
drivers/pci/setup-bus.c
include/asm-alpha/pci.h
include/asm-arm/pci.h
include/asm-generic/pci.h [new file with mode: 0644]
include/asm-i386/pci.h
include/asm-ia64/pci.h
include/asm-mips/pci.h
include/asm-mips64/pci.h
include/asm-parisc/pci.h
include/asm-ppc/pci.h
include/asm-ppc64/pci.h
include/asm-sh/pci.h
include/asm-sparc64/pci.h
include/asm-x86_64/pci.h
include/linux/pci.h

index 81e0795686881bca10da3de94bd91dd2a49ec200..10942ee451059dee370bd909b38b0363474c676d 100644 (file)
@@ -12,7 +12,7 @@
  * Nov 2000, Ivan Kokshaysky <ink@jurassic.park.msu.ru>
  *          PCI-PCI bridges cleanup
  */
-
+#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/pci.h>
 #include <linux/init.h>
@@ -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)
 {
index 8df79c2cdee37e3baa55a74297bba1cebfb35394..090a29fee3e7a4cb243c5e137d3461c129c42866 100644 (file)
@@ -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:
  *
index 6d65faac8ec769f80e129ace2b8512894f70e68b..29077051683374b48e83b123fb1ba5e01e81cf39 100644 (file)
@@ -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.
index 84e49ffc52b143535a4680fd4de99df9ea6312cd..03fcd62072f5899ccf8a229bccb9573403f59a16 100644 (file)
@@ -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)
 {
index b97df65f4f3f6834778dfede0829e3578a31ecc9..6baf4bea33cf9296530c14d5a32b044dcdcb74e1 100644 (file)
@@ -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;
index 473aa79e4d65ea1c1dd86223d71068dba42e53bf..08f4a867c03f9b0fc6a5df816d61733b49f77b19 100644 (file)
@@ -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)
 {
index 5b26dca1771e078c8f13fc72afca3d89ed3fce12..328fe39a12a18d3623258765b8f5fb164a85ab6a 100644 (file)
@@ -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)
 {
index 11fd67105e6133c5df0c5cbb4224dd9f59caae2a..2aa4aeccdd742139dc6f16c42a2b3b032a850edf 100644 (file)
@@ -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
index a457f1d67c2593917be004996e9f07c8531962d7..67bf315c62e12f31aaebb200b62a55edf135d6e3 100644 (file)
@@ -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))
 
 
index 71effba667d2e74909014a71163d2bce383d3201..d35111a4bf3800f11042f9b81b8a09ca97998767 100644 (file)
@@ -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)
 {
index fed8f78fd6bb6e81e22006e067fe09dc1e0b4f5f..7edf23857c245d9532792b960aee7d3b707e7ac1 100644 (file)
@@ -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)
index 34ec18b0925373635f0b2ce17be5c75131b699f3..ed3bcf26f8102375587ae23b80dcd2122d1e7345 100644 (file)
@@ -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;
index 9db302503b0afa5a091d4da1e66ff87eb712c071..19a8291aa359bb2297689f0bdcbc8ae941f092af 100644 (file)
@@ -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.
index ccef05c9e87ccc6f6b90b7f8417d3065d23706b1..b1e8e2b1c1f870edadf972ac181d754213d66b13 100644 (file)
@@ -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;
index 6f4d7b84c32df131aa65e4a1ed1a5a7a612c06c4..6b785b914ab4831de0140b6d731f3fd5cd3173ec 100644 (file)
@@ -19,7 +19,6 @@
  *     pcibios_fixup_bus()
  *     pcibios_init()
  *     pcibios_setup()
- *     pcibios_fixup_pbus_ranges()
  */
 
 #include <linux/kernel.h>
index b796e2270a65354db2c64964e254f0e5b481ceff..0eab0b57e10a82fd6041b1dd13e98b87d8134db1 100644 (file)
@@ -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, &region, 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, &region, 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, &region, 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;
index 3f88b46f8dfedcc1dd8d7a9e8ac0ad8578337fa7..1e82bf33cb8426a9d88c05081f9a9f2c19bc9648 100644 (file)
@@ -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.  */
index 193c96e1609f5719893ee39211a00b48cae8ca94..72843a2888b538514fa9b706c630c40be0e70546 100644 (file)
@@ -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 (file)
index 0000000..df757d2
--- /dev/null
@@ -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
index d41feaba85ef76f0ee0a6bd7d0d1315d2bae8891..e0e0442260dffd3dfb0541979c53345ecb23ba96 100644 (file)
@@ -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 <asm-generic/pci-dma-compat.h>
 
+/* generic pci stuff */
+#include <asm-generic/pci.h>
+
 #endif /* __i386_PCI_H */
index 62a7d5a544d57bbd67fb9bf1ac1d7a97ab498694..69a58612d87b602790c0e5765fb4b73d9f3732d2 100644 (file)
@@ -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 <asm-generic/pci.h>
+
 #endif /* _ASM_IA64_PCI_H */
index 84c9bd2b9bfb530e6d7321192649d0603bd96cc8..98b248e8cd29f4739b5d249ad8b836bb68e512c6 100644 (file)
@@ -252,4 +252,7 @@ extern inline int pci_dma_supported(struct pci_dev *hwdev, u64 mask)
 
 #endif /* __KERNEL__ */
 
+/* generic pci stuff */
+#include <asm-generic/pci.h>
+
 #endif /* _ASM_PCI_H */
index a7cc388c58243b53dd60a9c731120287584befad..730e040754803a5612d5d2f64d35aaa4715ccbfb 100644 (file)
@@ -272,4 +272,8 @@ static inline int pci_dma_supported(struct pci_dev *hwdev, u64 mask)
 
 #endif /* __KERNEL__ */
 
+/* generic pci stuff */
+#include <asm-generic/pci.h>
+
 #endif /* _ASM_PCI_H */
+
index 2dbd703983e71fba27d3784ff4cb2a6077420d58..d44ad70d0e35df5705a357d93c1a21418b66d0be 100644 (file)
@@ -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 <asm-generic/pci-dma-compat.h>
 
+extern void
+pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
+                        struct resource *res);
+
 #endif /* __ASM_PARISC_PCI_H */
index 92118321f0a59cc96f12bc63804e98b63d9eff62..c178b8e5d4b3f45ac8af619ff7df523655a06a93 100644 (file)
@@ -273,4 +273,7 @@ int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
 
 #endif /* __KERNEL__ */
 
+/* generic pci stuff */
+#include <asm-generic/pci.h>
+
 #endif /* __PPC_PCI_H */
index 0b715895f043772b560a0775f86abee02c1d4582..2cab41c41cca39e5c6be17b642715e55e8d5e3ab 100644 (file)
@@ -124,4 +124,7 @@ int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
        
 #endif /* __KERNEL__ */
 
+/* generic pci stuff */
+#include <asm-generic/pci.h>
+
 #endif /* __PPC64_PCI_H */
index f9690c521d1937278470de274189b519fc9d547f..60fffd091ad62cb64167095d11b54bcff124c048 100644 (file)
@@ -240,6 +240,8 @@ static inline int pci_dma_supported(struct pci_dev *hwdev, u64 mask)
 
 #endif /* __KERNEL__ */
 
+/* generic pci stuff */
+#include <asm-generic/pci.h>
 
 #endif /* __ASM_SH_PCI_H */
 
index 53a010006c418b5a3fb6b06fe5c644b0009334bc..6b97445a221a907cd3d59a6957a6fa93bffa0297 100644 (file)
@@ -207,4 +207,7 @@ extern int pcibios_prep_mwi(struct pci_dev *dev);
 
 #endif /* __KERNEL__ */
 
+/* generic pci stuff */
+#include <asm-generic/pci.h>
+
 #endif /* __SPARC64_PCI_H */
index 024a9c04568179fe599faeb3da1c2188c2a8182a..74594c63e38cbfa51f7ec63c7f8d07fac0232576 100644 (file)
@@ -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 <asm-generic/pci.h>
+
 #endif /* __x8664_PCI_H */
index 0bc50220c1026ab8e16a0320ce9fe98b571c1bac..b01ae2e4df9cbd50ac5c4659988445c2c9b3ae2d 100644 (file)
@@ -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 */