11 #include <linux/module.h>
17 #include <linux/slab.h>
21 #define NR_COMBINERS 4
22 #define NR_MUX_OUTPUTS 12
24 #define IRQ_UNMAPPED 0xffff
79 static void unmask_megamod(
struct irq_data *data)
81 struct megamod_pic *pic = irq_data_get_irq_chip_data(data);
90 static struct irq_chip megamod_chip = {
92 .irq_mask = mask_megamod,
93 .irq_unmask = unmask_megamod,
96 static void megamod_irq_cascade(
unsigned int irq,
struct irq_desc *
desc)
103 cascade = irq_desc_get_handler_data(desc);
106 idx = cascade->
index;
108 while ((events =
soc_readl(&pic->
regs->mevtflag[idx])) != 0) {
119 static int megamod_map(
struct irq_domain *
h,
unsigned int virq,
156 offset = (output & 3) * 8;
191 for (i = 0; i < maplen; i++) {
206 pr_info(
"Initializing C64x+ Megamodule PIC\n");
215 &megamod_domain_ops, pic);
235 parse_priority_map(pic, mapping,
ARRAY_SIZE(mapping));
255 pr_err(
"%s: combiner-%d no irq_data for virq %d!\n",
260 hwirq = irq_data->
hwirq;
267 pr_err(
"%s: combiner-%d core irq %ld out of range!\n",
273 mapping[hwirq - 4] =
i;
275 pr_debug(
"%s: combiner-%d cascading to hwirq %ld\n",
278 cascade_data[
i].pic = pic;
279 cascade_data[
i].index =
i;
286 irq_set_chained_handler(irq, megamod_irq_cascade);
292 pr_debug(
"%s: setting mux %d to priority %d\n",
294 set_megamod_mux(pic, mapping[i], i);
310 static int get_exception(
void)
320 return (i * 32) +
bit;
326 static void assert_event(
unsigned int val)
339 mm_pic = init_megamod_pic(np);