public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] MX31: Disable watchdog during low-power modes
Date: Tue, 20 Sep 2011 11:24:26 +0200	[thread overview]
Message-ID: <201109201124.27034.marek.vasut@gmail.com> (raw)
In-Reply-To: <4E78534C.3080604@denx.de>

On Tuesday, September 20, 2011 10:48:12 AM Stefano Babic wrote:
> 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 <fabio.estevam@freescale.com>
> >> ---
> >> 
> >>  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.

It's a matter of taste and readability ... but then maybe use clrsetbits()?

> 
> Best regards,
> Stefano Babic

  reply	other threads:[~2011-09-20  9:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-19 17:51 [U-Boot] [PATCH] MX31: Disable watchdog during low-power modes Fabio Estevam
2011-09-20  4:16 ` Marek Vasut
2011-09-20  8:48   ` Stefano Babic
2011-09-20  9:24     ` Marek Vasut [this message]
2011-09-21  3:43     ` Fabio Estevam
2011-09-21  5:24       ` Stefano Babic
2011-09-21  6:26       ` Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201109201124.27034.marek.vasut@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox