From 0c8e5e47e495732bd996eb3c0e9d7b20bd0a1c3b Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Sat, 11 Nov 2006 17:24:58 +1100 Subject: [PATCH] --- yaml --- r: 42217 b: refs/heads/master c: 21fb5a1d9f554970c680b801ba32184bc7c34aa0 h: refs/heads/master i: 42215: 7d50d52b5817ef01732e00815ec26fe12b4c5245 v: v3 --- [refs] | 2 +- trunk/arch/powerpc/Kconfig | 1 + trunk/arch/powerpc/platforms/cell/setup.c | 44 +++++++++++++++++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index dbeb01093e61..9542386b3c35 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a959ff56bbf07954ea4fa1cf72f99a38795eadb3 +refs/heads/master: 21fb5a1d9f554970c680b801ba32184bc7c34aa0 diff --git a/trunk/arch/powerpc/Kconfig b/trunk/arch/powerpc/Kconfig index 0e564d30fc46..65588a6bd2fe 100644 --- a/trunk/arch/powerpc/Kconfig +++ b/trunk/arch/powerpc/Kconfig @@ -469,6 +469,7 @@ config PPC_CELL_NATIVE bool select PPC_CELL select PPC_DCR_MMIO + select MPIC default n config PPC_IBM_CELL_BLADE diff --git a/trunk/arch/powerpc/platforms/cell/setup.c b/trunk/arch/powerpc/platforms/cell/setup.c index 1944bb413f04..13f628def363 100644 --- a/trunk/arch/powerpc/platforms/cell/setup.c +++ b/trunk/arch/powerpc/platforms/cell/setup.c @@ -50,6 +50,7 @@ #include #include #include +#include #include "interrupt.h" #include "iommu.h" @@ -80,10 +81,53 @@ static void cell_progress(char *s, unsigned short hex) printk("*** %04x : %s\n", hex, s ? s : ""); } +static void cell_mpic_cascade(unsigned int irq, struct irq_desc *desc) +{ + struct mpic *mpic = desc->handler_data; + unsigned int virq; + + virq = mpic_get_one_irq(mpic); + if (virq != NO_IRQ) + generic_handle_irq(virq); + desc->chip->eoi(irq); +} + +static void __init mpic_init_IRQ(void) +{ + struct device_node *dn; + struct mpic *mpic; + unsigned int virq; + + for (dn = NULL; + (dn = of_find_node_by_name(dn, "interrupt-controller"));) { + if (!device_is_compatible(dn, "CBEA,platform-open-pic")) + continue; + + /* The MPIC driver will get everything it needs from the + * device-tree, just pass 0 to all arguments + */ + mpic = mpic_alloc(dn, 0, 0, 0, 0, " MPIC "); + if (mpic == NULL) + continue; + mpic_init(mpic); + + virq = irq_of_parse_and_map(dn, 0); + if (virq == NO_IRQ) + continue; + + printk(KERN_INFO "%s : hooking up to IRQ %d\n", + dn->full_name, virq); + set_irq_data(virq, mpic); + set_irq_chained_handler(virq, cell_mpic_cascade); + } +} + + static void __init cell_init_irq(void) { iic_init_IRQ(); spider_init_IRQ(); + mpic_init_IRQ(); } static void __init cell_setup_arch(void)