diff options
author | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2011-07-22 15:55:42 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2011-11-24 03:01:40 -0500 |
commit | d4fb5ebd83c7044ce0784e899271f6fcb42d0713 (patch) | |
tree | fca4a27cb58db825f50812fe882efc800871d4d8 /arch | |
parent | c0019a4d6700e22409ffeaf6dbfa0b0700d128ca (diff) |
powerpc/83xx: consolidate init_IRQ functions
On mpc83xx platform nearly all _init_IRQ functions look alike. They either
just setup ipic, or setup ipic and QE PIC. Separate this to special functions
to be either referenced from ppc_md, or called from board file.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/83xx/asp834x.c | 20 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/km83xx.c | 33 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/misc.c | 46 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/mpc830x_rdb.c | 18 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/mpc831x_rdb.c | 18 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/mpc832x_mds.c | 30 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/mpc832x_rdb.c | 31 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/mpc834x_itx.c | 18 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/mpc834x_mds.c | 18 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/mpc836x_mds.c | 30 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/mpc836x_rdk.c | 28 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/mpc837x_mds.c | 18 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/mpc837x_rdb.c | 18 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/mpc83xx.h | 9 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/sbc834x.c | 20 |
15 files changed, 68 insertions, 287 deletions
diff --git a/arch/powerpc/platforms/83xx/asp834x.c b/arch/powerpc/platforms/83xx/asp834x.c index aa0d84d22585..90b6c063758b 100644 --- a/arch/powerpc/platforms/83xx/asp834x.c +++ b/arch/powerpc/platforms/83xx/asp834x.c | |||
@@ -36,24 +36,6 @@ static void __init asp834x_setup_arch(void) | |||
36 | mpc834x_usb_cfg(); | 36 | mpc834x_usb_cfg(); |
37 | } | 37 | } |
38 | 38 | ||
39 | static void __init asp834x_init_IRQ(void) | ||
40 | { | ||
41 | struct device_node *np; | ||
42 | |||
43 | np = of_find_node_by_type(NULL, "ipic"); | ||
44 | if (!np) | ||
45 | return; | ||
46 | |||
47 | ipic_init(np, 0); | ||
48 | |||
49 | of_node_put(np); | ||
50 | |||
51 | /* Initialize the default interrupt mapping priorities, | ||
52 | * in case the boot rom changed something on us. | ||
53 | */ | ||
54 | ipic_set_default_priority(); | ||
55 | } | ||
56 | |||
57 | static struct __initdata of_device_id asp8347_ids[] = { | 39 | static struct __initdata of_device_id asp8347_ids[] = { |
58 | { .type = "soc", }, | 40 | { .type = "soc", }, |
59 | { .compatible = "soc", }, | 41 | { .compatible = "soc", }, |
@@ -82,7 +64,7 @@ define_machine(asp834x) { | |||
82 | .name = "ASP8347E", | 64 | .name = "ASP8347E", |
83 | .probe = asp834x_probe, | 65 | .probe = asp834x_probe, |
84 | .setup_arch = asp834x_setup_arch, | 66 | .setup_arch = asp834x_setup_arch, |
85 | .init_IRQ = asp834x_init_IRQ, | 67 | .init_IRQ = mpc83xx_ipic_init_IRQ, |
86 | .get_irq = ipic_get_irq, | 68 | .get_irq = ipic_get_irq, |
87 | .restart = mpc83xx_restart, | 69 | .restart = mpc83xx_restart, |
88 | .time_init = mpc83xx_time_init, | 70 | .time_init = mpc83xx_time_init, |
diff --git a/arch/powerpc/platforms/83xx/km83xx.c b/arch/powerpc/platforms/83xx/km83xx.c index c55129f5760a..eae5913db03c 100644 --- a/arch/powerpc/platforms/83xx/km83xx.c +++ b/arch/powerpc/platforms/83xx/km83xx.c | |||
@@ -140,37 +140,6 @@ static int __init kmeter_declare_of_platform_devices(void) | |||
140 | } | 140 | } |
141 | machine_device_initcall(mpc83xx_km, kmeter_declare_of_platform_devices); | 141 | machine_device_initcall(mpc83xx_km, kmeter_declare_of_platform_devices); |
142 | 142 | ||
143 | static void __init mpc83xx_km_init_IRQ(void) | ||
144 | { | ||
145 | struct device_node *np; | ||
146 | |||
147 | np = of_find_compatible_node(NULL, NULL, "fsl,pq2pro-pic"); | ||
148 | if (!np) { | ||
149 | np = of_find_node_by_type(NULL, "ipic"); | ||
150 | if (!np) | ||
151 | return; | ||
152 | } | ||
153 | |||
154 | ipic_init(np, 0); | ||
155 | |||
156 | /* Initialize the default interrupt mapping priorities, | ||
157 | * in case the boot rom changed something on us. | ||
158 | */ | ||
159 | ipic_set_default_priority(); | ||
160 | of_node_put(np); | ||
161 | |||
162 | #ifdef CONFIG_QUICC_ENGINE | ||
163 | np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic"); | ||
164 | if (!np) { | ||
165 | np = of_find_node_by_type(NULL, "qeic"); | ||
166 | if (!np) | ||
167 | return; | ||
168 | } | ||
169 | qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic); | ||
170 | of_node_put(np); | ||
171 | #endif /* CONFIG_QUICC_ENGINE */ | ||
172 | } | ||
173 | |||
174 | /* list of the supported boards */ | 143 | /* list of the supported boards */ |
175 | static char *board[] __initdata = { | 144 | static char *board[] __initdata = { |
176 | "Keymile,KMETER1", | 145 | "Keymile,KMETER1", |
@@ -198,7 +167,7 @@ define_machine(mpc83xx_km) { | |||
198 | .name = "mpc83xx-km-platform", | 167 | .name = "mpc83xx-km-platform", |
199 | .probe = mpc83xx_km_probe, | 168 | .probe = mpc83xx_km_probe, |
200 | .setup_arch = mpc83xx_km_setup_arch, | 169 | .setup_arch = mpc83xx_km_setup_arch, |
201 | .init_IRQ = mpc83xx_km_init_IRQ, | 170 | .init_IRQ = mpc83xx_ipic_and_qe_init_IRQ, |
202 | .get_irq = ipic_get_irq, | 171 | .get_irq = ipic_get_irq, |
203 | .restart = mpc83xx_restart, | 172 | .restart = mpc83xx_restart, |
204 | .time_init = mpc83xx_time_init, | 173 | .time_init = mpc83xx_time_init, |
diff --git a/arch/powerpc/platforms/83xx/misc.c b/arch/powerpc/platforms/83xx/misc.c index f01806c940e1..4ac60cc3727b 100644 --- a/arch/powerpc/platforms/83xx/misc.c +++ b/arch/powerpc/platforms/83xx/misc.c | |||
@@ -11,9 +11,12 @@ | |||
11 | 11 | ||
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 | 15 | ||
15 | #include <asm/io.h> | 16 | #include <asm/io.h> |
16 | #include <asm/hw_irq.h> | 17 | #include <asm/hw_irq.h> |
18 | #include <asm/ipic.h> | ||
19 | #include <asm/qe_ic.h> | ||
17 | #include <sysdev/fsl_soc.h> | 20 | #include <sysdev/fsl_soc.h> |
18 | 21 | ||
19 | #include "mpc83xx.h" | 22 | #include "mpc83xx.h" |
@@ -65,3 +68,46 @@ long __init mpc83xx_time_init(void) | |||
65 | 68 | ||
66 | return 0; | 69 | return 0; |
67 | } | 70 | } |
71 | |||
72 | void __init mpc83xx_ipic_init_IRQ(void) | ||
73 | { | ||
74 | struct device_node *np; | ||
75 | |||
76 | /* looking for fsl,pq2pro-pic which is asl compatible with fsl,ipic */ | ||
77 | np = of_find_compatible_node(NULL, NULL, "fsl,ipic"); | ||
78 | if (!np) | ||
79 | np = of_find_node_by_type(NULL, "ipic"); | ||
80 | if (!np) | ||
81 | return; | ||
82 | |||
83 | ipic_init(np, 0); | ||
84 | |||
85 | of_node_put(np); | ||
86 | |||
87 | /* Initialize the default interrupt mapping priorities, | ||
88 | * in case the boot rom changed something on us. | ||
89 | */ | ||
90 | ipic_set_default_priority(); | ||
91 | } | ||
92 | |||
93 | #ifdef CONFIG_QUICC_ENGINE | ||
94 | void __init mpc83xx_qe_init_IRQ(void) | ||
95 | { | ||
96 | struct device_node *np; | ||
97 | |||
98 | np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic"); | ||
99 | if (!np) { | ||
100 | np = of_find_node_by_type(NULL, "qeic"); | ||
101 | if (!np) | ||
102 | return; | ||
103 | } | ||
104 | qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic); | ||
105 | of_node_put(np); | ||
106 | } | ||
107 | |||
108 | void __init mpc83xx_ipic_and_qe_init_IRQ(void) | ||
109 | { | ||
110 | mpc83xx_ipic_init_IRQ(); | ||
111 | mpc83xx_qe_init_IRQ(); | ||
112 | } | ||
113 | #endif /* CONFIG_QUICC_ENGINE */ | ||
diff --git a/arch/powerpc/platforms/83xx/mpc830x_rdb.c b/arch/powerpc/platforms/83xx/mpc830x_rdb.c index d0c4e15b7794..b453c15d200a 100644 --- a/arch/powerpc/platforms/83xx/mpc830x_rdb.c +++ b/arch/powerpc/platforms/83xx/mpc830x_rdb.c | |||
@@ -41,22 +41,6 @@ static void __init mpc830x_rdb_setup_arch(void) | |||
41 | mpc831x_usb_cfg(); | 41 | mpc831x_usb_cfg(); |
42 | } | 42 | } |
43 | 43 | ||
44 | static void __init mpc830x_rdb_init_IRQ(void) | ||
45 | { | ||
46 | struct device_node *np; | ||
47 | |||
48 | np = of_find_node_by_type(NULL, "ipic"); | ||
49 | if (!np) | ||
50 | return; | ||
51 | |||
52 | ipic_init(np, 0); | ||
53 | |||
54 | /* Initialize the default interrupt mapping priorities, | ||
55 | * in case the boot rom changed something on us. | ||
56 | */ | ||
57 | ipic_set_default_priority(); | ||
58 | } | ||
59 | |||
60 | static const char *board[] __initdata = { | 44 | static const char *board[] __initdata = { |
61 | "MPC8308RDB", | 45 | "MPC8308RDB", |
62 | "fsl,mpc8308rdb", | 46 | "fsl,mpc8308rdb", |
@@ -89,7 +73,7 @@ define_machine(mpc830x_rdb) { | |||
89 | .name = "MPC830x RDB", | 73 | .name = "MPC830x RDB", |
90 | .probe = mpc830x_rdb_probe, | 74 | .probe = mpc830x_rdb_probe, |
91 | .setup_arch = mpc830x_rdb_setup_arch, | 75 | .setup_arch = mpc830x_rdb_setup_arch, |
92 | .init_IRQ = mpc830x_rdb_init_IRQ, | 76 | .init_IRQ = mpc83xx_ipic_init_IRQ, |
93 | .get_irq = ipic_get_irq, | 77 | .get_irq = ipic_get_irq, |
94 | .restart = mpc83xx_restart, | 78 | .restart = mpc83xx_restart, |
95 | .time_init = mpc83xx_time_init, | 79 | .time_init = mpc83xx_time_init, |
diff --git a/arch/powerpc/platforms/83xx/mpc831x_rdb.c b/arch/powerpc/platforms/83xx/mpc831x_rdb.c index f859ead49a8d..386bde8b2b24 100644 --- a/arch/powerpc/platforms/83xx/mpc831x_rdb.c +++ b/arch/powerpc/platforms/83xx/mpc831x_rdb.c | |||
@@ -44,22 +44,6 @@ static void __init mpc831x_rdb_setup_arch(void) | |||
44 | mpc831x_usb_cfg(); | 44 | mpc831x_usb_cfg(); |
45 | } | 45 | } |
46 | 46 | ||
47 | static void __init mpc831x_rdb_init_IRQ(void) | ||
48 | { | ||
49 | struct device_node *np; | ||
50 | |||
51 | np = of_find_node_by_type(NULL, "ipic"); | ||
52 | if (!np) | ||
53 | return; | ||
54 | |||
55 | ipic_init(np, 0); | ||
56 | |||
57 | /* Initialize the default interrupt mapping priorities, | ||
58 | * in case the boot rom changed something on us. | ||
59 | */ | ||
60 | ipic_set_default_priority(); | ||
61 | } | ||
62 | |||
63 | static const char *board[] __initdata = { | 47 | static const char *board[] __initdata = { |
64 | "MPC8313ERDB", | 48 | "MPC8313ERDB", |
65 | "fsl,mpc8315erdb", | 49 | "fsl,mpc8315erdb", |
@@ -92,7 +76,7 @@ define_machine(mpc831x_rdb) { | |||
92 | .name = "MPC831x RDB", | 76 | .name = "MPC831x RDB", |
93 | .probe = mpc831x_rdb_probe, | 77 | .probe = mpc831x_rdb_probe, |
94 | .setup_arch = mpc831x_rdb_setup_arch, | 78 | .setup_arch = mpc831x_rdb_setup_arch, |
95 | .init_IRQ = mpc831x_rdb_init_IRQ, | 79 | .init_IRQ = mpc83xx_ipic_init_IRQ, |
96 | .get_irq = ipic_get_irq, | 80 | .get_irq = ipic_get_irq, |
97 | .restart = mpc83xx_restart, | 81 | .restart = mpc83xx_restart, |
98 | .time_init = mpc83xx_time_init, | 82 | .time_init = mpc83xx_time_init, |
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c index 32a52896822f..39e0a92f4251 100644 --- a/arch/powerpc/platforms/83xx/mpc832x_mds.c +++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c | |||
@@ -119,34 +119,6 @@ static int __init mpc832x_declare_of_platform_devices(void) | |||
119 | } | 119 | } |
120 | machine_device_initcall(mpc832x_mds, mpc832x_declare_of_platform_devices); | 120 | machine_device_initcall(mpc832x_mds, mpc832x_declare_of_platform_devices); |
121 | 121 | ||
122 | static void __init mpc832x_sys_init_IRQ(void) | ||
123 | { | ||
124 | struct device_node *np; | ||
125 | |||
126 | np = of_find_node_by_type(NULL, "ipic"); | ||
127 | if (!np) | ||
128 | return; | ||
129 | |||
130 | ipic_init(np, 0); | ||
131 | |||
132 | /* Initialize the default interrupt mapping priorities, | ||
133 | * in case the boot rom changed something on us. | ||
134 | */ | ||
135 | ipic_set_default_priority(); | ||
136 | of_node_put(np); | ||
137 | |||
138 | #ifdef CONFIG_QUICC_ENGINE | ||
139 | np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic"); | ||
140 | if (!np) { | ||
141 | np = of_find_node_by_type(NULL, "qeic"); | ||
142 | if (!np) | ||
143 | return; | ||
144 | } | ||
145 | qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic); | ||
146 | of_node_put(np); | ||
147 | #endif /* CONFIG_QUICC_ENGINE */ | ||
148 | } | ||
149 | |||
150 | /* | 122 | /* |
151 | * Called very early, MMU is off, device-tree isn't unflattened | 123 | * Called very early, MMU is off, device-tree isn't unflattened |
152 | */ | 124 | */ |
@@ -161,7 +133,7 @@ define_machine(mpc832x_mds) { | |||
161 | .name = "MPC832x MDS", | 133 | .name = "MPC832x MDS", |
162 | .probe = mpc832x_sys_probe, | 134 | .probe = mpc832x_sys_probe, |
163 | .setup_arch = mpc832x_sys_setup_arch, | 135 | .setup_arch = mpc832x_sys_setup_arch, |
164 | .init_IRQ = mpc832x_sys_init_IRQ, | 136 | .init_IRQ = mpc83xx_ipic_and_qe_init_IRQ, |
165 | .get_irq = ipic_get_irq, | 137 | .get_irq = ipic_get_irq, |
166 | .restart = mpc83xx_restart, | 138 | .restart = mpc83xx_restart, |
167 | .time_init = mpc83xx_time_init, | 139 | .time_init = mpc83xx_time_init, |
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c index 17f99745f0e4..ebfecec958d7 100644 --- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c +++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c | |||
@@ -236,35 +236,6 @@ static int __init mpc832x_declare_of_platform_devices(void) | |||
236 | } | 236 | } |
237 | machine_device_initcall(mpc832x_rdb, mpc832x_declare_of_platform_devices); | 237 | machine_device_initcall(mpc832x_rdb, mpc832x_declare_of_platform_devices); |
238 | 238 | ||
239 | static void __init mpc832x_rdb_init_IRQ(void) | ||
240 | { | ||
241 | |||
242 | struct device_node *np; | ||
243 | |||
244 | np = of_find_node_by_type(NULL, "ipic"); | ||
245 | if (!np) | ||
246 | return; | ||
247 | |||
248 | ipic_init(np, 0); | ||
249 | |||
250 | /* Initialize the default interrupt mapping priorities, | ||
251 | * in case the boot rom changed something on us. | ||
252 | */ | ||
253 | ipic_set_default_priority(); | ||
254 | of_node_put(np); | ||
255 | |||
256 | #ifdef CONFIG_QUICC_ENGINE | ||
257 | np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic"); | ||
258 | if (!np) { | ||
259 | np = of_find_node_by_type(NULL, "qeic"); | ||
260 | if (!np) | ||
261 | return; | ||
262 | } | ||
263 | qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic); | ||
264 | of_node_put(np); | ||
265 | #endif /* CONFIG_QUICC_ENGINE */ | ||
266 | } | ||
267 | |||
268 | /* | 239 | /* |
269 | * Called very early, MMU is off, device-tree isn't unflattened | 240 | * Called very early, MMU is off, device-tree isn't unflattened |
270 | */ | 241 | */ |
@@ -279,7 +250,7 @@ define_machine(mpc832x_rdb) { | |||
279 | .name = "MPC832x RDB", | 250 | .name = "MPC832x RDB", |
280 | .probe = mpc832x_rdb_probe, | 251 | .probe = mpc832x_rdb_probe, |
281 | .setup_arch = mpc832x_rdb_setup_arch, | 252 | .setup_arch = mpc832x_rdb_setup_arch, |
282 | .init_IRQ = mpc832x_rdb_init_IRQ, | 253 | .init_IRQ = mpc83xx_ipic_and_qe_init_IRQ, |
283 | .get_irq = ipic_get_irq, | 254 | .get_irq = ipic_get_irq, |
284 | .restart = mpc83xx_restart, | 255 | .restart = mpc83xx_restart, |
285 | .time_init = mpc83xx_time_init, | 256 | .time_init = mpc83xx_time_init, |
diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.c b/arch/powerpc/platforms/83xx/mpc834x_itx.c index 6b45969567d4..509e070cf29a 100644 --- a/arch/powerpc/platforms/83xx/mpc834x_itx.c +++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c | |||
@@ -74,22 +74,6 @@ static void __init mpc834x_itx_setup_arch(void) | |||
74 | mpc834x_usb_cfg(); | 74 | mpc834x_usb_cfg(); |
75 | } | 75 | } |
76 | 76 | ||
77 | static void __init mpc834x_itx_init_IRQ(void) | ||
78 | { | ||
79 | struct device_node *np; | ||
80 | |||
81 | np = of_find_node_by_type(NULL, "ipic"); | ||
82 | if (!np) | ||
83 | return; | ||
84 | |||
85 | ipic_init(np, 0); | ||
86 | |||
87 | /* Initialize the default interrupt mapping priorities, | ||
88 | * in case the boot rom changed something on us. | ||
89 | */ | ||
90 | ipic_set_default_priority(); | ||
91 | } | ||
92 | |||
93 | /* | 77 | /* |
94 | * Called very early, MMU is off, device-tree isn't unflattened | 78 | * Called very early, MMU is off, device-tree isn't unflattened |
95 | */ | 79 | */ |
@@ -104,7 +88,7 @@ define_machine(mpc834x_itx) { | |||
104 | .name = "MPC834x ITX", | 88 | .name = "MPC834x ITX", |
105 | .probe = mpc834x_itx_probe, | 89 | .probe = mpc834x_itx_probe, |
106 | .setup_arch = mpc834x_itx_setup_arch, | 90 | .setup_arch = mpc834x_itx_setup_arch, |
107 | .init_IRQ = mpc834x_itx_init_IRQ, | 91 | .init_IRQ = mpc83xx_ipic_init_IRQ, |
108 | .get_irq = ipic_get_irq, | 92 | .get_irq = ipic_get_irq, |
109 | .restart = mpc83xx_restart, | 93 | .restart = mpc83xx_restart, |
110 | .time_init = mpc83xx_time_init, | 94 | .time_init = mpc83xx_time_init, |
diff --git a/arch/powerpc/platforms/83xx/mpc834x_mds.c b/arch/powerpc/platforms/83xx/mpc834x_mds.c index 041c5177e737..3807735a88d8 100644 --- a/arch/powerpc/platforms/83xx/mpc834x_mds.c +++ b/arch/powerpc/platforms/83xx/mpc834x_mds.c | |||
@@ -92,22 +92,6 @@ static void __init mpc834x_mds_setup_arch(void) | |||
92 | mpc834xemds_usb_cfg(); | 92 | mpc834xemds_usb_cfg(); |
93 | } | 93 | } |
94 | 94 | ||
95 | static void __init mpc834x_mds_init_IRQ(void) | ||
96 | { | ||
97 | struct device_node *np; | ||
98 | |||
99 | np = of_find_node_by_type(NULL, "ipic"); | ||
100 | if (!np) | ||
101 | return; | ||
102 | |||
103 | ipic_init(np, 0); | ||
104 | |||
105 | /* Initialize the default interrupt mapping priorities, | ||
106 | * in case the boot rom changed something on us. | ||
107 | */ | ||
108 | ipic_set_default_priority(); | ||
109 | } | ||
110 | |||
111 | static struct of_device_id mpc834x_ids[] = { | 95 | static struct of_device_id mpc834x_ids[] = { |
112 | { .type = "soc", }, | 96 | { .type = "soc", }, |
113 | { .compatible = "soc", }, | 97 | { .compatible = "soc", }, |
@@ -137,7 +121,7 @@ define_machine(mpc834x_mds) { | |||
137 | .name = "MPC834x MDS", | 121 | .name = "MPC834x MDS", |
138 | .probe = mpc834x_mds_probe, | 122 | .probe = mpc834x_mds_probe, |
139 | .setup_arch = mpc834x_mds_setup_arch, | 123 | .setup_arch = mpc834x_mds_setup_arch, |
140 | .init_IRQ = mpc834x_mds_init_IRQ, | 124 | .init_IRQ = mpc83xx_ipic_init_IRQ, |
141 | .get_irq = ipic_get_irq, | 125 | .get_irq = ipic_get_irq, |
142 | .restart = mpc83xx_restart, | 126 | .restart = mpc83xx_restart, |
143 | .time_init = mpc83xx_time_init, | 127 | .time_init = mpc83xx_time_init, |
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c index 934cc8c46bbc..afb3e45e1e97 100644 --- a/arch/powerpc/platforms/83xx/mpc836x_mds.c +++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c | |||
@@ -226,34 +226,6 @@ err: | |||
226 | machine_arch_initcall(mpc836x_mds, mpc836x_usb_cfg); | 226 | machine_arch_initcall(mpc836x_mds, mpc836x_usb_cfg); |
227 | #endif /* CONFIG_QE_USB */ | 227 | #endif /* CONFIG_QE_USB */ |
228 | 228 | ||
229 | static void __init mpc836x_mds_init_IRQ(void) | ||
230 | { | ||
231 | struct device_node *np; | ||
232 | |||
233 | np = of_find_node_by_type(NULL, "ipic"); | ||
234 | if (!np) | ||
235 | return; | ||
236 | |||
237 | ipic_init(np, 0); | ||
238 | |||
239 | /* Initialize the default interrupt mapping priorities, | ||
240 | * in case the boot rom changed something on us. | ||
241 | */ | ||
242 | ipic_set_default_priority(); | ||
243 | of_node_put(np); | ||
244 | |||
245 | #ifdef CONFIG_QUICC_ENGINE | ||
246 | np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic"); | ||
247 | if (!np) { | ||
248 | np = of_find_node_by_type(NULL, "qeic"); | ||
249 | if (!np) | ||
250 | return; | ||
251 | } | ||
252 | qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic); | ||
253 | of_node_put(np); | ||
254 | #endif /* CONFIG_QUICC_ENGINE */ | ||
255 | } | ||
256 | |||
257 | /* | 229 | /* |
258 | * Called very early, MMU is off, device-tree isn't unflattened | 230 | * Called very early, MMU is off, device-tree isn't unflattened |
259 | */ | 231 | */ |
@@ -268,7 +240,7 @@ define_machine(mpc836x_mds) { | |||
268 | .name = "MPC836x MDS", | 240 | .name = "MPC836x MDS", |
269 | .probe = mpc836x_mds_probe, | 241 | .probe = mpc836x_mds_probe, |
270 | .setup_arch = mpc836x_mds_setup_arch, | 242 | .setup_arch = mpc836x_mds_setup_arch, |
271 | .init_IRQ = mpc836x_mds_init_IRQ, | 243 | .init_IRQ = mpc83xx_ipic_and_qe_init_IRQ, |
272 | .get_irq = ipic_get_irq, | 244 | .get_irq = ipic_get_irq, |
273 | .restart = mpc83xx_restart, | 245 | .restart = mpc83xx_restart, |
274 | .time_init = mpc83xx_time_init, | 246 | .time_init = mpc83xx_time_init, |
diff --git a/arch/powerpc/platforms/83xx/mpc836x_rdk.c b/arch/powerpc/platforms/83xx/mpc836x_rdk.c index b0090aac9642..cd8f0782a66b 100644 --- a/arch/powerpc/platforms/83xx/mpc836x_rdk.c +++ b/arch/powerpc/platforms/83xx/mpc836x_rdk.c | |||
@@ -56,32 +56,6 @@ static void __init mpc836x_rdk_setup_arch(void) | |||
56 | #endif | 56 | #endif |
57 | } | 57 | } |
58 | 58 | ||
59 | static void __init mpc836x_rdk_init_IRQ(void) | ||
60 | { | ||
61 | struct device_node *np; | ||
62 | |||
63 | np = of_find_compatible_node(NULL, NULL, "fsl,ipic"); | ||
64 | if (!np) | ||
65 | return; | ||
66 | |||
67 | ipic_init(np, 0); | ||
68 | |||
69 | /* | ||
70 | * Initialize the default interrupt mapping priorities, | ||
71 | * in case the boot rom changed something on us. | ||
72 | */ | ||
73 | ipic_set_default_priority(); | ||
74 | of_node_put(np); | ||
75 | #ifdef CONFIG_QUICC_ENGINE | ||
76 | np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic"); | ||
77 | if (!np) | ||
78 | return; | ||
79 | |||
80 | qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic); | ||
81 | of_node_put(np); | ||
82 | #endif | ||
83 | } | ||
84 | |||
85 | /* | 59 | /* |
86 | * Called very early, MMU is off, device-tree isn't unflattened. | 60 | * Called very early, MMU is off, device-tree isn't unflattened. |
87 | */ | 61 | */ |
@@ -96,7 +70,7 @@ define_machine(mpc836x_rdk) { | |||
96 | .name = "MPC836x RDK", | 70 | .name = "MPC836x RDK", |
97 | .probe = mpc836x_rdk_probe, | 71 | .probe = mpc836x_rdk_probe, |
98 | .setup_arch = mpc836x_rdk_setup_arch, | 72 | .setup_arch = mpc836x_rdk_setup_arch, |
99 | .init_IRQ = mpc836x_rdk_init_IRQ, | 73 | .init_IRQ = mpc83xx_ipic_and_qe_init_IRQ, |
100 | .get_irq = ipic_get_irq, | 74 | .get_irq = ipic_get_irq, |
101 | .restart = mpc83xx_restart, | 75 | .restart = mpc83xx_restart, |
102 | .time_init = mpc83xx_time_init, | 76 | .time_init = mpc83xx_time_init, |
diff --git a/arch/powerpc/platforms/83xx/mpc837x_mds.c b/arch/powerpc/platforms/83xx/mpc837x_mds.c index 83068322abd1..3be7f3ac1573 100644 --- a/arch/powerpc/platforms/83xx/mpc837x_mds.c +++ b/arch/powerpc/platforms/83xx/mpc837x_mds.c | |||
@@ -112,22 +112,6 @@ static int __init mpc837x_declare_of_platform_devices(void) | |||
112 | } | 112 | } |
113 | machine_device_initcall(mpc837x_mds, mpc837x_declare_of_platform_devices); | 113 | machine_device_initcall(mpc837x_mds, mpc837x_declare_of_platform_devices); |
114 | 114 | ||
115 | static void __init mpc837x_mds_init_IRQ(void) | ||
116 | { | ||
117 | struct device_node *np; | ||
118 | |||
119 | np = of_find_compatible_node(NULL, NULL, "fsl,ipic"); | ||
120 | if (!np) | ||
121 | return; | ||
122 | |||
123 | ipic_init(np, 0); | ||
124 | |||
125 | /* Initialize the default interrupt mapping priorities, | ||
126 | * in case the boot rom changed something on us. | ||
127 | */ | ||
128 | ipic_set_default_priority(); | ||
129 | } | ||
130 | |||
131 | /* | 115 | /* |
132 | * Called very early, MMU is off, device-tree isn't unflattened | 116 | * Called very early, MMU is off, device-tree isn't unflattened |
133 | */ | 117 | */ |
@@ -142,7 +126,7 @@ define_machine(mpc837x_mds) { | |||
142 | .name = "MPC837x MDS", | 126 | .name = "MPC837x MDS", |
143 | .probe = mpc837x_mds_probe, | 127 | .probe = mpc837x_mds_probe, |
144 | .setup_arch = mpc837x_mds_setup_arch, | 128 | .setup_arch = mpc837x_mds_setup_arch, |
145 | .init_IRQ = mpc837x_mds_init_IRQ, | 129 | .init_IRQ = mpc83xx_ipic_init_IRQ, |
146 | .get_irq = ipic_get_irq, | 130 | .get_irq = ipic_get_irq, |
147 | .restart = mpc83xx_restart, | 131 | .restart = mpc83xx_restart, |
148 | .time_init = mpc83xx_time_init, | 132 | .time_init = mpc83xx_time_init, |
diff --git a/arch/powerpc/platforms/83xx/mpc837x_rdb.c b/arch/powerpc/platforms/83xx/mpc837x_rdb.c index 7bafbf2ec0f9..eebfd81c7519 100644 --- a/arch/powerpc/platforms/83xx/mpc837x_rdb.c +++ b/arch/powerpc/platforms/83xx/mpc837x_rdb.c | |||
@@ -85,22 +85,6 @@ static int __init mpc837x_declare_of_platform_devices(void) | |||
85 | } | 85 | } |
86 | machine_device_initcall(mpc837x_rdb, mpc837x_declare_of_platform_devices); | 86 | machine_device_initcall(mpc837x_rdb, mpc837x_declare_of_platform_devices); |
87 | 87 | ||
88 | static void __init mpc837x_rdb_init_IRQ(void) | ||
89 | { | ||
90 | struct device_node *np; | ||
91 | |||
92 | np = of_find_compatible_node(NULL, NULL, "fsl,ipic"); | ||
93 | if (!np) | ||
94 | return; | ||
95 | |||
96 | ipic_init(np, 0); | ||
97 | |||
98 | /* Initialize the default interrupt mapping priorities, | ||
99 | * in case the boot rom changed something on us. | ||
100 | */ | ||
101 | ipic_set_default_priority(); | ||
102 | } | ||
103 | |||
104 | static const char *board[] __initdata = { | 88 | static const char *board[] __initdata = { |
105 | "fsl,mpc8377rdb", | 89 | "fsl,mpc8377rdb", |
106 | "fsl,mpc8378rdb", | 90 | "fsl,mpc8378rdb", |
@@ -121,7 +105,7 @@ define_machine(mpc837x_rdb) { | |||
121 | .name = "MPC837x RDB/WLAN", | 105 | .name = "MPC837x RDB/WLAN", |
122 | .probe = mpc837x_rdb_probe, | 106 | .probe = mpc837x_rdb_probe, |
123 | .setup_arch = mpc837x_rdb_setup_arch, | 107 | .setup_arch = mpc837x_rdb_setup_arch, |
124 | .init_IRQ = mpc837x_rdb_init_IRQ, | 108 | .init_IRQ = mpc83xx_ipic_init_IRQ, |
125 | .get_irq = ipic_get_irq, | 109 | .get_irq = ipic_get_irq, |
126 | .restart = mpc83xx_restart, | 110 | .restart = mpc83xx_restart, |
127 | .time_init = mpc83xx_time_init, | 111 | .time_init = mpc83xx_time_init, |
diff --git a/arch/powerpc/platforms/83xx/mpc83xx.h b/arch/powerpc/platforms/83xx/mpc83xx.h index 82a434510d83..f07751ab9b11 100644 --- a/arch/powerpc/platforms/83xx/mpc83xx.h +++ b/arch/powerpc/platforms/83xx/mpc83xx.h | |||
@@ -70,5 +70,14 @@ extern long mpc83xx_time_init(void); | |||
70 | extern int mpc837x_usb_cfg(void); | 70 | extern int mpc837x_usb_cfg(void); |
71 | extern int mpc834x_usb_cfg(void); | 71 | extern int mpc834x_usb_cfg(void); |
72 | extern int mpc831x_usb_cfg(void); | 72 | extern int mpc831x_usb_cfg(void); |
73 | extern void mpc83xx_ipic_init_IRQ(void); | ||
74 | #ifdef CONFIG_QUICC_ENGINE | ||
75 | extern void mpc83xx_qe_init_IRQ(void); | ||
76 | extern void mpc83xx_ipic_and_qe_init_IRQ(void); | ||
77 | #else | ||
78 | static inline void __init mpc83xx_qe_init_IRQ(void) {} | ||
79 | #define mpc83xx_ipic_and_qe_init_IRQ mpc83xx_ipic_init_IRQ | ||
80 | #endif /* CONFIG_QUICC_ENGINE */ | ||
81 | |||
73 | 82 | ||
74 | #endif /* __MPC83XX_H__ */ | 83 | #endif /* __MPC83XX_H__ */ |
diff --git a/arch/powerpc/platforms/83xx/sbc834x.c b/arch/powerpc/platforms/83xx/sbc834x.c index af41d8c810a8..cdce953c575b 100644 --- a/arch/powerpc/platforms/83xx/sbc834x.c +++ b/arch/powerpc/platforms/83xx/sbc834x.c | |||
@@ -62,24 +62,6 @@ static void __init sbc834x_setup_arch(void) | |||
62 | 62 | ||
63 | } | 63 | } |
64 | 64 | ||
65 | static void __init sbc834x_init_IRQ(void) | ||
66 | { | ||
67 | struct device_node *np; | ||
68 | |||
69 | np = of_find_node_by_type(NULL, "ipic"); | ||
70 | if (!np) | ||
71 | return; | ||
72 | |||
73 | ipic_init(np, 0); | ||
74 | |||
75 | /* Initialize the default interrupt mapping priorities, | ||
76 | * in case the boot rom changed something on us. | ||
77 | */ | ||
78 | ipic_set_default_priority(); | ||
79 | |||
80 | of_node_put(np); | ||
81 | } | ||
82 | |||
83 | static struct __initdata of_device_id sbc834x_ids[] = { | 65 | static struct __initdata of_device_id sbc834x_ids[] = { |
84 | { .type = "soc", }, | 66 | { .type = "soc", }, |
85 | { .compatible = "soc", }, | 67 | { .compatible = "soc", }, |
@@ -109,7 +91,7 @@ define_machine(sbc834x) { | |||
109 | .name = "SBC834x", | 91 | .name = "SBC834x", |
110 | .probe = sbc834x_probe, | 92 | .probe = sbc834x_probe, |
111 | .setup_arch = sbc834x_setup_arch, | 93 | .setup_arch = sbc834x_setup_arch, |
112 | .init_IRQ = sbc834x_init_IRQ, | 94 | .init_IRQ = mpc83xx_ipic_init_IRQ, |
113 | .get_irq = ipic_get_irq, | 95 | .get_irq = ipic_get_irq, |
114 | .restart = mpc83xx_restart, | 96 | .restart = mpc83xx_restart, |
115 | .time_init = mpc83xx_time_init, | 97 | .time_init = mpc83xx_time_init, |