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();