Hello,
This patch series add a new fixup function for the RTT (Real Time Timer)
block and make use of it on SoCs integrating at least one RTT to prevent
spurious interrupts on the first interrupt line.
This fixup function was previously implemented in
arch/arm/mach-at91/sysirq_mask.c, but is now moved to the AIC driver so
that we can remove SoC specific hooks in arch/arm/mach-at91/ when booting
a DT kernel.
This series also reworks the naming convention of the SoC specific fixup
functions and add an entry for the at91rm9200.
Best Regards,
Boris
Changes since v1:
- rebased on linux-3.18-rc2
Boris BREZILLON (5):
irqchip: atmel-aic: add irq fixup for RTT block
irqchip: atmel-aic: add irq fixups for at91sam926x SoCs
irqchip: atmel-aic: add specific irq fixup function for sam9g45 and
sam9rl
irqchip: atmel-aic: rename at91sam9_aic_irq_fixup for naming
consistency
irqchip: atmel-aic: add missing entry for rm9200 irq fixups
drivers/irqchip/irq-atmel-aic-common.c | 26 ++++++++++++++++++++++++++
drivers/irqchip/irq-atmel-aic-common.h | 2 ++
drivers/irqchip/irq-atmel-aic.c | 26 +++++++++++++++++++++-----
3 files changed, 49 insertions(+), 5 deletions(-)
--
1.9.1
From: Boris BREZILLON <[email protected]>
Signed-off-by: Boris BREZILLON <[email protected]>
---
drivers/irqchip/irq-atmel-aic-common.c | 26 ++++++++++++++++++++++++++
drivers/irqchip/irq-atmel-aic-common.h | 2 ++
2 files changed, 28 insertions(+)
diff --git a/drivers/irqchip/irq-atmel-aic-common.c b/drivers/irqchip/irq-atmel-aic-common.c
index 6ae3cdee..656cfe3 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 90aa00e..603f0a9 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 */
--
1.9.1
From: Boris BREZILLON <[email protected]>
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 <[email protected]>
---
drivers/irqchip/irq-atmel-aic.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/irqchip/irq-atmel-aic.c b/drivers/irqchip/irq-atmel-aic.c
index 9a2cf3c..637d600 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 */ },
};
--
1.9.1
From: Boris BREZILLON <[email protected]>
Rename at91sam9_aic_irq_fixup into at91rm9200_aic_irq_fixup to be
consistent with other fixup functions.
Signed-off-by: Boris BREZILLON <[email protected]>
---
drivers/irqchip/irq-atmel-aic.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/irqchip/irq-atmel-aic.c b/drivers/irqchip/irq-atmel-aic.c
index d7b0495..6f011b4 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 },
--
1.9.1
From: Boris BREZILLON <[email protected]>
The at91rm9200 have an RTT block and thus must at91rm9200_aic_irq_fixup
has to be called when intialazing the irqchip.
Signed-off-by: Boris BREZILLON <[email protected]>
---
drivers/irqchip/irq-atmel-aic.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/irqchip/irq-atmel-aic.c b/drivers/irqchip/irq-atmel-aic.c
index 6f011b4..a6398a5 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 },
--
1.9.1
From: Boris BREZILLON <[email protected]>
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 <[email protected]>
---
drivers/irqchip/irq-atmel-aic.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/irqchip/irq-atmel-aic.c b/drivers/irqchip/irq-atmel-aic.c
index 637d600..d7b0495 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 },
--
1.9.1
On Mon, Nov 03, 2014 at 09:30:59AM +0100, Boris Brezillon wrote:
> Hello,
>
> This patch series add a new fixup function for the RTT (Real Time Timer)
> block and make use of it on SoCs integrating at least one RTT to prevent
> spurious interrupts on the first interrupt line.
>
> This fixup function was previously implemented in
> arch/arm/mach-at91/sysirq_mask.c, but is now moved to the AIC driver so
> that we can remove SoC specific hooks in arch/arm/mach-at91/ when booting
> a DT kernel.
>
> This series also reworks the naming convention of the SoC specific fixup
> functions and add an entry for the at91rm9200.
>
> Best Regards,
>
> Boris
>
> Changes since v1:
> - rebased on linux-3.18-rc2
>
> Boris BREZILLON (5):
> irqchip: atmel-aic: add irq fixup for RTT block
> irqchip: atmel-aic: add irq fixups for at91sam926x SoCs
> irqchip: atmel-aic: add specific irq fixup function for sam9g45 and
> sam9rl
> irqchip: atmel-aic: rename at91sam9_aic_irq_fixup for naming
> consistency
> irqchip: atmel-aic: add missing entry for rm9200 irq fixups
>
> drivers/irqchip/irq-atmel-aic-common.c | 26 ++++++++++++++++++++++++++
> drivers/irqchip/irq-atmel-aic-common.h | 2 ++
> drivers/irqchip/irq-atmel-aic.c | 26 +++++++++++++++++++++-----
> 3 files changed, 49 insertions(+), 5 deletions(-)
Whole series applied to irqchip/atmel
thx,
Jason.
On 09/11/2014 05:55, Jason Cooper :
> On Mon, Nov 03, 2014 at 09:30:59AM +0100, Boris Brezillon wrote:
>> Hello,
>>
>> This patch series add a new fixup function for the RTT (Real Time Timer)
>> block and make use of it on SoCs integrating at least one RTT to prevent
>> spurious interrupts on the first interrupt line.
>>
>> This fixup function was previously implemented in
>> arch/arm/mach-at91/sysirq_mask.c, but is now moved to the AIC driver so
>> that we can remove SoC specific hooks in arch/arm/mach-at91/ when booting
>> a DT kernel.
>>
>> This series also reworks the naming convention of the SoC specific fixup
>> functions and add an entry for the at91rm9200.
>>
>> Best Regards,
>>
>> Boris
>>
>> Changes since v1:
>> - rebased on linux-3.18-rc2
>>
>> Boris BREZILLON (5):
>> irqchip: atmel-aic: add irq fixup for RTT block
>> irqchip: atmel-aic: add irq fixups for at91sam926x SoCs
>> irqchip: atmel-aic: add specific irq fixup function for sam9g45 and
>> sam9rl
>> irqchip: atmel-aic: rename at91sam9_aic_irq_fixup for naming
>> consistency
>> irqchip: atmel-aic: add missing entry for rm9200 irq fixups
>>
>> drivers/irqchip/irq-atmel-aic-common.c | 26 ++++++++++++++++++++++++++
>> drivers/irqchip/irq-atmel-aic-common.h | 2 ++
>> drivers/irqchip/irq-atmel-aic.c | 26 +++++++++++++++++++++-----
>> 3 files changed, 49 insertions(+), 5 deletions(-)
>
> Whole series applied to irqchip/atmel
Too late but for the record:
Acked-by: Nicolas Ferre <[email protected]>
There are a little tiny details that I can solve later (function names,
order of SoCs, etc.).
Bye,
--
Nicolas Ferre