From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Babic Date: Tue, 20 Sep 2011 10:48:12 +0200 Subject: [U-Boot] [PATCH] MX31: Disable watchdog during low-power modes In-Reply-To: <201109200616.59531.marek.vasut@gmail.com> References: <1316454670-31278-1-git-send-email-fabio.estevam@freescale.com> <201109200616.59531.marek.vasut@gmail.com> Message-ID: <4E78534C.3080604@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 09/20/2011 06:16 AM, Marek Vasut wrote: > On Monday, September 19, 2011 07:51:10 PM Fabio Estevam wrote: >> Turn on the watchdog WDZST bit so that watchdog timer does not count during >> low power modes. >> >> Prior to applying this patch mx31pdk board got watchdog resets because when >> it booted in the Linux prompt and there was no activity, the system >> entered into idle mode while watchdog timer was still active. >> >> Fix this by disabling watchdog timer during idle mode. >> >> Signed-off-by: Fabio Estevam >> --- >> arch/arm/cpu/arm1136/mx31/timer.c | 4 ++-- >> arch/arm/include/asm/arch-mx31/imx-regs.h | 2 ++ >> 2 files changed, 4 insertions(+), 2 deletions(-) >> >> diff --git a/arch/arm/cpu/arm1136/mx31/timer.c >> b/arch/arm/cpu/arm1136/mx31/timer.c index c05a39d..7197108 100644 >> --- a/arch/arm/cpu/arm1136/mx31/timer.c >> +++ b/arch/arm/cpu/arm1136/mx31/timer.c >> @@ -173,8 +173,8 @@ void mxc_hw_watchdog_enable(void) >> #else >> secs = 64; >> #endif >> - writew(readw(&wdog->wcr) | (secs << WDOG_WT_SHIFT) | WDOG_ENABLE, >> - &wdog->wcr); >> + writew(readw(&wdog->wcr) | (secs << WDOG_WT_SHIFT) | WDOG_ENABLE >> + | WDOG_WDZST, &wdog->wcr); > > Maybe > tmp = readw(); > tmp |= ... > writel(tmp, ...); Well, I do not see a big difference with your proposal - so it is only a question of taste. Calling write with an embedded read as first parameter is used often in u-boot. Best regards, Stefano Babic -- ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de =====================================================================