Skip to content

Commit

Permalink
irqchip: vic: Support cascaded VIC in device tree
Browse files Browse the repository at this point in the history
When transitioning some elder platforms to device tree it
becomes necessary to cascade VIC IRQ chips off another
interrupt controller.

Tested with the cascaded VIC on the Integrator/AP attached
logic module IM-PD1.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20200219153543.137153-1-linus.walleij@linaro.org
  • Loading branch information
Linus Walleij authored and Marc Zyngier committed Mar 8, 2020
1 parent 98d54f8 commit a151110
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/irqchip/irq-vic.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,21 +509,22 @@ static int __init vic_of_init(struct device_node *node,
void __iomem *regs;
u32 interrupt_mask = ~0;
u32 wakeup_mask = ~0;

if (WARN(parent, "non-root VICs are not supported"))
return -EINVAL;
int parent_irq;

regs = of_iomap(node, 0);
if (WARN_ON(!regs))
return -EIO;

of_property_read_u32(node, "valid-mask", &interrupt_mask);
of_property_read_u32(node, "valid-wakeup-mask", &wakeup_mask);
parent_irq = of_irq_get(node, 0);
if (parent_irq < 0)
parent_irq = 0;

/*
* Passing 0 as first IRQ makes the simple domain allocate descriptors
*/
__vic_init(regs, 0, 0, interrupt_mask, wakeup_mask, node);
__vic_init(regs, parent_irq, 0, interrupt_mask, wakeup_mask, node);

return 0;
}
Expand Down

0 comments on commit a151110

Please sign in to comment.