aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>2011-11-17 09:48:48 -0500
committerKumar Gala <galak@kernel.crashing.org>2011-11-24 03:01:40 -0500
commitbede480d45f7257fa648b4c32a0549cfcca59b90 (patch)
tree54153884a9cf0d53f3b1ea556f39f6f8b97df92f
parent7669d58c661b51f3c2b6bf0e93f230f0f7c2f597 (diff)
powerpc/83xx: merge PCI bridge additions
Nearly all mpc83xx-based boards have a common piece of code - one that loops over all pci/pcie bridges and registers them. Merge that code into a special function common to all boards. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
-rw-r--r--arch/powerpc/platforms/83xx/km83xx.c7
-rw-r--r--arch/powerpc/platforms/83xx/misc.c14
-rw-r--r--arch/powerpc/platforms/83xx/mpc831x_rdb.c11
-rw-r--r--arch/powerpc/platforms/83xx/mpc832x_mds.c5
-rw-r--r--arch/powerpc/platforms/83xx/mpc832x_rdb.c7
-rw-r--r--arch/powerpc/platforms/83xx/mpc834x_itx.c9
-rw-r--r--arch/powerpc/platforms/83xx/mpc834x_mds.c9
-rw-r--r--arch/powerpc/platforms/83xx/mpc836x_mds.c5
-rw-r--r--arch/powerpc/platforms/83xx/mpc836x_rdk.c9
-rw-r--r--arch/powerpc/platforms/83xx/mpc837x_mds.c11
-rw-r--r--arch/powerpc/platforms/83xx/mpc837x_rdb.c11
-rw-r--r--arch/powerpc/platforms/83xx/mpc83xx.h6
-rw-r--r--arch/powerpc/platforms/83xx/sbc834x.c10
13 files changed, 34 insertions, 80 deletions
diff --git a/arch/powerpc/platforms/83xx/km83xx.c b/arch/powerpc/platforms/83xx/km83xx.c
index 7ef635495170..65eb792a0d00 100644
--- a/arch/powerpc/platforms/83xx/km83xx.c
+++ b/arch/powerpc/platforms/83xx/km83xx.c
@@ -51,15 +51,14 @@
51 */ 51 */
52static void __init mpc83xx_km_setup_arch(void) 52static void __init mpc83xx_km_setup_arch(void)
53{ 53{
54#ifdef CONFIG_QUICC_ENGINE
54 struct device_node *np; 55 struct device_node *np;
56#endif
55 57
56 if (ppc_md.progress) 58 if (ppc_md.progress)
57 ppc_md.progress("kmpbec83xx_setup_arch()", 0); 59 ppc_md.progress("kmpbec83xx_setup_arch()", 0);
58 60
59#ifdef CONFIG_PCI 61 mpc83xx_setup_pci();
60 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
61 mpc83xx_add_bridge(np);
62#endif
63 62
64#ifdef CONFIG_QUICC_ENGINE 63#ifdef CONFIG_QUICC_ENGINE
65 qe_reset(); 64 qe_reset();
diff --git a/arch/powerpc/platforms/83xx/misc.c b/arch/powerpc/platforms/83xx/misc.c
index ee4de779ac11..125336f750c6 100644
--- a/arch/powerpc/platforms/83xx/misc.c
+++ b/arch/powerpc/platforms/83xx/misc.c
@@ -12,12 +12,14 @@
12#include <linux/stddef.h> 12#include <linux/stddef.h>
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/of_platform.h> 14#include <linux/of_platform.h>
15#include <linux/pci.h>
15 16
16#include <asm/io.h> 17#include <asm/io.h>
17#include <asm/hw_irq.h> 18#include <asm/hw_irq.h>
18#include <asm/ipic.h> 19#include <asm/ipic.h>
19#include <asm/qe_ic.h> 20#include <asm/qe_ic.h>
20#include <sysdev/fsl_soc.h> 21#include <sysdev/fsl_soc.h>
22#include <sysdev/fsl_pci.h>
21 23
22#include "mpc83xx.h" 24#include "mpc83xx.h"
23 25
@@ -128,3 +130,15 @@ int __init mpc83xx_declare_of_platform_devices(void)
128 of_platform_bus_probe(NULL, of_bus_ids, NULL); 130 of_platform_bus_probe(NULL, of_bus_ids, NULL);
129 return 0; 131 return 0;
130} 132}
133
134#ifdef CONFIG_PCI
135void __init mpc83xx_setup_pci(void)
136{
137 struct device_node *np;
138
139 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
140 mpc83xx_add_bridge(np);
141 for_each_compatible_node(np, "pci", "fsl,mpc8314-pcie")
142 mpc83xx_add_bridge(np);
143}
144#endif
diff --git a/arch/powerpc/platforms/83xx/mpc831x_rdb.c b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
index ce87406b0534..fa25977c52de 100644
--- a/arch/powerpc/platforms/83xx/mpc831x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
@@ -28,19 +28,10 @@
28 */ 28 */
29static void __init mpc831x_rdb_setup_arch(void) 29static void __init mpc831x_rdb_setup_arch(void)
30{ 30{
31#ifdef CONFIG_PCI
32 struct device_node *np;
33#endif
34
35 if (ppc_md.progress) 31 if (ppc_md.progress)
36 ppc_md.progress("mpc831x_rdb_setup_arch()", 0); 32 ppc_md.progress("mpc831x_rdb_setup_arch()", 0);
37 33
38#ifdef CONFIG_PCI 34 mpc83xx_setup_pci();
39 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
40 mpc83xx_add_bridge(np);
41 for_each_compatible_node(np, "pci", "fsl,mpc8314-pcie")
42 mpc83xx_add_bridge(np);
43#endif
44 mpc831x_usb_cfg(); 35 mpc831x_usb_cfg();
45} 36}
46 37
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c
index df80eccbbc6d..e36bc611dd6e 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
@@ -72,10 +72,7 @@ static void __init mpc832x_sys_setup_arch(void)
72 of_node_put(np); 72 of_node_put(np);
73 } 73 }
74 74
75#ifdef CONFIG_PCI 75 mpc83xx_setup_pci();
76 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
77 mpc83xx_add_bridge(np);
78#endif
79 76
80#ifdef CONFIG_QUICC_ENGINE 77#ifdef CONFIG_QUICC_ENGINE
81 qe_reset(); 78 qe_reset();
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
index e4c7c6424a8a..eff5baabc3fb 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -193,17 +193,14 @@ machine_device_initcall(mpc832x_rdb, mpc832x_spi_init);
193 */ 193 */
194static void __init mpc832x_rdb_setup_arch(void) 194static void __init mpc832x_rdb_setup_arch(void)
195{ 195{
196#if defined(CONFIG_PCI) || defined(CONFIG_QUICC_ENGINE) 196#if defined(CONFIG_QUICC_ENGINE)
197 struct device_node *np; 197 struct device_node *np;
198#endif 198#endif
199 199
200 if (ppc_md.progress) 200 if (ppc_md.progress)
201 ppc_md.progress("mpc832x_rdb_setup_arch()", 0); 201 ppc_md.progress("mpc832x_rdb_setup_arch()", 0);
202 202
203#ifdef CONFIG_PCI 203 mpc83xx_setup_pci();
204 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
205 mpc83xx_add_bridge(np);
206#endif
207 204
208#ifdef CONFIG_QUICC_ENGINE 205#ifdef CONFIG_QUICC_ENGINE
209 qe_reset(); 206 qe_reset();
diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.c b/arch/powerpc/platforms/83xx/mpc834x_itx.c
index 87868c1c52f0..39849dd1b5bb 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_itx.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c
@@ -58,17 +58,10 @@ machine_device_initcall(mpc834x_itx, mpc834x_itx_declare_of_platform_devices);
58 */ 58 */
59static void __init mpc834x_itx_setup_arch(void) 59static void __init mpc834x_itx_setup_arch(void)
60{ 60{
61#ifdef CONFIG_PCI
62 struct device_node *np;
63#endif
64
65 if (ppc_md.progress) 61 if (ppc_md.progress)
66 ppc_md.progress("mpc834x_itx_setup_arch()", 0); 62 ppc_md.progress("mpc834x_itx_setup_arch()", 0);
67 63
68#ifdef CONFIG_PCI 64 mpc83xx_setup_pci();
69 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
70 mpc83xx_add_bridge(np);
71#endif
72 65
73 mpc834x_usb_cfg(); 66 mpc834x_usb_cfg();
74} 67}
diff --git a/arch/powerpc/platforms/83xx/mpc834x_mds.c b/arch/powerpc/platforms/83xx/mpc834x_mds.c
index 4be95550d0c3..5828d8e97c37 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_mds.c
@@ -77,17 +77,10 @@ static int mpc834xemds_usb_cfg(void)
77 */ 77 */
78static void __init mpc834x_mds_setup_arch(void) 78static void __init mpc834x_mds_setup_arch(void)
79{ 79{
80#ifdef CONFIG_PCI
81 struct device_node *np;
82#endif
83
84 if (ppc_md.progress) 80 if (ppc_md.progress)
85 ppc_md.progress("mpc834x_mds_setup_arch()", 0); 81 ppc_md.progress("mpc834x_mds_setup_arch()", 0);
86 82
87#ifdef CONFIG_PCI 83 mpc83xx_setup_pci();
88 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
89 mpc83xx_add_bridge(np);
90#endif
91 84
92 mpc834xemds_usb_cfg(); 85 mpc834xemds_usb_cfg();
93} 86}
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c
index 3b202752ef5f..ad8e4bcd7d55 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c
@@ -80,10 +80,7 @@ static void __init mpc836x_mds_setup_arch(void)
80 of_node_put(np); 80 of_node_put(np);
81 } 81 }
82 82
83#ifdef CONFIG_PCI 83 mpc83xx_setup_pci();
84 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
85 mpc83xx_add_bridge(np);
86#endif
87 84
88#ifdef CONFIG_QUICC_ENGINE 85#ifdef CONFIG_QUICC_ENGINE
89 qe_reset(); 86 qe_reset();
diff --git a/arch/powerpc/platforms/83xx/mpc836x_rdk.c b/arch/powerpc/platforms/83xx/mpc836x_rdk.c
index fd6f730ff2f9..f8769d713d61 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_rdk.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_rdk.c
@@ -31,17 +31,10 @@ machine_device_initcall(mpc836x_rdk, mpc83xx_declare_of_platform_devices);
31 31
32static void __init mpc836x_rdk_setup_arch(void) 32static void __init mpc836x_rdk_setup_arch(void)
33{ 33{
34#ifdef CONFIG_PCI
35 struct device_node *np;
36#endif
37
38 if (ppc_md.progress) 34 if (ppc_md.progress)
39 ppc_md.progress("mpc836x_rdk_setup_arch()", 0); 35 ppc_md.progress("mpc836x_rdk_setup_arch()", 0);
40 36
41#ifdef CONFIG_PCI 37 mpc83xx_setup_pci();
42 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
43 mpc83xx_add_bridge(np);
44#endif
45#ifdef CONFIG_QUICC_ENGINE 38#ifdef CONFIG_QUICC_ENGINE
46 qe_reset(); 39 qe_reset();
47#endif 40#endif
diff --git a/arch/powerpc/platforms/83xx/mpc837x_mds.c b/arch/powerpc/platforms/83xx/mpc837x_mds.c
index 74631832e1a3..e53a60b6c863 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_mds.c
@@ -79,19 +79,10 @@ out:
79 */ 79 */
80static void __init mpc837x_mds_setup_arch(void) 80static void __init mpc837x_mds_setup_arch(void)
81{ 81{
82#ifdef CONFIG_PCI
83 struct device_node *np;
84#endif
85
86 if (ppc_md.progress) 82 if (ppc_md.progress)
87 ppc_md.progress("mpc837x_mds_setup_arch()", 0); 83 ppc_md.progress("mpc837x_mds_setup_arch()", 0);
88 84
89#ifdef CONFIG_PCI 85 mpc83xx_setup_pci();
90 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
91 mpc83xx_add_bridge(np);
92 for_each_compatible_node(np, "pci", "fsl,mpc8314-pcie")
93 mpc83xx_add_bridge(np);
94#endif
95 mpc837xmds_usb_cfg(); 86 mpc837xmds_usb_cfg();
96} 87}
97 88
diff --git a/arch/powerpc/platforms/83xx/mpc837x_rdb.c b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
index a4a5336d1143..16c9c9cbbb7f 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
@@ -50,19 +50,10 @@ static void mpc837x_rdb_sd_cfg(void)
50 */ 50 */
51static void __init mpc837x_rdb_setup_arch(void) 51static void __init mpc837x_rdb_setup_arch(void)
52{ 52{
53#ifdef CONFIG_PCI
54 struct device_node *np;
55#endif
56
57 if (ppc_md.progress) 53 if (ppc_md.progress)
58 ppc_md.progress("mpc837x_rdb_setup_arch()", 0); 54 ppc_md.progress("mpc837x_rdb_setup_arch()", 0);
59 55
60#ifdef CONFIG_PCI 56 mpc83xx_setup_pci();
61 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
62 mpc83xx_add_bridge(np);
63 for_each_compatible_node(np, "pci", "fsl,mpc8314-pcie")
64 mpc83xx_add_bridge(np);
65#endif
66 mpc837x_usb_cfg(); 57 mpc837x_usb_cfg();
67 mpc837x_rdb_sd_cfg(); 58 mpc837x_rdb_sd_cfg();
68} 59}
diff --git a/arch/powerpc/platforms/83xx/mpc83xx.h b/arch/powerpc/platforms/83xx/mpc83xx.h
index a54f6baaae70..0cf74d7ea1c5 100644
--- a/arch/powerpc/platforms/83xx/mpc83xx.h
+++ b/arch/powerpc/platforms/83xx/mpc83xx.h
@@ -79,6 +79,12 @@ static inline void __init mpc83xx_qe_init_IRQ(void) {}
79#define mpc83xx_ipic_and_qe_init_IRQ mpc83xx_ipic_init_IRQ 79#define mpc83xx_ipic_and_qe_init_IRQ mpc83xx_ipic_init_IRQ
80#endif /* CONFIG_QUICC_ENGINE */ 80#endif /* CONFIG_QUICC_ENGINE */
81 81
82#ifdef CONFIG_PCI
83extern void mpc83xx_setup_pci(void);
84#else
85#define mpc83xx_setup_pci() do {} while (0)
86#endif
87
82extern int mpc83xx_declare_of_platform_devices(void); 88extern int mpc83xx_declare_of_platform_devices(void);
83 89
84#endif /* __MPC83XX_H__ */ 90#endif /* __MPC83XX_H__ */
diff --git a/arch/powerpc/platforms/83xx/sbc834x.c b/arch/powerpc/platforms/83xx/sbc834x.c
index 22faaa1c1073..1c3dfc8556f0 100644
--- a/arch/powerpc/platforms/83xx/sbc834x.c
+++ b/arch/powerpc/platforms/83xx/sbc834x.c
@@ -48,18 +48,10 @@
48 */ 48 */
49static void __init sbc834x_setup_arch(void) 49static void __init sbc834x_setup_arch(void)
50{ 50{
51#ifdef CONFIG_PCI
52 struct device_node *np;
53#endif
54
55 if (ppc_md.progress) 51 if (ppc_md.progress)
56 ppc_md.progress("sbc834x_setup_arch()", 0); 52 ppc_md.progress("sbc834x_setup_arch()", 0);
57 53
58#ifdef CONFIG_PCI 54 mpc83xx_setup_pci();
59 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
60 mpc83xx_add_bridge(np);
61#endif
62
63} 55}
64 56
65machine_device_initcall(sbc834x, mpc83xx_declare_of_platform_devices); 57machine_device_initcall(sbc834x, mpc83xx_declare_of_platform_devices);