[U-Boot] [PATCH] watchdog/imx_watchdog: do not set WCR_WDW

Stefano Babic sbabic at denx.de
Wed Mar 25 09:03:06 CET 2015


Hi Sebastian,

(sorry for late answer)

On 03/03/2015 17:45, Sebastian Andrzej Siewior wrote:
> with WCR_WDW set, the watchdog won't trigger if we bootet linux and idle
> around while the watchdog is not triggered. It seems the timer makes
> progress very slowly if at all. I managed to remain 20minutes alive
> while the timeout was set to 60secs. It reboots within 60secs if I start
> a busyloop in userland (something like "while (1) { }").

Just some questions. The described behavior is coherent with the
description in the manual. When WDW is set, the watchdog is stopped
while the processor is in wait mode.
Current imx2_wdt.c driver in kernel does not care about this bit, but it
looks like that only the kernel and/or the application can decide if the
watchdog should run when the system is in WAIT or not. The bootloader
cannot decide, and it should set the bit for its own usage.

Should this setup be done by the kernel driver instead of by the
bootloader ?

> 
> While I don't see a reason why the WDT should not be running while the
> CPU is in idle, I'm dropping this bit.

I can agree or disagree. This depends on the application.

Differently as the WDZST, that can be set only once, and it is set by
*both* U-Boot and kernel (setting in kernel has then no influence), the
WDW can be even disabled in kernel.

> 
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
> ---
>  drivers/watchdog/imx_watchdog.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/watchdog/imx_watchdog.c b/drivers/watchdog/imx_watchdog.c
> index d5993b4d26d6..1d18d4b269f8 100644
> --- a/drivers/watchdog/imx_watchdog.c
> +++ b/drivers/watchdog/imx_watchdog.c
> @@ -20,7 +20,6 @@ struct watchdog_regs {
>  #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)
>  
>  #ifdef CONFIG_IMX_WATCHDOG
> @@ -47,7 +46,7 @@ void hw_watchdog_init(void)
>  #endif
>  	timeout = (CONFIG_WATCHDOG_TIMEOUT_MSECS / 500) - 1;
>  	writew(WCR_WDZST | WCR_WDBG | WCR_WDE | WCR_WDT | WCR_SRS |
> -		WCR_WDW | SET_WCR_WT(timeout), &wdog->wcr);
> +		SET_WCR_WT(timeout), &wdog->wcr);
>  	hw_watchdog_reset();
>  }
>  #endif
> 

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
=====================================================================


More information about the U-Boot mailing list