diff options
author | Daniel Axtens <dja@axtens.net> | 2015-03-31 16:00:44 +1100 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2015-04-11 20:49:12 +1000 |
commit | ff9df8c87d6807e90c5c3b0e1fd1649d09fd3bcd (patch) | |
tree | 549479a5e515c2741656e9251f8fbb2568438512 /arch/powerpc/include | |
parent | b122c95494374ab848f8d9f41d98644c2c318ecc (diff) | |
download | linux-ff9df8c87d6807e90c5c3b0e1fd1649d09fd3bcd.tar.bz2 |
powerpc: Create pci_controller_ops.probe_mode and shim
Add pci_controller_ops.probe_mode, shadowing ppc_md.pci_probe_mode.
Add a shim, and changes the callsites to use the shim.
We also need to move the probe mode defines to pci-bridge.h from pci.h.
They are required by the shim in order to return a sensible default.
Previously, the were defined in pci.h, but pci.h includes pci-bridge.h
before the relevant #defines. This means the definitions are absent
if pci.h is included before pci-bridge.h. This occurs in some drivers.
So, move the definitons now, and move them back when we remove the shim.
Anything that wants the defines would have had to include pci.h, and
since pci.h includes pci-bridge.h, nothing will lose access to the
defines.
Signed-off-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r-- | arch/powerpc/include/asm/pci-bridge.h | 18 | ||||
-rw-r--r-- | arch/powerpc/include/asm/pci.h | 5 |
2 files changed, 18 insertions, 5 deletions
diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h index b9732fcb0f5f..278f48978bad 100644 --- a/arch/powerpc/include/asm/pci-bridge.h +++ b/arch/powerpc/include/asm/pci-bridge.h @@ -12,6 +12,11 @@ #include <linux/ioport.h> #include <asm-generic/pci-bridge.h> +/* Return values for pci_controller_ops.probe_mode function */ +#define PCI_PROBE_NONE -1 /* Don't look at this bus at all */ +#define PCI_PROBE_NORMAL 0 /* Do normal PCI probing */ +#define PCI_PROBE_DEVTREE 1 /* Instantiate from device tree */ + struct device_node; /* @@ -20,6 +25,8 @@ struct device_node; struct pci_controller_ops { void (*dma_dev_setup)(struct pci_dev *dev); void (*dma_bus_setup)(struct pci_bus *bus); + + int (*probe_mode)(struct pci_bus *); }; /* @@ -292,5 +299,16 @@ static inline void pci_dma_bus_setup(struct pci_bus *bus) ppc_md.pci_dma_bus_setup(bus); } +static inline int pci_probe_mode(struct pci_bus *bus) +{ + struct pci_controller *phb = pci_bus_to_host(bus); + + if (phb->controller_ops.probe_mode) + return phb->controller_ops.probe_mode(bus); + if (ppc_md.pci_probe_mode) + return ppc_md.pci_probe_mode(bus); + return PCI_PROBE_NORMAL; +} + #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_PCI_BRIDGE_H */ diff --git a/arch/powerpc/include/asm/pci.h b/arch/powerpc/include/asm/pci.h index 1b0739bc14b5..8745067ac702 100644 --- a/arch/powerpc/include/asm/pci.h +++ b/arch/powerpc/include/asm/pci.h @@ -22,11 +22,6 @@ #include <asm-generic/pci-dma-compat.h> -/* Return values for ppc_md.pci_probe_mode function */ -#define PCI_PROBE_NONE -1 /* Don't look at this bus at all */ -#define PCI_PROBE_NORMAL 0 /* Do normal PCI probing */ -#define PCI_PROBE_DEVTREE 1 /* Instantiate from device tree */ - #define PCIBIOS_MIN_IO 0x1000 #define PCIBIOS_MIN_MEM 0x10000000 |