From 2ef9c88bfaee6fbd7f9d5da32f9b93794be49185 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 16 Mar 2003 21:56:53 +0000 Subject: [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. --- include/linux/pci.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'include/linux') diff --git a/include/linux/pci.h b/include/linux/pci.h index 0bc50220c102..b01ae2e4df9c 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 */ -- cgit v1.2.3