watchdog: imx: add config to disable wdog reset
authorXiaoliang Yang <xiaoliang.yang_1@nxp.com>
Thu, 18 Oct 2018 10:27:46 +0000 (18:27 +0800)
committerStefano Babic <sbabic@denx.de>
Tue, 1 Jan 2019 13:12:18 +0000 (14:12 +0100)
Add Kconfig option WATCHDOG_RESET_DISABLE to disable watchdog reset
in imx_watchdog driver, so that the watchdog will not be fed in
u-boot if CONFIG_WATCHDOG_RESET_DISABLE is enabled.

Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2
drivers/watchdog/Kconfig
drivers/watchdog/imx_watchdog.c

index 9176546..9583bf7 100644 (file)
@@ -17,3 +17,5 @@ Use following config to set watchdog timeout, if this config is not defined,
 the default timeout value is 128s which is the maximum. Set 10 seconds for
 example:
     #define CONFIG_WATCHDOG_TIMEOUT_MSECS 10000
+Set CONFIG_WATCHDOG_RESET_DISABLE to disable reset watchdog, so that the
+watchdog will not be fed in u-boot.
index b6974ad..10fd303 100644 (file)
@@ -11,6 +11,12 @@ config WATCHDOG
 config HW_WATCHDOG
        bool
 
+config WATCHDOG_RESET_DISABLE
+       bool "Disable reset watchdog"
+       help
+          Disable reset watchdog, which can let WATCHDOG_RESET invalid, so
+          that the watchdog will not be fed in u-boot.
+
 config BCM2835_WDT
        bool "Enable BCM2835/2836 watchdog driver"
        select HW_WATCHDOG
index ddcf474..14cc618 100644 (file)
 #ifdef CONFIG_IMX_WATCHDOG
 void hw_watchdog_reset(void)
 {
+#ifndef CONFIG_WATCHDOG_RESET_DISABLE
        struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR;
 
        writew(0x5555, &wdog->wsr);
        writew(0xaaaa, &wdog->wsr);
+#endif /* CONFIG_WATCHDOG_RESET_DISABLE*/
 }
 
 void hw_watchdog_init(void)