From: Michael Trimarchi Date: Tue, 15 Mar 2011 12:27:17 +0100 Subject: [U-Boot] [PATCH AT91] Add watchdog reset to the at91samx SOC family Message-ID: <20110315112717.GA24904@gandalf.sssup.it> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de This patch add the watchdog reset function to the atmel atsam9x architectures. Signed-off-by: Michael Trimarchi Cc: Reinhard Meyer --- diff --git a/arch/arm/cpu/arm926ejs/at91/timer.c b/arch/arm/cpu/arm926ejs/at91/timer.c index 82b8d7e..2e4ff02 100644 --- a/arch/arm/cpu/arm926ejs/at91/timer.c +++ b/arch/arm/cpu/arm926ejs/at91/timer.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -139,3 +140,18 @@ ulong get_tbclk(void) { return gd->timer_rate_hz; } + +#if defined(CONFIG_WATCHDOG) + +void watchdog_reset(void) +{ + at91_wdt_t *wdt = (at91_wdt_t *) AT91_WDT_BASE; + int re_enable = disable_interrupts(); + + writel(AT91_WDT_CR_WDRSTT | AT91_WDT_CR_KEY, &wdt->cr); + + if (re_enable) + enable_interrupts(); +} + +#endif