提交 c6573943 编写于 作者: J Jean-Christophe PLAGNIOL-VILLARD 提交者: Nicolas Ferre

ARM: at91: aic add dt support for external irqs

Signed-off-by: NJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: NNicolas Ferre <nicolas.ferre@atmel.com>
上级 42a859da
...@@ -15,6 +15,7 @@ Required properties: ...@@ -15,6 +15,7 @@ Required properties:
Valid combinations are 1, 2, 3, 4, 8. Valid combinations are 1, 2, 3, 4, 8.
Default flag for internal sources should be set to 4 (active high). Default flag for internal sources should be set to 4 (active high).
- reg: Should contain AIC registers location and length - reg: Should contain AIC registers location and length
- atmel,external-irqs: u32 array of external irqs.
Examples: Examples:
/* /*
......
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
compatible = "atmel,at91rm9200-aic"; compatible = "atmel,at91rm9200-aic";
interrupt-controller; interrupt-controller;
reg = <0xfffff000 0x200>; reg = <0xfffff000 0x200>;
atmel,external-irqs = <29 30 31>;
}; };
ramc0: ramc@ffffea00 { ramc0: ramc@ffffea00 {
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
compatible = "atmel,at91rm9200-aic"; compatible = "atmel,at91rm9200-aic";
interrupt-controller; interrupt-controller;
reg = <0xfffff000 0x200>; reg = <0xfffff000 0x200>;
atmel,external-irqs = <30 31>;
}; };
pmc: pmc@fffffc00 { pmc: pmc@fffffc00 {
......
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
compatible = "atmel,at91rm9200-aic"; compatible = "atmel,at91rm9200-aic";
interrupt-controller; interrupt-controller;
reg = <0xfffff000 0x200>; reg = <0xfffff000 0x200>;
atmel,external-irqs = <31>;
}; };
ramc0: ramc@ffffe400 { ramc0: ramc@ffffe400 {
......
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
compatible = "atmel,at91rm9200-aic"; compatible = "atmel,at91rm9200-aic";
interrupt-controller; interrupt-controller;
reg = <0xfffff000 0x200>; reg = <0xfffff000 0x200>;
atmel,external-irqs = <31>;
}; };
ramc0: ramc@ffffe800 { ramc0: ramc@ffffe800 {
......
...@@ -312,8 +312,6 @@ static void __init at91sam9x5_map_io(void) ...@@ -312,8 +312,6 @@ static void __init at91sam9x5_map_io(void)
void __init at91sam9x5_initialize(void) void __init at91sam9x5_initialize(void)
{ {
at91_extern_irq = (1 << AT91SAM9X5_ID_IRQ0);
/* Register GPIO subsystem (using DT) */ /* Register GPIO subsystem (using DT) */
at91_gpio_init(NULL, 0); at91_gpio_init(NULL, 0);
} }
......
...@@ -194,6 +194,10 @@ static struct irq_domain_ops at91_aic_irq_ops = { ...@@ -194,6 +194,10 @@ static struct irq_domain_ops at91_aic_irq_ops = {
int __init at91_aic_of_init(struct device_node *node, int __init at91_aic_of_init(struct device_node *node,
struct device_node *parent) struct device_node *parent)
{ {
struct property *prop;
const __be32 *p;
u32 val;
at91_aic_base = of_iomap(node, 0); at91_aic_base = of_iomap(node, 0);
at91_aic_np = node; at91_aic_np = node;
...@@ -202,6 +206,14 @@ int __init at91_aic_of_init(struct device_node *node, ...@@ -202,6 +206,14 @@ int __init at91_aic_of_init(struct device_node *node,
if (!at91_aic_domain) if (!at91_aic_domain)
panic("Unable to add AIC irq domain (DT)\n"); panic("Unable to add AIC irq domain (DT)\n");
at91_extern_irq = 0;
of_property_for_each_u32(node, "atmel,external-irqs", prop, p, val) {
if (val > 31)
pr_warn("AIC: external irq %d > 31 skip it\n", val);
else
at91_extern_irq |= (1 << val);
}
irq_set_default_host(at91_aic_domain); irq_set_default_host(at91_aic_domain);
at91_aic_hw_init(NR_AIC_IRQS); at91_aic_hw_init(NR_AIC_IRQS);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册