]> err.no Git - linux-2.6/blobdiff - arch/powerpc/platforms/cell/interrupt.c
Merge branch 'for-2.6.22' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus...
[linux-2.6] / arch / powerpc / platforms / cell / interrupt.c
index 434fb934dd20afe7c6fcf206641f413b1b464606..4fc4e92775d0d1735ef1f0c38eec093b1a1e3a4d 100644 (file)
@@ -98,8 +98,7 @@ static void iic_ioexc_eoi(unsigned int irq)
 {
 }
 
-static void iic_ioexc_cascade(unsigned int irq, struct irq_desc *desc,
-                           struct pt_regs *regs)
+static void iic_ioexc_cascade(unsigned int irq, struct irq_desc *desc)
 {
        struct cbe_iic_regs __iomem *node_iic = (void __iomem *)desc->handler_data;
        unsigned int base = (irq & 0xffffff00) | IIC_IRQ_TYPE_IOEXC;
@@ -121,7 +120,7 @@ static void iic_ioexc_cascade(unsigned int irq, struct irq_desc *desc,
                                        irq_linear_revmap(iic_host,
                                                          base | cascade);
                                if (cirq != NO_IRQ)
-                                       generic_handle_irq(cirq, regs);
+                                       generic_handle_irq(cirq);
                        }
                /* post-ack level interrupts */
                ack = bits & ~IIC_ISR_EDGE_MASK;
@@ -140,7 +139,7 @@ static struct irq_chip iic_ioexc_chip = {
 };
 
 /* Get an IRQ number from the pending state register of the IIC */
-static unsigned int iic_get_irq(struct pt_regs *regs)
+static unsigned int iic_get_irq(void)
 {
        struct cbe_iic_pending_bits pending;
        struct iic *iic;
@@ -262,7 +261,7 @@ static int iic_host_xlate(struct irq_host *h, struct device_node *ct,
                return -ENODEV;
        if (intsize != 1)
                return -ENODEV;
-       val = get_property(ct, "#interrupt-cells", NULL);
+       val = of_get_property(ct, "#interrupt-cells", NULL);
        if (val == NULL || *val != 1)
                return -ENODEV;
 
@@ -328,7 +327,7 @@ static int __init setup_iic(void)
                if (!device_is_compatible(dn,
                                     "IBM,CBEA-Internal-Interrupt-Controller"))
                        continue;
-               np = get_property(dn, "ibm,interrupt-server-ranges", NULL);
+               np = of_get_property(dn, "ibm,interrupt-server-ranges", NULL);
                if (np == NULL) {
                        printk(KERN_WARNING "IIC: CPU association not found\n");
                        of_node_put(dn);
@@ -397,3 +396,19 @@ void __init iic_init_IRQ(void)
        /* Enable on current CPU */
        iic_setup_cpu();
 }
+
+void iic_set_interrupt_routing(int cpu, int thread, int priority)
+{
+       struct cbe_iic_regs __iomem *iic_regs = cbe_get_cpu_iic_regs(cpu);
+       u64 iic_ir = 0;
+       int node = cpu >> 1;
+
+       /* Set which node and thread will handle the next interrupt */
+       iic_ir |= CBE_IIC_IR_PRIO(priority) |
+                 CBE_IIC_IR_DEST_NODE(node);
+       if (thread == 0)
+               iic_ir |= CBE_IIC_IR_DEST_UNIT(CBE_IIC_IR_PT_0);
+       else
+               iic_ir |= CBE_IIC_IR_DEST_UNIT(CBE_IIC_IR_PT_1);
+       out_be64(&iic_regs->iic_ir, iic_ir);
+}