]> err.no Git - linux-2.6/blobdiff - arch/powerpc/platforms/cell/interrupt.c
Pull thermal into release branch
[linux-2.6] / arch / powerpc / platforms / cell / interrupt.c
index 434fb934dd20afe7c6fcf206641f413b1b464606..47264e7220295f9484f6f9adfdb4031072bf45ed 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;
@@ -228,7 +227,7 @@ void iic_request_IPIs(void)
 
 static int iic_host_match(struct irq_host *h, struct device_node *node)
 {
-       return device_is_compatible(node,
+       return of_device_is_compatible(node,
                                    "IBM,CBEA-Internal-Interrupt-Controller");
 }
 
@@ -257,12 +256,12 @@ static int iic_host_xlate(struct irq_host *h, struct device_node *ct,
        unsigned int node, ext, unit, class;
        const u32 *val;
 
-       if (!device_is_compatible(ct,
+       if (!of_device_is_compatible(ct,
                                     "IBM,CBEA-Internal-Interrupt-Controller"))
                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;
 
@@ -325,10 +324,10 @@ static int __init setup_iic(void)
 
        for (dn = NULL;
             (dn = of_find_node_by_name(dn,"interrupt-controller")) != NULL;) {
-               if (!device_is_compatible(dn,
+               if (!of_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);
+}