irqchip: vic: Parse interrupt and resume masks from device tree
This patch extends vic_of_init to parse valid interrupt sources and resume sources masks from device tree. If mask values are not specified in device tree, all sources are assumed to be valid, as before this patch. Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com> Acked-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
This commit is contained in:
parent
66fcbe6b7c
commit
81e9c1794f
|
@ -18,6 +18,15 @@ Required properties:
|
||||||
Optional properties:
|
Optional properties:
|
||||||
|
|
||||||
- interrupts : Interrupt source for parent controllers if the VIC is nested.
|
- interrupts : Interrupt source for parent controllers if the VIC is nested.
|
||||||
|
- valid-mask : A one cell big bit mask of valid interrupt sources. Each bit
|
||||||
|
represents single interrupt source, starting from source 0 at LSb and ending
|
||||||
|
at source 31 at MSb. A bit that is set means that the source is wired and
|
||||||
|
clear means otherwise. If unspecified, defaults to all valid.
|
||||||
|
- valid-wakeup-mask : A one cell big bit mask of interrupt sources that can be
|
||||||
|
configured as wake up source for the system. Order of bits is the same as for
|
||||||
|
valid-mask property. A set bit means that this interrupt source can be
|
||||||
|
configured as a wake up source for the system. If unspecied, defaults to all
|
||||||
|
interrupt sources configurable as wake up sources.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
|
@ -26,4 +35,7 @@ Example:
|
||||||
interrupt-controller;
|
interrupt-controller;
|
||||||
#interrupt-cells = <1>;
|
#interrupt-cells = <1>;
|
||||||
reg = <0x60000 0x1000>;
|
reg = <0x60000 0x1000>;
|
||||||
|
|
||||||
|
valid-mask = <0xffffff7f>;
|
||||||
|
valid-wakeup-mask = <0x0000ff7f>;
|
||||||
};
|
};
|
||||||
|
|
|
@ -469,6 +469,8 @@ void __init vic_init(void __iomem *base, unsigned int irq_start,
|
||||||
int __init vic_of_init(struct device_node *node, struct device_node *parent)
|
int __init vic_of_init(struct device_node *node, struct device_node *parent)
|
||||||
{
|
{
|
||||||
void __iomem *regs;
|
void __iomem *regs;
|
||||||
|
u32 interrupt_mask = ~0;
|
||||||
|
u32 wakeup_mask = ~0;
|
||||||
|
|
||||||
if (WARN(parent, "non-root VICs are not supported"))
|
if (WARN(parent, "non-root VICs are not supported"))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -477,10 +479,13 @@ int __init vic_of_init(struct device_node *node, struct device_node *parent)
|
||||||
if (WARN_ON(!regs))
|
if (WARN_ON(!regs))
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
||||||
|
of_property_read_u32(node, "valid-mask", &interrupt_mask);
|
||||||
|
of_property_read_u32(node, "valid-wakeup-mask", &wakeup_mask);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Passing 0 as first IRQ makes the simple domain allocate descriptors
|
* Passing 0 as first IRQ makes the simple domain allocate descriptors
|
||||||
*/
|
*/
|
||||||
__vic_init(regs, 0, ~0, ~0, node);
|
__vic_init(regs, 0, interrupt_mask, wakeup_mask, node);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue