From 4185315a9ad3d2ae0ee2fdb7e8f2f75a3f3c5e66 Mon Sep 17 00:00:00 2001 From: Boris BREZILLON Date: Mon, 3 Nov 2014 09:31:00 +0100 Subject: irqchip: atmel-aic: Add irq fixup for RTT block Signed-off-by: Boris BREZILLON Link: https://lkml.kernel.org/r/1415003464-29239-2-git-send-email-boris.brezillon@free-electrons.com Signed-off-by: Jason Cooper --- drivers/irqchip/irq-atmel-aic-common.c | 26 ++++++++++++++++++++++++++ drivers/irqchip/irq-atmel-aic-common.h | 2 ++ 2 files changed, 28 insertions(+) (limited to 'drivers/irqchip') 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) iounmap(regs); } +#define AT91_RTT_MR 0x00 /* Real-time Mode Register */ +#define AT91_RTT_ALMIEN (1 << 16) /* Alarm Interrupt Enable */ +#define AT91_RTT_RTTINCIEN (1 << 17) /* Real Time Timer Increment Interrupt Enable */ + +void __init aic_common_rtt_irq_fixup(struct device_node *root) +{ + struct device_node *np; + void __iomem *regs; + + /* + * The at91sam9263 SoC has 2 instances of the RTT block, hence we + * iterate over the DT to find each occurrence. + */ + for_each_compatible_node(np, NULL, "atmel,at91sam9260-rtt") { + regs = of_iomap(np, 0); + if (!regs) + continue; + + writel(readl(regs + AT91_RTT_MR) & + ~(AT91_RTT_ALMIEN | AT91_RTT_RTTINCIEN), + regs + AT91_RTT_MR); + + iounmap(regs); + } +} + void __init aic_common_irq_fixup(const struct of_device_id *matches) { 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, void __init aic_common_rtc_irq_fixup(struct device_node *root); +void __init aic_common_rtt_irq_fixup(struct device_node *root); + void __init aic_common_irq_fixup(const struct of_device_id *matches); #endif /* __IRQ_ATMEL_AIC_COMMON_H */ -- cgit v1.2.3 From ae25eac25181db4cf6e17f2497faaf8a34534839 Mon Sep 17 00:00:00 2001 From: Boris BREZILLON Date: Mon, 3 Nov 2014 09:31:01 +0100 Subject: irqchip: atmel-aic: Add irq fixups for at91sam926x SoCs The at91sam9260, at91sam9261, at91sam9263 and at91sam9g20 embed an RTT (Real Time Timer) block and thus need to call the aic_common_rtt_irq_fixup function. Signed-off-by: Boris BREZILLON Link: https://lkml.kernel.org/r/1415003464-29239-3-git-send-email-boris.brezillon@free-electrons.com Signed-off-by: Jason Cooper --- drivers/irqchip/irq-atmel-aic.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'drivers/irqchip') diff --git a/drivers/irqchip/irq-atmel-aic.c b/drivers/irqchip/irq-atmel-aic.c index 9a2cf3c1a3a5..637d6000712f 100644 --- a/drivers/irqchip/irq-atmel-aic.c +++ b/drivers/irqchip/irq-atmel-aic.c @@ -214,11 +214,20 @@ static void __init at91sam9_aic_irq_fixup(struct device_node *root) aic_common_rtc_irq_fixup(root); } +static void __init at91sam9260_aic_irq_fixup(struct device_node *root) +{ + aic_common_rtt_irq_fixup(root); +} + static const struct of_device_id __initdata aic_irq_fixups[] = { { .compatible = "atmel,at91sam9g45", .data = at91sam9_aic_irq_fixup }, { .compatible = "atmel,at91sam9n12", .data = at91sam9_aic_irq_fixup }, { .compatible = "atmel,at91sam9rl", .data = at91sam9_aic_irq_fixup }, { .compatible = "atmel,at91sam9x5", .data = at91sam9_aic_irq_fixup }, + { .compatible = "atmel,at91sam9260", .data = at91sam9260_aic_irq_fixup }, + { .compatible = "atmel,at91sam9261", .data = at91sam9260_aic_irq_fixup }, + { .compatible = "atmel,at91sam9263", .data = at91sam9260_aic_irq_fixup }, + { .compatible = "atmel,at91sam9g20", .data = at91sam9260_aic_irq_fixup }, { /* sentinel */ }, }; -- cgit v1.2.3 From f3b7bf1bd7e2f80498a638e9675b8a5ee61036ce Mon Sep 17 00:00:00 2001 From: Boris BREZILLON Date: Mon, 3 Nov 2014 09:31:02 +0100 Subject: irqchip: atmel-aic: Add specific irq fixup function for sam9g45 and sam9rl The at91sam9g45 and at91sam9rl SoCs embed one RTT (Real Time Timer) and one RTC block and thus need to call both rtt and rtc fixup functions. Signed-off-by: Boris BREZILLON Link: https://lkml.kernel.org/r/1415003464-29239-4-git-send-email-boris.brezillon@free-electrons.com Signed-off-by: Jason Cooper --- drivers/irqchip/irq-atmel-aic.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'drivers/irqchip') diff --git a/drivers/irqchip/irq-atmel-aic.c b/drivers/irqchip/irq-atmel-aic.c index 637d6000712f..d7b0495b1132 100644 --- a/drivers/irqchip/irq-atmel-aic.c +++ b/drivers/irqchip/irq-atmel-aic.c @@ -219,10 +219,16 @@ static void __init at91sam9260_aic_irq_fixup(struct device_node *root) aic_common_rtt_irq_fixup(root); } +static void __init at91sam9g45_aic_irq_fixup(struct device_node *root) +{ + aic_common_rtc_irq_fixup(root); + aic_common_rtt_irq_fixup(root); +} + static const struct of_device_id __initdata aic_irq_fixups[] = { - { .compatible = "atmel,at91sam9g45", .data = at91sam9_aic_irq_fixup }, + { .compatible = "atmel,at91sam9g45", .data = at91sam9g45_aic_irq_fixup }, { .compatible = "atmel,at91sam9n12", .data = at91sam9_aic_irq_fixup }, - { .compatible = "atmel,at91sam9rl", .data = at91sam9_aic_irq_fixup }, + { .compatible = "atmel,at91sam9rl", .data = at91sam9g45_aic_irq_fixup }, { .compatible = "atmel,at91sam9x5", .data = at91sam9_aic_irq_fixup }, { .compatible = "atmel,at91sam9260", .data = at91sam9260_aic_irq_fixup }, { .compatible = "atmel,at91sam9261", .data = at91sam9260_aic_irq_fixup }, -- cgit v1.2.3 From 624cba57269fb60f5bcaf39dec65416fe8dcfbac Mon Sep 17 00:00:00 2001 From: Boris BREZILLON Date: Mon, 3 Nov 2014 09:31:03 +0100 Subject: irqchip: atmel-aic: Rename at91sam9_aic_irq_fixup for naming consistency Rename at91sam9_aic_irq_fixup into at91rm9200_aic_irq_fixup to be consistent with other fixup functions. Signed-off-by: Boris BREZILLON Link: https://lkml.kernel.org/r/1415003464-29239-5-git-send-email-boris.brezillon@free-electrons.com Signed-off-by: Jason Cooper --- drivers/irqchip/irq-atmel-aic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/irqchip') diff --git a/drivers/irqchip/irq-atmel-aic.c b/drivers/irqchip/irq-atmel-aic.c index d7b0495b1132..6f011b4accfd 100644 --- a/drivers/irqchip/irq-atmel-aic.c +++ b/drivers/irqchip/irq-atmel-aic.c @@ -209,7 +209,7 @@ static const struct irq_domain_ops aic_irq_ops = { .xlate = aic_irq_domain_xlate, }; -static void __init at91sam9_aic_irq_fixup(struct device_node *root) +static void __init at91rm9200_aic_irq_fixup(struct device_node *root) { aic_common_rtc_irq_fixup(root); } @@ -227,9 +227,9 @@ static void __init at91sam9g45_aic_irq_fixup(struct device_node *root) static const struct of_device_id __initdata aic_irq_fixups[] = { { .compatible = "atmel,at91sam9g45", .data = at91sam9g45_aic_irq_fixup }, - { .compatible = "atmel,at91sam9n12", .data = at91sam9_aic_irq_fixup }, + { .compatible = "atmel,at91sam9n12", .data = at91rm9200_aic_irq_fixup }, { .compatible = "atmel,at91sam9rl", .data = at91sam9g45_aic_irq_fixup }, - { .compatible = "atmel,at91sam9x5", .data = at91sam9_aic_irq_fixup }, + { .compatible = "atmel,at91sam9x5", .data = at91rm9200_aic_irq_fixup }, { .compatible = "atmel,at91sam9260", .data = at91sam9260_aic_irq_fixup }, { .compatible = "atmel,at91sam9261", .data = at91sam9260_aic_irq_fixup }, { .compatible = "atmel,at91sam9263", .data = at91sam9260_aic_irq_fixup }, -- cgit v1.2.3 From 25963dbd076965521a0f79f9cf09707e6d1b51b3 Mon Sep 17 00:00:00 2001 From: Boris BREZILLON Date: Mon, 3 Nov 2014 09:31:04 +0100 Subject: irqchip: atmel-aic: Add missing entry for rm9200 irq fixups The at91rm9200 have an RTT block and thus must at91rm9200_aic_irq_fixup has to be called when initializing the irqchip. Signed-off-by: Boris BREZILLON Link: https://lkml.kernel.org/r/1415003464-29239-6-git-send-email-boris.brezillon@free-electrons.com Signed-off-by: Jason Cooper --- drivers/irqchip/irq-atmel-aic.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/irqchip') diff --git a/drivers/irqchip/irq-atmel-aic.c b/drivers/irqchip/irq-atmel-aic.c index 6f011b4accfd..a6398a517467 100644 --- a/drivers/irqchip/irq-atmel-aic.c +++ b/drivers/irqchip/irq-atmel-aic.c @@ -226,6 +226,7 @@ static void __init at91sam9g45_aic_irq_fixup(struct device_node *root) } static const struct of_device_id __initdata aic_irq_fixups[] = { + { .compatible = "atmel,at91rm9200", .data = at91rm9200_aic_irq_fixup }, { .compatible = "atmel,at91sam9g45", .data = at91sam9g45_aic_irq_fixup }, { .compatible = "atmel,at91sam9n12", .data = at91rm9200_aic_irq_fixup }, { .compatible = "atmel,at91sam9rl", .data = at91sam9g45_aic_irq_fixup }, -- cgit v1.2.3