From patchwork Fri Mar 20 22:16:28 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Retanubun X-Patchwork-Id: 71657 X-Patchwork-Delegate: jason.jin@freescale.com Return-Path: X-Original-To: wd@gemini.denx.de Delivered-To: wd@gemini.denx.de Received: from diddl.denx.de (diddl.denx.de [10.0.0.6]) by gemini.denx.de (Postfix) with ESMTP id 7FB45832E406 for ; Fri, 20 Mar 2009 23:18:59 +0100 (CET) Received: from diddl.denx.de (localhost.localdomain [127.0.0.1]) by diddl.denx.de (Postfix) with ESMTP id 6861DC3CCB50 for ; Fri, 20 Mar 2009 23:18:59 +0100 (CET) Received: from pop.mnet-online.de by diddl.denx.de with POP3 (fetchmail-6.3.8) for (single-drop); Fri, 20 Mar 2009 23:18:59 +0100 (CET) Received: from murder (svr19.m-online.net [192.168.3.147]) by backend2 (Cyrus v2.2.12) with LMTPA; Fri, 20 Mar 2009 23:16:49 +0100 X-Sieve: CMU Sieve 2.2 Received: from mail.m-online.net (localhost [127.0.0.1]) by frontend3.pop.m-online.net (Cyrus v2.2.13) with LMTPA; Fri, 20 Mar 2009 23:16:48 +0100 Received: from scanner-4.m-online.net (scanner-4.m-online.net [192.168.1.18]) by mail.m-online.net (Postfix) with ESMTP id E604920009C; Fri, 20 Mar 2009 23:16:48 +0100 (CET) Received: from mxin-1.m-online.net ([192.168.2.222]) by scanner-4.m-online.net (scanner-4.m-online.net [192.168.1.18]) (amavisd-new, port 10026) with ESMTP id 26869-01; Fri, 20 Mar 2009 23:19:43 +0100 (CET) Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by mxin-1.m-online.net (Postfix) with ESMTP id 5D6C646C0A6; Fri, 20 Mar 2009 23:18:58 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CA39F281C5; Fri, 20 Mar 2009 23:16:41 +0100 (CET) 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 sX+FLQ9wDoIe; Fri, 20 Mar 2009 23:16:41 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4F67F281C7; Fri, 20 Mar 2009 23:16:37 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0E54A281C0 for ; Fri, 20 Mar 2009 23:16:35 +0100 (CET) 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 0kZ-5eYyd7Am for ; Fri, 20 Mar 2009 23:16:32 +0100 (CET) Received: from mail.ruggedcom.com (mail.ruggedcom.com [204.50.190.93]) by theia.denx.de (Postfix) with ESMTP id 04C24281BE for ; Fri, 20 Mar 2009 23:16:30 +0100 (CET) Received: from rceng01.eng.lan ([10.128.10.1]) by mail.ruggedcom.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 20 Mar 2009 18:20:35 -0400 Received: from rcws-214.eng.lan (unknown [10.128.10.74]) by rceng01.eng.lan (Postfix) with ESMTP id 0EC2414E66F; Fri, 20 Mar 2009 18:16:29 -0400 (EDT) Received: from localhost ([127.0.0.1] ident=richardretanubun) by rcws-214.eng.lan with esmtp (Exim 4.69) (envelope-from ) id 1Lkn0v-0007DP-0s; Fri, 20 Mar 2009 18:16:29 -0400 Message-ID: <49C415BC.9080101@RuggedCom.com> Date: Fri, 20 Mar 2009 18:16:28 -0400 From: Richard Retanubun Organization: RuggedCom User-Agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: u-boot Mailing List X-OriginalArrivalTime: 20 Mar 2009 22:20:35.0430 (UTC) FILETIME=[17205860:01C9A9AA] Cc: John Rigby Subject: [U-Boot] [PATCH] Coldfire: interrupts: Add watchdog auto reset to dtimer_interrupt 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 X-Virus-Scanned: by amavisd-new at m-online.net From 8b6ff599fde043c89cf8e5163635e2bc6dce6787 Mon Sep 17 00:00:00 2001 From: Richard Retanubun Date: Fri, 20 Mar 2009 15:30:10 -0400 Subject: [PATCH] Adds WATCHDOG_RESET() function call to lib_m68k dtimer_interrupt. Ported from lib_ppc/interrupts.c, this adds the ability for the coldfire system timer to auto-reset the watchdog when dtimer_interrupts is called. Signed-off-by: Richard Retanubun --- Hi TC & John This is the solution to the 2nd problem I found for my previous e-mail: Coldfire: MCF5271: Periodic HW watchdog petting and sleep function does not work This fixes the HW watchdog periodic auto-reset. The sleep function's cause I answered in the original thread, still hoping to get recommended values for CONFIG_SYS_TMRINTR_PRI, 0x09 seems to work ok. - Richard lib_m68k/time.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/lib_m68k/time.c b/lib_m68k/time.c index 697d67e..29269f6 100644 --- a/lib_m68k/time.c +++ b/lib_m68k/time.c @@ -27,10 +27,15 @@ #include #include +#include DECLARE_GLOBAL_DATA_PTR; -static ulong timestamp; +static volatile ulong timestamp = 0; + +#ifndef CONFIG_SYS_WATCHDOG_FREQ +#define CONFIG_SYS_WATCHDOG_FREQ (CONFIG_SYS_HZ / 2) +#endif #if defined(CONFIG_MCFTMR) #ifndef CONFIG_SYS_UDELAY_BASE @@ -76,6 +81,12 @@ void dtimer_interrupt(void *not_used) if ((CONFIG_SYS_TMRPND_REG & CONFIG_SYS_TMRINTR_MASK) == CONFIG_SYS_TMRINTR_PEND) { timerp->ter = (DTIM_DTER_CAP | DTIM_DTER_REF); timestamp++; + + #if defined(CONFIG_WATCHDOG) || defined (CONFIG_HW_WATCHDOG) + if ((timestamp % (CONFIG_SYS_WATCHDOG_FREQ)) == 0) { + WATCHDOG_RESET (); + } + #endif /* CONFIG_WATCHDOG || CONFIG_HW_WATCHDOG */ return; } }