summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/irq_fixup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-at91/irq_fixup.c')
-rw-r--r--arch/arm/mach-at91/irq_fixup.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/irq_fixup.c b/arch/arm/mach-at91/irq_fixup.c
new file mode 100644
index 0000000000..a9eebd785b
--- /dev/null
+++ b/arch/arm/mach-at91/irq_fixup.c
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+ *
+ * Under GPLv2 only
+ */
+
+#include <io.h>
+#include <mach/at91_rtt.h>
+
+/*
+ * As the RTT is powered by the backup power so if the interrupt
+ * is still on when the kernel start, the kernel will end up with
+ * dead lock interrupt that it can not clear. Because the interrupt line is
+ * shared with the basic timer (PIT) on AT91_ID_SYS.
+ */
+void at91_rtt_irq_fixup(void *base)
+{
+ void *reg = base + AT91_RTT_MR;
+ u32 mr = readl(reg);
+
+ writel(mr & ~(AT91_RTT_ALMIEN | AT91_RTT_RTTINCIEN), reg);
+}