diff options
Diffstat (limited to 'drivers/irqchip')
-rw-r--r-- | drivers/irqchip/irq-atmel-aic-common.c | 26 | ||||
-rw-r--r-- | drivers/irqchip/irq-atmel-aic-common.h | 2 |
2 files changed, 28 insertions, 0 deletions
diff --git a/drivers/irqchip/irq-atmel-aic-common.c b/drivers/irqchip/irq-atmel-aic-common.c index 6ae3cdee0681..656cfe336837 100644 --- a/drivers/irqchip/irq-atmel-aic-common.c +++ b/drivers/irqchip/irq-atmel-aic-common.c | |||
@@ -167,6 +167,32 @@ void __init aic_common_rtc_irq_fixup(struct device_node *root) | |||
167 | iounmap(regs); | 167 | iounmap(regs); |
168 | } | 168 | } |
169 | 169 | ||
170 | #define AT91_RTT_MR 0x00 /* Real-time Mode Register */ | ||
171 | #define AT91_RTT_ALMIEN (1 << 16) /* Alarm Interrupt Enable */ | ||
172 | #define AT91_RTT_RTTINCIEN (1 << 17) /* Real Time Timer Increment Interrupt Enable */ | ||
173 | |||
174 | void __init aic_common_rtt_irq_fixup(struct device_node *root) | ||
175 | { | ||
176 | struct device_node *np; | ||
177 | void __iomem *regs; | ||
178 | |||
179 | /* | ||
180 | * The at91sam9263 SoC has 2 instances of the RTT block, hence we | ||
181 | * iterate over the DT to find each occurrence. | ||
182 | */ | ||
183 | for_each_compatible_node(np, NULL, "atmel,at91sam9260-rtt") { | ||
184 | regs = of_iomap(np, 0); | ||
185 | if (!regs) | ||
186 | continue; | ||
187 | |||
188 | writel(readl(regs + AT91_RTT_MR) & | ||
189 | ~(AT91_RTT_ALMIEN | AT91_RTT_RTTINCIEN), | ||
190 | regs + AT91_RTT_MR); | ||
191 | |||
192 | iounmap(regs); | ||
193 | } | ||
194 | } | ||
195 | |||
170 | void __init aic_common_irq_fixup(const struct of_device_id *matches) | 196 | void __init aic_common_irq_fixup(const struct of_device_id *matches) |
171 | { | 197 | { |
172 | struct device_node *root = of_find_node_by_path("/"); | 198 | struct device_node *root = of_find_node_by_path("/"); |
diff --git a/drivers/irqchip/irq-atmel-aic-common.h b/drivers/irqchip/irq-atmel-aic-common.h index 90aa00e918d6..603f0a9d5411 100644 --- a/drivers/irqchip/irq-atmel-aic-common.h +++ b/drivers/irqchip/irq-atmel-aic-common.h | |||
@@ -34,6 +34,8 @@ struct irq_domain *__init aic_common_of_init(struct device_node *node, | |||
34 | 34 | ||
35 | void __init aic_common_rtc_irq_fixup(struct device_node *root); | 35 | void __init aic_common_rtc_irq_fixup(struct device_node *root); |
36 | 36 | ||
37 | void __init aic_common_rtt_irq_fixup(struct device_node *root); | ||
38 | |||
37 | void __init aic_common_irq_fixup(const struct of_device_id *matches); | 39 | void __init aic_common_irq_fixup(const struct of_device_id *matches); |
38 | 40 | ||
39 | #endif /* __IRQ_ATMEL_AIC_COMMON_H */ | 41 | #endif /* __IRQ_ATMEL_AIC_COMMON_H */ |