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 | ||||
-rw-r--r-- | drivers/irqchip/irq-atmel-aic.c | 26 |
3 files changed, 49 insertions, 5 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 */ |
diff --git a/drivers/irqchip/irq-atmel-aic.c b/drivers/irqchip/irq-atmel-aic.c index 27fdd8c3e7b4..dae3604b32a9 100644 --- a/drivers/irqchip/irq-atmel-aic.c +++ b/drivers/irqchip/irq-atmel-aic.c | |||
@@ -209,16 +209,32 @@ static const struct irq_domain_ops aic_irq_ops = { | |||
209 | .xlate = aic_irq_domain_xlate, | 209 | .xlate = aic_irq_domain_xlate, |
210 | }; | 210 | }; |
211 | 211 | ||
212 | static void __init at91sam9_aic_irq_fixup(struct device_node *root) | 212 | static void __init at91rm9200_aic_irq_fixup(struct device_node *root) |
213 | { | 213 | { |
214 | aic_common_rtc_irq_fixup(root); | 214 | aic_common_rtc_irq_fixup(root); |
215 | } | 215 | } |
216 | 216 | ||
217 | static void __init at91sam9260_aic_irq_fixup(struct device_node *root) | ||
218 | { | ||
219 | aic_common_rtt_irq_fixup(root); | ||
220 | } | ||
221 | |||
222 | static void __init at91sam9g45_aic_irq_fixup(struct device_node *root) | ||
223 | { | ||
224 | aic_common_rtc_irq_fixup(root); | ||
225 | aic_common_rtt_irq_fixup(root); | ||
226 | } | ||
227 | |||
217 | static const struct of_device_id __initdata aic_irq_fixups[] = { | 228 | static const struct of_device_id __initdata aic_irq_fixups[] = { |
218 | { .compatible = "atmel,at91sam9g45", .data = at91sam9_aic_irq_fixup }, | 229 | { .compatible = "atmel,at91rm9200", .data = at91rm9200_aic_irq_fixup }, |
219 | { .compatible = "atmel,at91sam9n12", .data = at91sam9_aic_irq_fixup }, | 230 | { .compatible = "atmel,at91sam9g45", .data = at91sam9g45_aic_irq_fixup }, |
220 | { .compatible = "atmel,at91sam9rl", .data = at91sam9_aic_irq_fixup }, | 231 | { .compatible = "atmel,at91sam9n12", .data = at91rm9200_aic_irq_fixup }, |
221 | { .compatible = "atmel,at91sam9x5", .data = at91sam9_aic_irq_fixup }, | 232 | { .compatible = "atmel,at91sam9rl", .data = at91sam9g45_aic_irq_fixup }, |
233 | { .compatible = "atmel,at91sam9x5", .data = at91rm9200_aic_irq_fixup }, | ||
234 | { .compatible = "atmel,at91sam9260", .data = at91sam9260_aic_irq_fixup }, | ||
235 | { .compatible = "atmel,at91sam9261", .data = at91sam9260_aic_irq_fixup }, | ||
236 | { .compatible = "atmel,at91sam9263", .data = at91sam9260_aic_irq_fixup }, | ||
237 | { .compatible = "atmel,at91sam9g20", .data = at91sam9260_aic_irq_fixup }, | ||
222 | { /* sentinel */ }, | 238 | { /* sentinel */ }, |
223 | }; | 239 | }; |
224 | 240 | ||