aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2008-04-01 02:42:26 -0400
committerPaul Mackerras <paulus@samba.org>2008-04-18 01:36:10 -0400
commitf01567d6d5688f8f613cd23da31aaf02d9538525 (patch)
tree70f6c1a55909a49736374900382f2e37697b912e /arch/powerpc
parent30d6ad251b5dcf497a266c4dc7d38fcde7185422 (diff)
[POWERPC] Use pseries_setup_i8259_cascade() in pseries_mpic_init_IRQ()
pseries_mpic_init_IRQ() implements the same logic as the xics code did to find the i8259 cascade irq. Now that we've pulled that logic out into pseries_setup_i8259_cascade() we can use it in the mpic code. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/platforms/pseries/setup.c43
1 files changed, 2 insertions, 41 deletions
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index eb079521fbf1..f66aa9c3b135 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -175,12 +175,9 @@ static void __init pseries_setup_i8259_cascade(void)
175 175
176static void __init pseries_mpic_init_IRQ(void) 176static void __init pseries_mpic_init_IRQ(void)
177{ 177{
178 struct device_node *np, *old, *cascade = NULL; 178 struct device_node *np;
179 const unsigned int *addrp;
180 unsigned long intack = 0;
181 const unsigned int *opprop; 179 const unsigned int *opprop;
182 unsigned long openpic_addr = 0; 180 unsigned long openpic_addr = 0;
183 unsigned int cascade_irq;
184 int naddr, n, i, opplen; 181 int naddr, n, i, opplen;
185 struct mpic *mpic; 182 struct mpic *mpic;
186 183
@@ -213,43 +210,7 @@ static void __init pseries_mpic_init_IRQ(void)
213 mpic_init(mpic); 210 mpic_init(mpic);
214 211
215 /* Look for cascade */ 212 /* Look for cascade */
216 for_each_node_by_type(np, "interrupt-controller") 213 pseries_setup_i8259_cascade();
217 if (of_device_is_compatible(np, "chrp,iic")) {
218 cascade = np;
219 break;
220 }
221 if (cascade == NULL)
222 return;
223
224 cascade_irq = irq_of_parse_and_map(cascade, 0);
225 if (cascade_irq == NO_IRQ) {
226 printk(KERN_ERR "mpic: failed to map cascade interrupt");
227 return;
228 }
229
230 /* Check ACK type */
231 for (old = of_node_get(cascade); old != NULL ; old = np) {
232 np = of_get_parent(old);
233 of_node_put(old);
234 if (np == NULL)
235 break;
236 if (strcmp(np->name, "pci") != 0)
237 continue;
238 addrp = of_get_property(np, "8259-interrupt-acknowledge",
239 NULL);
240 if (addrp == NULL)
241 continue;
242 naddr = of_n_addr_cells(np);
243 intack = addrp[naddr-1];
244 if (naddr > 1)
245 intack |= ((unsigned long)addrp[naddr-2]) << 32;
246 }
247 if (intack)
248 printk(KERN_DEBUG "mpic: PCI 8259 intack at 0x%016lx\n",
249 intack);
250 i8259_init(cascade, intack);
251 of_node_put(cascade);
252 set_irq_chained_handler(cascade_irq, pseries_8259_cascade);
253} 214}
254 215
255static void __init pseries_xics_init_IRQ(void) 216static void __init pseries_xics_init_IRQ(void)