summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/irq_fixup.c
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2013-09-17 07:14:04 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-09-18 09:16:45 +0200
commitdc27fc1e80f7000cce574d7c71a2024ae1d7f925 (patch)
tree09b312f61bd3f8d07d78ab4f98a8be6e75d5a8cc /arch/arm/mach-at91/irq_fixup.c
parentf0b68f0008f94606f6b927590d1fafb34b1abc55 (diff)
downloadbarebox-dc27fc1e80f7000cce574d7c71a2024ae1d7f925.tar.gz
barebox-dc27fc1e80f7000cce574d7c71a2024ae1d7f925.tar.xz
at91: add irq fixup
Some of the irq can still be on after a reset or power on as the IP are powered by the backup power. This could lead to an interrupt dead lock when the kernel boot. So disable them before booting. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Cc: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
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);
+}