]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/watchdog/imx_watchdog.c
karo: merge with Ka-Ro specific tree for secure boot support
[karo-tx-uboot.git] / drivers / watchdog / imx_watchdog.c
index 50e602af127b33eef7ab7320a9a552630b8fdc7b..3f6e5593ed0619aaa0dba7f812d8f7e85ac0ccdb 100644 (file)
@@ -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();
 }
@@ -55,12 +56,7 @@ void reset_cpu(ulong addr)
 {
        struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR;
 
-       writew(WCR_WDE, &wdog->wcr);
-       writew(0x5555, &wdog->wsr);
-       writew(0xaaaa, &wdog->wsr);     /* load minimum 1/2 second timeout */
        while (1) {
-               /*
-                * spin for .5 seconds before reset
-                */
+               writew(0, &wdog->wcr); /* clear SRS initiating SOFT reset */
        }
 }