[U-Boot] [PATCH 2/2] watchdog: Kconfig: add config to disable wdog reset
Xiaoliang Yang
xiaoliang.yang_1 at nxp.com
Wed May 23 07:51:21 UTC 2018
Add Kconfig support for CONFIG_WATCHDOG_RESET_DISABLE, use this config
to disable watchdog reset in imx_watchdog driver, so that the watchdog
will not be fed in u-boot.
Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1 at nxp.com>
---
arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2 | 3 +++
drivers/watchdog/Kconfig | 5 +++++
drivers/watchdog/imx_watchdog.c | 2 ++
3 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2 b/arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2
index 87b91eb..c43a99b 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2
+++ b/arch/arm/cpu/armv8/fsl-layerscape/doc/README.lsch2
@@ -18,3 +18,6 @@ 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
+Use following config to disable reset watchdog, so that the watchdog will
+not be fed in u-boot:
+ #define CONFIG_WATCHDOG_RESET_DISABLE
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 148c6a0..f9b3035 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -103,4 +103,9 @@ config WDT_CDNS
Select this to enable Cadence watchdog timer, which can be found on some
Xilinx Microzed Platform.
+config WATCHDOG_RESET_DISABLE
+ bool "Disable reset watchdog"
+ help
+ Disable reset watchdog, which can let WATCHDOG_RESET invalid.
+
endmenu
diff --git a/drivers/watchdog/imx_watchdog.c b/drivers/watchdog/imx_watchdog.c
index 3ad4e55..6691ee9 100644
--- a/drivers/watchdog/imx_watchdog.c
+++ b/drivers/watchdog/imx_watchdog.c
@@ -20,10 +20,12 @@
#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)
--
1.7.1
More information about the U-Boot
mailing list