diff options
Diffstat (limited to 'arch/powerpc/sysdev/indirect_pci.c')
-rw-r--r-- | arch/powerpc/sysdev/indirect_pci.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/arch/powerpc/sysdev/indirect_pci.c b/arch/powerpc/sysdev/indirect_pci.c index 1f6c570d66d4..692de9dbc680 100644 --- a/arch/powerpc/sysdev/indirect_pci.c +++ b/arch/powerpc/sysdev/indirect_pci.c | |||
@@ -20,31 +20,31 @@ | |||
20 | #include <asm/pci-bridge.h> | 20 | #include <asm/pci-bridge.h> |
21 | #include <asm/machdep.h> | 21 | #include <asm/machdep.h> |
22 | 22 | ||
23 | int indirect_read_config(struct pci_bus *bus, unsigned int devfn, | 23 | int __indirect_read_config(struct pci_controller *hose, |
24 | int offset, int len, u32 *val) | 24 | unsigned char bus_number, unsigned int devfn, |
25 | int offset, int len, u32 *val) | ||
25 | { | 26 | { |
26 | struct pci_controller *hose = pci_bus_to_host(bus); | ||
27 | volatile void __iomem *cfg_data; | 27 | volatile void __iomem *cfg_data; |
28 | u8 cfg_type = 0; | 28 | u8 cfg_type = 0; |
29 | u32 bus_no, reg; | 29 | u32 bus_no, reg; |
30 | 30 | ||
31 | if (hose->indirect_type & PPC_INDIRECT_TYPE_NO_PCIE_LINK) { | 31 | if (hose->indirect_type & PPC_INDIRECT_TYPE_NO_PCIE_LINK) { |
32 | if (bus->number != hose->first_busno) | 32 | if (bus_number != hose->first_busno) |
33 | return PCIBIOS_DEVICE_NOT_FOUND; | 33 | return PCIBIOS_DEVICE_NOT_FOUND; |
34 | if (devfn != 0) | 34 | if (devfn != 0) |
35 | return PCIBIOS_DEVICE_NOT_FOUND; | 35 | return PCIBIOS_DEVICE_NOT_FOUND; |
36 | } | 36 | } |
37 | 37 | ||
38 | if (ppc_md.pci_exclude_device) | 38 | if (ppc_md.pci_exclude_device) |
39 | if (ppc_md.pci_exclude_device(hose, bus->number, devfn)) | 39 | if (ppc_md.pci_exclude_device(hose, bus_number, devfn)) |
40 | return PCIBIOS_DEVICE_NOT_FOUND; | 40 | return PCIBIOS_DEVICE_NOT_FOUND; |
41 | 41 | ||
42 | if (hose->indirect_type & PPC_INDIRECT_TYPE_SET_CFG_TYPE) | 42 | if (hose->indirect_type & PPC_INDIRECT_TYPE_SET_CFG_TYPE) |
43 | if (bus->number != hose->first_busno) | 43 | if (bus_number != hose->first_busno) |
44 | cfg_type = 1; | 44 | cfg_type = 1; |
45 | 45 | ||
46 | bus_no = (bus->number == hose->first_busno) ? | 46 | bus_no = (bus_number == hose->first_busno) ? |
47 | hose->self_busno : bus->number; | 47 | hose->self_busno : bus_number; |
48 | 48 | ||
49 | if (hose->indirect_type & PPC_INDIRECT_TYPE_EXT_REG) | 49 | if (hose->indirect_type & PPC_INDIRECT_TYPE_EXT_REG) |
50 | reg = ((offset & 0xf00) << 16) | (offset & 0xfc); | 50 | reg = ((offset & 0xf00) << 16) | (offset & 0xfc); |
@@ -77,6 +77,15 @@ int indirect_read_config(struct pci_bus *bus, unsigned int devfn, | |||
77 | return PCIBIOS_SUCCESSFUL; | 77 | return PCIBIOS_SUCCESSFUL; |
78 | } | 78 | } |
79 | 79 | ||
80 | int indirect_read_config(struct pci_bus *bus, unsigned int devfn, | ||
81 | int offset, int len, u32 *val) | ||
82 | { | ||
83 | struct pci_controller *hose = pci_bus_to_host(bus); | ||
84 | |||
85 | return __indirect_read_config(hose, bus->number, devfn, offset, len, | ||
86 | val); | ||
87 | } | ||
88 | |||
80 | int indirect_write_config(struct pci_bus *bus, unsigned int devfn, | 89 | int indirect_write_config(struct pci_bus *bus, unsigned int devfn, |
81 | int offset, int len, u32 val) | 90 | int offset, int len, u32 val) |
82 | { | 91 | { |