Hi,

On Sat, 28 Sep 2013 21:19:19 -0300
Otavio Salvador <ota...@ossystems.com.br> wrote:

> I am trying to add support for watchdog in one board and it is not
> working as expected.
> 
> I did add the:
> 
> #define CONFIG_HW_WATCHDOG
> #define CONFIG_IMX_WATCHDOG
> 
> into the board config file.
> 
> Into the board .c file, I added:
> 
> int board_late_init(void)
> {
> ...
> #ifdef CONFIG_HW_WATCHDOG
>      hw_watchdog_init();
> #endif
> 
> return 0;
> }
> 
> and the hw_watchdog_init is indeed called.
> 
> It starts booting and shows:
> 
> U-Boot 2013.10-rc3-00046-gc1c2434-dirty (Sep 28 2013 - 21:12:53)
> 
> CPU:   Freescale i.MX6Q rev1.2 at 792 MHz
> Reset cause: WDOG
> Board: yyyy
> DRAM:  1 GiB
> MMC:   FSL_SDHC: 0, FSL_SDHC: 1
> In:    serial
> Out:   serial
> Err:   serial
> Net:�
> 
> and it in fact resets.
> 
> I am booting the board from USB loader. May it be an issue?

No, it shouldn't be an issue. Does the attached patch help?

Thanks,

Anatolij

>From 394344a469ea18234adc8f611925e41bc532e230 Mon Sep 17 00:00:00 2001
From: Anatolij Gustschin <ag...@denx.de>
Date: Tue, 16 Apr 2013 11:01:54 +0200
Subject: [PATCH] imx_watchdog: do not soft-reset while watchdog init

Currently the driver clears WCR_SRS bit when enabling
the watchdog and this causes a software reset. Do not
clear WCR_SRS.

Signed-off-by: Anatolij Gustschin <ag...@denx.de>
---
 drivers/watchdog/imx_watchdog.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/imx_watchdog.c b/drivers/watchdog/imx_watchdog.c
index 50e602a..d5993b4 100644
--- a/drivers/watchdog/imx_watchdog.c
+++ b/drivers/watchdog/imx_watchdog.c
@@ -19,6 +19,7 @@ struct watchdog_regs {
 #define WCR_WDBG	0x02
 #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)
 
@@ -45,7 +46,7 @@ void hw_watchdog_init(void)
 #define CONFIG_WATCHDOG_TIMEOUT_MSECS 128000
 #endif
 	timeout = (CONFIG_WATCHDOG_TIMEOUT_MSECS / 500) - 1;
-	writew(WCR_WDZST | WCR_WDBG | WCR_WDE | WCR_WDT |
+	writew(WCR_WDZST | WCR_WDBG | WCR_WDE | WCR_WDT | WCR_SRS |
 		WCR_WDW | SET_WCR_WT(timeout), &wdog->wcr);
 	hw_watchdog_reset();
 }
-- 
1.7.9.5

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to