aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2006-11-11 01:24:58 -0500
committerPaul Mackerras <paulus@samba.org>2006-12-04 00:08:46 -0500
commit21fb5a1d9f554970c680b801ba32184bc7c34aa0 (patch)
tree64ef24883be6e92e46327d681efa9cc622a5465c
parenta959ff56bbf07954ea4fa1cf72f99a38795eadb3 (diff)
[POWERPC] Native cell support for MPIC in southbridge
Add support for southbridges using the MPIC interrupt controller to the native cell platforms. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r--arch/powerpc/Kconfig1
-rw-r--r--arch/powerpc/platforms/cell/setup.c44
2 files changed, 45 insertions, 0 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 0e564d30fc46..65588a6bd2fe 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -469,6 +469,7 @@ config PPC_CELL_NATIVE
469 bool 469 bool
470 select PPC_CELL 470 select PPC_CELL
471 select PPC_DCR_MMIO 471 select PPC_DCR_MMIO
472 select MPIC
472 default n 473 default n
473 474
474config PPC_IBM_CELL_BLADE 475config PPC_IBM_CELL_BLADE
diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c
index 1944bb413f04..13f628def363 100644
--- a/arch/powerpc/platforms/cell/setup.c
+++ b/arch/powerpc/platforms/cell/setup.c
@@ -50,6 +50,7 @@
50#include <asm/spu.h> 50#include <asm/spu.h>
51#include <asm/spu_priv1.h> 51#include <asm/spu_priv1.h>
52#include <asm/udbg.h> 52#include <asm/udbg.h>
53#include <asm/mpic.h>
53 54
54#include "interrupt.h" 55#include "interrupt.h"
55#include "iommu.h" 56#include "iommu.h"
@@ -80,10 +81,53 @@ static void cell_progress(char *s, unsigned short hex)
80 printk("*** %04x : %s\n", hex, s ? s : ""); 81 printk("*** %04x : %s\n", hex, s ? s : "");
81} 82}
82 83
84static void cell_mpic_cascade(unsigned int irq, struct irq_desc *desc)
85{
86 struct mpic *mpic = desc->handler_data;
87 unsigned int virq;
88
89 virq = mpic_get_one_irq(mpic);
90 if (virq != NO_IRQ)
91 generic_handle_irq(virq);
92 desc->chip->eoi(irq);
93}
94
95static void __init mpic_init_IRQ(void)
96{
97 struct device_node *dn;
98 struct mpic *mpic;
99 unsigned int virq;
100
101 for (dn = NULL;
102 (dn = of_find_node_by_name(dn, "interrupt-controller"));) {
103 if (!device_is_compatible(dn, "CBEA,platform-open-pic"))
104 continue;
105
106 /* The MPIC driver will get everything it needs from the
107 * device-tree, just pass 0 to all arguments
108 */
109 mpic = mpic_alloc(dn, 0, 0, 0, 0, " MPIC ");
110 if (mpic == NULL)
111 continue;
112 mpic_init(mpic);
113
114 virq = irq_of_parse_and_map(dn, 0);
115 if (virq == NO_IRQ)
116 continue;
117
118 printk(KERN_INFO "%s : hooking up to IRQ %d\n",
119 dn->full_name, virq);
120 set_irq_data(virq, mpic);
121 set_irq_chained_handler(virq, cell_mpic_cascade);
122 }
123}
124
125
83static void __init cell_init_irq(void) 126static void __init cell_init_irq(void)
84{ 127{
85 iic_init_IRQ(); 128 iic_init_IRQ();
86 spider_init_IRQ(); 129 spider_init_IRQ();
130 mpic_init_IRQ();
87} 131}
88 132
89static void __init cell_setup_arch(void) 133static void __init cell_setup_arch(void)