aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2007-06-22 01:23:57 -0400
committerKumar Gala <galak@kernel.crashing.org>2007-06-29 02:57:22 -0400
commit7d52c7b0cd46f42ae2c9df37f1a385d9aaf95842 (patch)
tree32138e13cbc3eb154db37b202044870419b56655 /arch/powerpc/sysdev
parent0e302a704420afe40808fbd4ba149624c4350f31 (diff)
[POWERPC] Pass the pci_controller into pci_exclude_device
There are times that we need to know which controller we are on to decide how to exclude devices properly. We now pass the pci_controller that we are going to use down to the pci_exclude_device function. This will greatly simplify being able to exclude the PHBs in multiple controller setups. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/sysdev')
-rw-r--r--arch/powerpc/sysdev/Makefile2
-rw-r--r--arch/powerpc/sysdev/fsl_pcie.c4
-rw-r--r--arch/powerpc/sysdev/indirect_pci.c8
-rw-r--r--arch/powerpc/sysdev/tsi108_pci.c6
4 files changed, 11 insertions, 9 deletions
diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile
index 31da3b3dc993..337b56a73247 100644
--- a/arch/powerpc/sysdev/Makefile
+++ b/arch/powerpc/sysdev/Makefile
@@ -5,7 +5,6 @@ endif
5mpic-msi-obj-$(CONFIG_PCI_MSI) += mpic_msi.o mpic_u3msi.o 5mpic-msi-obj-$(CONFIG_PCI_MSI) += mpic_msi.o mpic_u3msi.o
6obj-$(CONFIG_MPIC) += mpic.o $(mpic-msi-obj-y) 6obj-$(CONFIG_MPIC) += mpic.o $(mpic-msi-obj-y)
7 7
8obj-$(CONFIG_PPC_INDIRECT_PCI) += indirect_pci.o
9obj-$(CONFIG_PPC_MPC106) += grackle.o 8obj-$(CONFIG_PPC_MPC106) += grackle.o
10obj-$(CONFIG_PPC_DCR) += dcr.o 9obj-$(CONFIG_PPC_DCR) += dcr.o
11obj-$(CONFIG_PPC_DCR_NATIVE) += dcr-low.o 10obj-$(CONFIG_PPC_DCR_NATIVE) += dcr-low.o
@@ -25,6 +24,7 @@ obj-$(CONFIG_PM) += timer.o
25endif 24endif
26 25
27ifeq ($(CONFIG_PPC_MERGE),y) 26ifeq ($(CONFIG_PPC_MERGE),y)
27obj-$(CONFIG_PPC_INDIRECT_PCI) += indirect_pci.o
28obj-$(CONFIG_PPC_I8259) += i8259.o 28obj-$(CONFIG_PPC_I8259) += i8259.o
29obj-$(CONFIG_PPC_83xx) += ipic.o 29obj-$(CONFIG_PPC_83xx) += ipic.o
30obj-$(CONFIG_4xx) += uic.o 30obj-$(CONFIG_4xx) += uic.o
diff --git a/arch/powerpc/sysdev/fsl_pcie.c b/arch/powerpc/sysdev/fsl_pcie.c
index 041c07e8b665..6bbd7f84b4e2 100644
--- a/arch/powerpc/sysdev/fsl_pcie.c
+++ b/arch/powerpc/sysdev/fsl_pcie.c
@@ -39,7 +39,7 @@ indirect_read_config_pcie(struct pci_bus *bus, unsigned int devfn, int offset,
39 u32 temp; 39 u32 temp;
40 40
41 if (ppc_md.pci_exclude_device) 41 if (ppc_md.pci_exclude_device)
42 if (ppc_md.pci_exclude_device(bus->number, devfn)) 42 if (ppc_md.pci_exclude_device(hose, bus->number, devfn))
43 return PCIBIOS_DEVICE_NOT_FOUND; 43 return PCIBIOS_DEVICE_NOT_FOUND;
44 44
45 /* Possible artifact of CDCpp50937 needs further investigation */ 45 /* Possible artifact of CDCpp50937 needs further investigation */
@@ -90,7 +90,7 @@ indirect_write_config_pcie(struct pci_bus *bus, unsigned int devfn, int offset,
90 u32 temp; 90 u32 temp;
91 91
92 if (ppc_md.pci_exclude_device) 92 if (ppc_md.pci_exclude_device)
93 if (ppc_md.pci_exclude_device(bus->number, devfn)) 93 if (ppc_md.pci_exclude_device(hose, bus->number, devfn))
94 return PCIBIOS_DEVICE_NOT_FOUND; 94 return PCIBIOS_DEVICE_NOT_FOUND;
95 95
96 /* Possible artifact of CDCpp50937 needs further investigation */ 96 /* Possible artifact of CDCpp50937 needs further investigation */
diff --git a/arch/powerpc/sysdev/indirect_pci.c b/arch/powerpc/sysdev/indirect_pci.c
index e71488469704..3dedf8f5bfb4 100644
--- a/arch/powerpc/sysdev/indirect_pci.c
+++ b/arch/powerpc/sysdev/indirect_pci.c
@@ -35,14 +35,14 @@ indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
35 u8 cfg_type = 0; 35 u8 cfg_type = 0;
36 36
37 if (ppc_md.pci_exclude_device) 37 if (ppc_md.pci_exclude_device)
38 if (ppc_md.pci_exclude_device(bus->number, devfn)) 38 if (ppc_md.pci_exclude_device(hose, bus->number, devfn))
39 return PCIBIOS_DEVICE_NOT_FOUND; 39 return PCIBIOS_DEVICE_NOT_FOUND;
40 40
41 if (hose->set_cfg_type) 41 if (hose->set_cfg_type)
42 if (bus->number != hose->first_busno) 42 if (bus->number != hose->first_busno)
43 cfg_type = 1; 43 cfg_type = 1;
44 44
45 PCI_CFG_OUT(hose->cfg_addr, 45 PCI_CFG_OUT(hose->cfg_addr,
46 (0x80000000 | ((bus->number - hose->bus_offset) << 16) 46 (0x80000000 | ((bus->number - hose->bus_offset) << 16)
47 | (devfn << 8) | ((offset & 0xfc) | cfg_type))); 47 | (devfn << 8) | ((offset & 0xfc) | cfg_type)));
48 48
@@ -74,14 +74,14 @@ indirect_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
74 u8 cfg_type = 0; 74 u8 cfg_type = 0;
75 75
76 if (ppc_md.pci_exclude_device) 76 if (ppc_md.pci_exclude_device)
77 if (ppc_md.pci_exclude_device(bus->number, devfn)) 77 if (ppc_md.pci_exclude_device(hose, bus->number, devfn))
78 return PCIBIOS_DEVICE_NOT_FOUND; 78 return PCIBIOS_DEVICE_NOT_FOUND;
79 79
80 if (hose->set_cfg_type) 80 if (hose->set_cfg_type)
81 if (bus->number != hose->first_busno) 81 if (bus->number != hose->first_busno)
82 cfg_type = 1; 82 cfg_type = 1;
83 83
84 PCI_CFG_OUT(hose->cfg_addr, 84 PCI_CFG_OUT(hose->cfg_addr,
85 (0x80000000 | ((bus->number - hose->bus_offset) << 16) 85 (0x80000000 | ((bus->number - hose->bus_offset) << 16)
86 | (devfn << 8) | ((offset & 0xfc) | cfg_type))); 86 | (devfn << 8) | ((offset & 0xfc) | cfg_type)));
87 87
diff --git a/arch/powerpc/sysdev/tsi108_pci.c b/arch/powerpc/sysdev/tsi108_pci.c
index 33177b60c7ed..298e2dd34e89 100644
--- a/arch/powerpc/sysdev/tsi108_pci.c
+++ b/arch/powerpc/sysdev/tsi108_pci.c
@@ -64,9 +64,10 @@ tsi108_direct_write_config(struct pci_bus *bus, unsigned int devfunc,
64 int offset, int len, u32 val) 64 int offset, int len, u32 val)
65{ 65{
66 volatile unsigned char *cfg_addr; 66 volatile unsigned char *cfg_addr;
67 struct pci_controller *hose = bus->sysdata;
67 68
68 if (ppc_md.pci_exclude_device) 69 if (ppc_md.pci_exclude_device)
69 if (ppc_md.pci_exclude_device(bus->number, devfunc)) 70 if (ppc_md.pci_exclude_device(hose, bus->number, devfunc))
70 return PCIBIOS_DEVICE_NOT_FOUND; 71 return PCIBIOS_DEVICE_NOT_FOUND;
71 72
72 cfg_addr = (unsigned char *)(tsi_mk_config_addr(bus->number, 73 cfg_addr = (unsigned char *)(tsi_mk_config_addr(bus->number,
@@ -149,10 +150,11 @@ tsi108_direct_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
149 int len, u32 * val) 150 int len, u32 * val)
150{ 151{
151 volatile unsigned char *cfg_addr; 152 volatile unsigned char *cfg_addr;
153 struct pci_controller *hose = bus->sysdata;
152 u32 temp; 154 u32 temp;
153 155
154 if (ppc_md.pci_exclude_device) 156 if (ppc_md.pci_exclude_device)
155 if (ppc_md.pci_exclude_device(bus->number, devfn)) 157 if (ppc_md.pci_exclude_device(hose, bus->number, devfn))
156 return PCIBIOS_DEVICE_NOT_FOUND; 158 return PCIBIOS_DEVICE_NOT_FOUND;
157 159
158 cfg_addr = (unsigned char *)(tsi_mk_config_addr(bus->number, 160 cfg_addr = (unsigned char *)(tsi_mk_config_addr(bus->number,