diff options
author | Kumar Gala <galak@kernel.crashing.org> | 2007-10-04 01:28:43 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2007-10-08 09:38:40 -0400 |
commit | c9438affcb7ac0dda4c6c6961637fb272f7c32d4 (patch) | |
tree | 7a7118672e012239d820623e86e3a5e23cb034d6 /arch/powerpc/platforms/85xx | |
parent | 2fce1225af6f2d3bb9ffb4e6253400db61278594 (diff) |
[POWERPC] Use for_each_ matching routinues for pci PHBs
On the Freescale embedded (83xx, 85xx, 86xx) and a few of the discrete
bridges (mpc10x, tsi108) use the new for_each_compatible_node() or
for_each_node_by_type() to provide more exact matching when looking for
PHBs in the device tree.
With the previous code it was possible to match on pci bridges since
we were only matching on device_type.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/85xx')
-rw-r--r-- | arch/powerpc/platforms/85xx/mpc85xx_ads.c | 3 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/mpc85xx_cds.c | 18 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/mpc85xx_ds.c | 18 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/mpc85xx_mds.c | 14 |
4 files changed, 35 insertions, 18 deletions
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c index c22bc1c4f591..acb1ef932240 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c | |||
@@ -204,8 +204,9 @@ static void __init mpc85xx_ads_setup_arch(void) | |||
204 | #endif | 204 | #endif |
205 | 205 | ||
206 | #ifdef CONFIG_PCI | 206 | #ifdef CONFIG_PCI |
207 | for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) | 207 | for_each_compatible_node(np, "pci", "fsl,mpc8540-pci") |
208 | fsl_add_bridge(np, 1); | 208 | fsl_add_bridge(np, 1); |
209 | |||
209 | ppc_md.pci_exclude_device = mpc85xx_exclude_device; | 210 | ppc_md.pci_exclude_device = mpc85xx_exclude_device; |
210 | #endif | 211 | #endif |
211 | } | 212 | } |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c index 665e8df05dc5..abc85b8d9f8a 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c | |||
@@ -283,14 +283,18 @@ static void __init mpc85xx_cds_setup_arch(void) | |||
283 | } | 283 | } |
284 | 284 | ||
285 | #ifdef CONFIG_PCI | 285 | #ifdef CONFIG_PCI |
286 | for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) { | 286 | for_each_node_by_type(np, "pci") { |
287 | struct resource rsrc; | 287 | if (of_device_is_compatible(np, "fsl,mpc8540-pci") || |
288 | of_address_to_resource(np, 0, &rsrc); | 288 | of_device_is_compatible(np, "fsl,mpc8548-pcie")) { |
289 | if ((rsrc.start & 0xfffff) == 0x8000) | 289 | struct resource rsrc; |
290 | fsl_add_bridge(np, 1); | 290 | of_address_to_resource(np, 0, &rsrc); |
291 | else | 291 | if ((rsrc.start & 0xfffff) == 0x8000) |
292 | fsl_add_bridge(np, 0); | 292 | fsl_add_bridge(np, 1); |
293 | else | ||
294 | fsl_add_bridge(np, 0); | ||
295 | } | ||
293 | } | 296 | } |
297 | |||
294 | ppc_md.pci_irq_fixup = mpc85xx_cds_pci_irq_fixup; | 298 | ppc_md.pci_irq_fixup = mpc85xx_cds_pci_irq_fixup; |
295 | ppc_md.pci_exclude_device = mpc85xx_exclude_device; | 299 | ppc_md.pci_exclude_device = mpc85xx_exclude_device; |
296 | #endif | 300 | #endif |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c index 4d449022ac9b..d60bb2beeb55 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c | |||
@@ -149,14 +149,18 @@ static void __init mpc85xx_ds_setup_arch(void) | |||
149 | ppc_md.progress("mpc85xx_ds_setup_arch()", 0); | 149 | ppc_md.progress("mpc85xx_ds_setup_arch()", 0); |
150 | 150 | ||
151 | #ifdef CONFIG_PCI | 151 | #ifdef CONFIG_PCI |
152 | for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) { | 152 | for_each_node_by_type(np, "pci") { |
153 | struct resource rsrc; | 153 | if (of_device_is_compatible(np, "fsl,mpc8540-pci") || |
154 | of_address_to_resource(np, 0, &rsrc); | 154 | of_device_is_compatible(np, "fsl,mpc8548-pcie")) { |
155 | if ((rsrc.start & 0xfffff) == primary_phb_addr) | 155 | struct resource rsrc; |
156 | fsl_add_bridge(np, 1); | 156 | of_address_to_resource(np, 0, &rsrc); |
157 | else | 157 | if ((rsrc.start & 0xfffff) == primary_phb_addr) |
158 | fsl_add_bridge(np, 0); | 158 | fsl_add_bridge(np, 1); |
159 | else | ||
160 | fsl_add_bridge(np, 0); | ||
161 | } | ||
159 | } | 162 | } |
163 | |||
160 | uses_fsl_uli_m1575 = 1; | 164 | uses_fsl_uli_m1575 = 1; |
161 | ppc_md.pci_exclude_device = mpc85xx_exclude_device; | 165 | ppc_md.pci_exclude_device = mpc85xx_exclude_device; |
162 | #endif | 166 | #endif |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c index c379286c3730..f8b6b08af848 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c | |||
@@ -83,9 +83,17 @@ static void __init mpc85xx_mds_setup_arch(void) | |||
83 | } | 83 | } |
84 | 84 | ||
85 | #ifdef CONFIG_PCI | 85 | #ifdef CONFIG_PCI |
86 | for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) | 86 | for_each_node_by_type(np, "pci") { |
87 | fsl_add_bridge(np, 1); | 87 | if (of_device_is_compatible(np, "fsl,mpc8540-pci") || |
88 | of_node_put(np); | 88 | of_device_is_compatible(np, "fsl,mpc8548-pcie")) { |
89 | struct resource rsrc; | ||
90 | of_address_to_resource(np, 0, &rsrc); | ||
91 | if ((rsrc.start & 0xfffff) == 0x8000) | ||
92 | fsl_add_bridge(np, 1); | ||
93 | else | ||
94 | fsl_add_bridge(np, 0); | ||
95 | } | ||
96 | } | ||
89 | #endif | 97 | #endif |
90 | 98 | ||
91 | #ifdef CONFIG_QUICC_ENGINE | 99 | #ifdef CONFIG_QUICC_ENGINE |