aboutsummaryrefslogtreecommitdiff
path: root/drivers/watchdog/imx_watchdog.c
diff options
context:
space:
mode:
authorXiaoliang Yang <xiaoliang.yang_1@nxp.com>2018-10-18 18:27:45 +0800
committerStefano Babic <sbabic@denx.de>2019-01-01 14:12:18 +0100
commit005c1cf888a7ad72bd0f9ceb6f6b2eee7720f7b0 (patch)
treeee05963d702a2a6fdee4f75992ca417478c3dba9 /drivers/watchdog/imx_watchdog.c
parent4dcbccf794a330895ee2aeba6964a94b33c60eda (diff)
watchdog: driver support for fsl-lsch2
Support watchdog driver for fsl-lsch2. It's disabled in default. If you want to use it, please enable CONFIG_IMX_WATCHDOG. Define CONFIG_WATCHDOG_TIMEOUT_MSECS to set watchdog timeout. Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
Diffstat (limited to 'drivers/watchdog/imx_watchdog.c')
-rw-r--r--drivers/watchdog/imx_watchdog.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/watchdog/imx_watchdog.c b/drivers/watchdog/imx_watchdog.c
index 3f826d10eb..ddcf474996 100644
--- a/drivers/watchdog/imx_watchdog.c
+++ b/drivers/watchdog/imx_watchdog.c
@@ -8,6 +8,9 @@
#include <asm/io.h>
#include <watchdog.h>
#include <asm/arch/imx-regs.h>
+#ifdef CONFIG_FSL_LSCH2
+#include <asm/arch/immap_lsch2.h>
+#endif
#include <fsl_wdog.h>
#ifdef CONFIG_IMX_WATCHDOG
@@ -33,8 +36,12 @@ void hw_watchdog_init(void)
#define CONFIG_WATCHDOG_TIMEOUT_MSECS 128000
#endif
timeout = (CONFIG_WATCHDOG_TIMEOUT_MSECS / 500) - 1;
+#ifdef CONFIG_FSL_LSCH2
+ writew((WCR_WDA | WCR_SRS | WCR_WDE) << 8 | timeout, &wdog->wcr);
+#else
writew(WCR_WDZST | WCR_WDBG | WCR_WDE | WCR_WDT | WCR_SRS |
WCR_WDA | SET_WCR_WT(timeout), &wdog->wcr);
+#endif /* CONFIG_FSL_LSCH2*/
hw_watchdog_reset();
}
#endif