aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/powermac
diff options
context:
space:
mode:
authorKyle Moffett <Kyle.D.Moffett@boeing.com>2011-12-02 01:28:07 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-12-06 21:43:09 -0500
commit09dc34a95bfbc6062e1e7de0b96175480924aea8 (patch)
treed21a67d125278304324415ae2b7c23aa056584dc /arch/powerpc/platforms/powermac
parentc51242e7080d2265761de309cdea222d7e27bdfe (diff)
powerpc/mpic: Add in-core support for cascaded MPICs
The Cell and PowerMac platforms use virtually identical cascaded-IRQ setup code, so just merge it into the core. Ideally this code would trigger automatically when an MPIC device-node specifies an "interrupts" property, perhaps even enabling MPIC_SECONDARY along the way. Unfortunately, Benjamin Herrenschmidt has had bad experiences in the past with the quality of Apple PowerMac device-trees, so to be safe we will only try to parse out an IRQ if the MPIC_SECONDARY flag is set by the caller. Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/powermac')
-rw-r--r--arch/powerpc/platforms/powermac/pic.c36
1 files changed, 5 insertions, 31 deletions
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c
index b962101744e5..d8aedf135bb6 100644
--- a/arch/powerpc/platforms/powermac/pic.c
+++ b/arch/powerpc/platforms/powermac/pic.c
@@ -464,18 +464,6 @@ int of_irq_map_oldworld(struct device_node *device, int index,
464} 464}
465#endif /* CONFIG_PPC32 */ 465#endif /* CONFIG_PPC32 */
466 466
467static void pmac_u3_cascade(unsigned int irq, struct irq_desc *desc)
468{
469 struct irq_chip *chip = irq_desc_get_chip(desc);
470 struct mpic *mpic = irq_desc_get_handler_data(desc);
471 unsigned int cascade_irq = mpic_get_one_irq(mpic);
472
473 if (cascade_irq != NO_IRQ)
474 generic_handle_irq(cascade_irq);
475
476 chip->irq_eoi(&desc->irq_data);
477}
478
479static void __init pmac_pic_setup_mpic_nmi(struct mpic *mpic) 467static void __init pmac_pic_setup_mpic_nmi(struct mpic *mpic)
480{ 468{
481#if defined(CONFIG_XMON) && defined(CONFIG_PPC32) 469#if defined(CONFIG_XMON) && defined(CONFIG_PPC32)
@@ -526,7 +514,6 @@ static int __init pmac_pic_probe_mpic(void)
526{ 514{
527 struct mpic *mpic1, *mpic2; 515 struct mpic *mpic1, *mpic2;
528 struct device_node *np, *master = NULL, *slave = NULL; 516 struct device_node *np, *master = NULL, *slave = NULL;
529 unsigned int cascade;
530 517
531 /* We can have up to 2 MPICs cascaded */ 518 /* We can have up to 2 MPICs cascaded */
532 for (np = NULL; (np = of_find_node_by_type(np, "open-pic")) 519 for (np = NULL; (np = of_find_node_by_type(np, "open-pic"))
@@ -562,27 +549,14 @@ static int __init pmac_pic_probe_mpic(void)
562 549
563 of_node_put(master); 550 of_node_put(master);
564 551
565 /* No slave, let's go out */ 552 /* Set up a cascaded controller, if present */
566 if (slave == NULL) 553 if (slave) {
567 return 0; 554 mpic2 = pmac_setup_one_mpic(slave, 0);
568 555 if (mpic2 == NULL)
569 /* Get/Map slave interrupt */ 556 printk(KERN_ERR "Failed to setup slave MPIC\n");
570 cascade = irq_of_parse_and_map(slave, 0);
571 if (cascade == NO_IRQ) {
572 printk(KERN_ERR "Failed to map cascade IRQ\n");
573 return 0;
574 }
575
576 mpic2 = pmac_setup_one_mpic(slave, 0);
577 if (mpic2 == NULL) {
578 printk(KERN_ERR "Failed to setup slave MPIC\n");
579 of_node_put(slave); 557 of_node_put(slave);
580 return 0;
581 } 558 }
582 irq_set_handler_data(cascade, mpic2);
583 irq_set_chained_handler(cascade, pmac_u3_cascade);
584 559
585 of_node_put(slave);
586 return 0; 560 return 0;
587} 561}
588 562