Lines Matching +full:ext +full:- +full:irq +full:- +full:range

1 // SPDX-License-Identifier: GPL-2.0-or-later
13 * - Fix various assumptions related to HW CPU numbers vs. linux CPU numbers
15 * - Implement proper handling of maxcpus=1/2 (that is, routing of irqs from
16 * a non-active node to the active node)
20 #include <linux/irq.h>
33 #include <asm/cell-regs.h>
49 /* Convert between "pending" bits and hw irq number */
74 out_be64(&iic->regs->prio, iic->eoi_stack[--iic->eoi_ptr]); in iic_eoi()
75 BUG_ON(iic->eoi_ptr < 0); in iic_eoi()
79 .name = "CELL-IIC",
95 unsigned int irq = irq_desc_get_irq(desc); in iic_ioexc_cascade() local
96 unsigned int base = (irq & 0xffffff00) | IIC_IRQ_TYPE_IOEXC; in iic_ioexc_cascade()
101 bits = in_be64(&node_iic->iic_is); in iic_ioexc_cascade()
104 /* pre-ack edge interrupts */ in iic_ioexc_cascade()
107 out_be64(&node_iic->iic_is, ack); in iic_ioexc_cascade()
109 for (cascade = 63; cascade >= 0; cascade--) in iic_ioexc_cascade()
113 /* post-ack level interrupts */ in iic_ioexc_cascade()
116 out_be64(&node_iic->iic_is, ack); in iic_ioexc_cascade()
118 chip->irq_eoi(&desc->irq_data); in iic_ioexc_cascade()
123 .name = "CELL-IOEX",
129 /* Get an IRQ number from the pending state register of the IIC */
138 in_be64((u64 __iomem *) &iic->regs->pending_destr); in iic_get_irq()
144 iic->eoi_stack[++iic->eoi_ptr] = pending.prio; in iic_get_irq()
145 BUG_ON(iic->eoi_ptr > 15); in iic_get_irq()
151 out_be64(&this_cpu_ptr(&cpu_iic)->regs->prio, 0xff); in iic_setup_cpu()
166 return IIC_IRQ_TYPE_IPI + 0xf - msg; in iic_msg_to_irq()
171 out_be64(&per_cpu(cpu_iic, cpu).regs->generate, (0xf - msg) << 4); in iic_message_pass()
187 * the error. If a message is not needed it will return non-zero. in iic_request_ipi()
208 "IBM,CBEA-Internal-Interrupt-Controller"); in iic_host_match()
233 unsigned int node, ext, unit, class; in iic_host_xlate() local
237 "IBM,CBEA-Internal-Interrupt-Controller")) in iic_host_xlate()
238 return -ENODEV; in iic_host_xlate()
240 return -ENODEV; in iic_host_xlate()
241 val = of_get_property(ct, "#interrupt-cells", NULL); in iic_host_xlate()
243 return -ENODEV; in iic_host_xlate()
246 ext = (intspec[0] >> 16) & 0xff; in iic_host_xlate()
250 /* Check if node is in supported range */ in iic_host_xlate()
252 return -EINVAL; in iic_host_xlate()
257 *out_hwirq |= IIC_IRQ_TYPE_IOEXC | ext; in iic_host_xlate()
282 iic->regs = ioremap(addr, sizeof(struct cbe_iic_thread_regs)); in init_one_iic()
283 BUG_ON(iic->regs == NULL); in init_one_iic()
285 iic->target_id = ((hw_cpu & 2) << 3) | ((hw_cpu & 1) ? 0xf : 0xe); in init_one_iic()
286 iic->eoi_stack[0] = 0xff; in init_one_iic()
287 iic->node = of_node_get(node); in init_one_iic()
288 out_be64(&iic->regs->prio, 0); in init_one_iic()
291 hw_cpu, iic->target_id, node); in init_one_iic()
302 for_each_node_by_name(dn, "interrupt-controller") { in setup_iic()
304 "IBM,CBEA-Internal-Interrupt-Controller")) in setup_iic()
306 np = of_get_property(dn, "ibm,interrupt-server-ranges", NULL); in setup_iic()
310 return -ENODEV; in setup_iic()
316 return -ENODEV; in setup_iic()
341 out_be64(&node_iic->iic_ir, in setup_iic()
348 out_be64(&node_iic->iic_is, 0xfffffffffffffffful); in setup_iic()
354 return -ENODEV; in setup_iic()
359 /* Setup an irq host data structure */ in iic_init_IRQ()
389 out_be64(&iic_regs->iic_ir, iic_ir); in iic_set_interrupt_routing()