summaryrefslogtreecommitdiff
path: root/recipes-bsp/at91bootstrap/at91bootstrap-3.8.12/0003-disable-rtc-interrupts.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-bsp/at91bootstrap/at91bootstrap-3.8.12/0003-disable-rtc-interrupts.patch')
-rw-r--r--recipes-bsp/at91bootstrap/at91bootstrap-3.8.12/0003-disable-rtc-interrupts.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/recipes-bsp/at91bootstrap/at91bootstrap-3.8.12/0003-disable-rtc-interrupts.patch b/recipes-bsp/at91bootstrap/at91bootstrap-3.8.12/0003-disable-rtc-interrupts.patch
new file mode 100644
index 0000000..d262972
--- /dev/null
+++ b/recipes-bsp/at91bootstrap/at91bootstrap-3.8.12/0003-disable-rtc-interrupts.patch
@@ -0,0 +1,32 @@
+diff -Naru orig/board/at91sam9x5ek/at91sam9x5ek.c new/board/at91sam9x5ek/at91sam9x5ek.c
+--- orig/board/at91sam9x5ek/at91sam9x5ek.c 2018-01-04 18:06:52.533763774 -0600
++++ new/board/at91sam9x5ek/at91sam9x5ek.c 2018-01-04 18:32:57.905717432 -0600
+@@ -44,6 +44,18 @@
+ #include "at91sam9x5ek.h"
+ #include "board_hw_info.h"
+
++#define RTC_SCCR 0x1C
++#define RTC_IDR 0x24
++
++static void at91_disable_rtc(void)
++{
++ /* disable all RTC interrupts and clear status register.
++ * Prevents possible Linux lockup due to unexpected RTC interrupt
++ */
++ writel(0xFF, RTC_IDR + AT91C_BASE_RTC);
++ writel(0xFF, RTC_SCCR + AT91C_BASE_RTC);
++}
++
+ static void at91_dbgu_hw_init(void)
+ {
+ /* Configure DBGU pins */
+@@ -161,6 +173,9 @@
+ #ifdef CONFIG_HW_INIT
+ void hw_init(void)
+ {
++ /* 1st chance to disable RTC */
++ at91_disable_rtc();
++
+ /* Disable watchdog */
+ at91_disable_wdt();
+