From patchwork Sun Sep 29 16:57:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anatolij Gustschin X-Patchwork-Id: 278876 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 06C252C00E0 for ; Mon, 30 Sep 2013 02:58:09 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1BB7E4A081; Sun, 29 Sep 2013 18:58:04 +0200 (CEST) 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 F+huoO5-12e6; Sun, 29 Sep 2013 18:58:03 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A15434A087; Sun, 29 Sep 2013 18:57:58 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4D1B24A087 for ; Sun, 29 Sep 2013 18:57:53 +0200 (CEST) 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 JjFCzMAccqEY for ; Sun, 29 Sep 2013 18:57:47 +0200 (CEST) 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 mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) by theia.denx.de (Postfix) with ESMTPS id 463CF4A081 for ; Sun, 29 Sep 2013 18:57:40 +0200 (CEST) Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3cntGC2Gbhz3hhVb; Sun, 29 Sep 2013 18:57:38 +0200 (CEST) X-Auth-Info: nL2ld1+/rv+0E1epTUwOPgMQuAYeCIpuYj5nfhexkj0= Received: from crub (pD9E2F52C.dip0.t-ipconnect.de [217.226.245.44]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA id 3cntGB1Sp8zbbcf; Sun, 29 Sep 2013 18:57:38 +0200 (CEST) Date: Sun, 29 Sep 2013 18:57:37 +0200 From: Anatolij Gustschin To: Otavio Salvador Message-ID: <20130929185737.076b7cdf@crub> In-Reply-To: References: X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; i686-pc-linux-gnu) Mime-Version: 1.0 Cc: U-Boot Mailing List Subject: Re: [U-Boot] i.MX6 based board does not work if watchdog support is enabled X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 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 Hi, On Sat, 28 Sep 2013 21:19:19 -0300 Otavio Salvador wrote: > I am trying to add support for watchdog in one board and it is not > working as expected. > > I did add the: > > #define CONFIG_HW_WATCHDOG > #define CONFIG_IMX_WATCHDOG > > into the board config file. > > Into the board .c file, I added: > > int board_late_init(void) > { > ... > #ifdef CONFIG_HW_WATCHDOG > hw_watchdog_init(); > #endif > > return 0; > } > > and the hw_watchdog_init is indeed called. > > It starts booting and shows: > > U-Boot 2013.10-rc3-00046-gc1c2434-dirty (Sep 28 2013 - 21:12:53) > > CPU: Freescale i.MX6Q rev1.2 at 792 MHz > Reset cause: WDOG > Board: yyyy > DRAM: 1 GiB > MMC: FSL_SDHC: 0, FSL_SDHC: 1 > In: serial > Out: serial > Err: serial > Net:� > > and it in fact resets. > > I am booting the board from USB loader. May it be an issue? No, it shouldn't be an issue. Does the attached patch help? Thanks, Anatolij From 394344a469ea18234adc8f611925e41bc532e230 Mon Sep 17 00:00:00 2001 From: Anatolij Gustschin Date: Tue, 16 Apr 2013 11:01:54 +0200 Subject: [PATCH] imx_watchdog: do not soft-reset while watchdog init Currently the driver clears WCR_SRS bit when enabling the watchdog and this causes a software reset. Do not clear WCR_SRS. Signed-off-by: Anatolij Gustschin --- drivers/watchdog/imx_watchdog.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/watchdog/imx_watchdog.c b/drivers/watchdog/imx_watchdog.c index 50e602a..d5993b4 100644 --- a/drivers/watchdog/imx_watchdog.c +++ b/drivers/watchdog/imx_watchdog.c @@ -19,6 +19,7 @@ struct watchdog_regs { #define WCR_WDBG 0x02 #define WCR_WDE 0x04 /* WDOG enable */ #define WCR_WDT 0x08 +#define WCR_SRS 0x10 #define WCR_WDW 0x80 #define SET_WCR_WT(x) (x << 8) @@ -45,7 +46,7 @@ void hw_watchdog_init(void) #define CONFIG_WATCHDOG_TIMEOUT_MSECS 128000 #endif timeout = (CONFIG_WATCHDOG_TIMEOUT_MSECS / 500) - 1; - writew(WCR_WDZST | WCR_WDBG | WCR_WDE | WCR_WDT | + writew(WCR_WDZST | WCR_WDBG | WCR_WDE | WCR_WDT | WCR_SRS | WCR_WDW | SET_WCR_WT(timeout), &wdog->wcr); hw_watchdog_reset(); } -- 1.7.9.5