From patchwork Tue Mar 15 11:27:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: michael X-Patchwork-Id: 86942 X-Patchwork-Delegate: info@emk-elektronik.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 02F02B7010 for ; Tue, 15 Mar 2011 22:25:41 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1E792280AA; Tue, 15 Mar 2011 12:25:37 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 20vPuRSNi48T; Tue, 15 Mar 2011 12:25:36 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BD27628090; Tue, 15 Mar 2011 12:25:34 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 261A128090 for ; Tue, 15 Mar 2011 12:25:33 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KJt6A14kbVFa for ; Tue, 15 Mar 2011 12:25:32 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from sssup.it (ms01.sssup.it [193.205.80.99]) by theia.denx.de (Postfix) with ESMTP id 4728928088 for ; Tue, 15 Mar 2011 12:25:29 +0100 (CET) Received: from [10.30.3.72] (HELO smaug.retis) by sssup.it (CommuniGate Pro SMTP 5.3.10) with ESMTP id 67697641; Tue, 15 Mar 2011 12:25:29 +0100 Received: by smaug.retis (Postfix, from userid 1006) id 318835B76F; Tue, 15 Mar 2011 12:27:17 +0100 (CET) Date: Tue, 15 Mar 2011 12:27:17 +0100 From: Michael Trimarchi To: u-boot@lists.denx.de Message-ID: <20110315112717.GA24904@gandalf.sssup.it> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Subject: [U-Boot] [PATCH AT91] Add watchdog reset to the at91samx SOC family X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@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