public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] imx_watchdog: always set minimal timeout in reset_cpu
@ 2015-12-20 18:09 Andrey Skvortsov
  2016-01-07 16:55 ` Stefano Babic
  0 siblings, 1 reply; 2+ messages in thread
From: Andrey Skvortsov @ 2015-12-20 18:09 UTC (permalink / raw)
  To: u-boot

The problem is that timeout bits in WCR register were leaved unchanged.
So previously set timeout value was applied and therefore 'reset'
command takes any value up to two minutes, depending on previous
watchdog settings, instead of minimal 0.5 seconds.

Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
---
 drivers/watchdog/imx_watchdog.c | 2 +-
 include/fsl_wdog.h              | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/imx_watchdog.c b/drivers/watchdog/imx_watchdog.c
index 0d77595..f9f8175 100644
--- a/drivers/watchdog/imx_watchdog.c
+++ b/drivers/watchdog/imx_watchdog.c
@@ -43,7 +43,7 @@ void reset_cpu(ulong addr)
 {
 	struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR;
 
-	clrsetbits_le16(&wdog->wcr, 0, WCR_WDE);
+	clrsetbits_le16(&wdog->wcr, WCR_WT_MSK, WCR_WDE);
 
 	writew(0x5555, &wdog->wsr);
 	writew(0xaaaa, &wdog->wsr);	/* load minimum 1/2 second timeout */
diff --git a/include/fsl_wdog.h b/include/fsl_wdog.h
index d15a70c..f698d4d 100644
--- a/include/fsl_wdog.h
+++ b/include/fsl_wdog.h
@@ -16,3 +16,4 @@ struct watchdog_regs {
 #define WCR_WDT		0x08
 #define WCR_SRS		0x10
 #define SET_WCR_WT(x)	(x << 8)
+#define WCR_WT_MSK	SET_WCR_WT(0xFF)
-- 
2.6.4

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

* [U-Boot] [PATCH] imx_watchdog: always set minimal timeout in reset_cpu
  2015-12-20 18:09 [U-Boot] [PATCH] imx_watchdog: always set minimal timeout in reset_cpu Andrey Skvortsov
@ 2016-01-07 16:55 ` Stefano Babic
  0 siblings, 0 replies; 2+ messages in thread
From: Stefano Babic @ 2016-01-07 16:55 UTC (permalink / raw)
  To: u-boot

On 20/12/2015 19:09, Andrey Skvortsov wrote:
> The problem is that timeout bits in WCR register were leaved unchanged.
> So previously set timeout value was applied and therefore 'reset'
> command takes any value up to two minutes, depending on previous
> watchdog settings, instead of minimal 0.5 seconds.
> 
> Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
> ---


Applied (fix) to u-boot-imx, thanks !

Best regards,
Stefano Babic



-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

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

end of thread, other threads:[~2016-01-07 16:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-20 18:09 [U-Boot] [PATCH] imx_watchdog: always set minimal timeout in reset_cpu Andrey Skvortsov
2016-01-07 16:55 ` Stefano Babic

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