public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] MX31: Disable watchdog during low-power modes
@ 2011-09-19 17:51 Fabio Estevam
  2011-09-20  4:16 ` Marek Vasut
  0 siblings, 1 reply; 7+ messages in thread
From: Fabio Estevam @ 2011-09-19 17:51 UTC (permalink / raw)
  To: u-boot

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);
 }
 
 
diff --git a/arch/arm/include/asm/arch-mx31/imx-regs.h b/arch/arm/include/asm/arch-mx31/imx-regs.h
index 2064870..338ba4d 100644
--- a/arch/arm/include/asm/arch-mx31/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx31/imx-regs.h
@@ -71,6 +71,8 @@ struct cspi_regs {
 /* Watchdog Timer (WDOG) registers */
 #define WDOG_ENABLE	(1 << 2)
 #define WDOG_WT_SHIFT	8
+#define WDOG_WDZST	1
+
 struct wdog_regs {
 	u16 wcr;	/* Control */
 	u16 wsr;	/* Service */
-- 
1.6.0.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-09-21  6:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2011-09-21  3:43     ` Fabio Estevam
2011-09-21  5:24       ` Stefano Babic
2011-09-21  6:26       ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox