#include <asm/system.h>
#include <asm/mach/pci.h>
#include <asm/hardware.h>
+#include <asm/sizes.h>
/*
return 0xffffffff;
}
-static int ixp4xx_pci_read_config(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value)
+static int read_config(u8 bus_num, u16 devfn, int where, int size, u32 *value)
{
u32 n, byte_enables, addr, data;
- u8 bus_num = bus->number;
pr_debug("read_config from %d size %d dev %d:%d:%d\n", where, size,
bus_num, PCI_SLOT(devfn), PCI_FUNC(devfn));
return PCIBIOS_SUCCESSFUL;
}
-static int ixp4xx_pci_write_config(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value)
+static int write_config(u8 bus_num, u16 devfn, int where, int size, u32 value)
{
u32 n, byte_enables, addr, data;
- u8 bus_num = bus->number;
pr_debug("write_config_byte %#x to %d size %d dev %d:%d:%d\n", value, where,
size, bus_num, PCI_SLOT(devfn), PCI_FUNC(devfn));
return PCIBIOS_SUCCESSFUL;
}
+/*
+ * Generalized PCI config access functions.
+ */
+static int ixp4xx_read_config(struct pci_bus *bus, unsigned int devfn,
+ int where, int size, u32 *value)
+{
+ if (bus->number && !PCI_SLOT(devfn))
+ return local_read_config(where, size, value);
+ return read_config(bus->number, devfn, where, size, value);
+}
+
+static int ixp4xx_write_config(struct pci_bus *bus, unsigned int devfn,
+ int where, int size, u32 value)
+{
+ if (bus->number && !PCI_SLOT(devfn))
+ return local_write_config(where, size, value);
+ return write_config(bus->number, devfn, where, size, value);
+}
+
struct pci_ops ixp4xx_ops = {
- .read = ixp4xx_pci_read_config,
- .write = ixp4xx_pci_write_config,
+ .read = ixp4xx_read_config,
+ .write = ixp4xx_write_config,
};
+
/*
* PCI abort handler
*/