boards: arm: Add wdog support on mimxrt595_evk
Add watchdog support to the mimxrt595 platform.
The mimxrt595 platform is excluded from the watchdog
test case because the test case uses variables in the
noinit section that need to be retained through a reset
but the rt595 does not retain this memory through a
reset.
Signed-off-by: Chay Guo <changyi.guo@nxp.com>
diff --git a/boards/arm/mimxrt595_evk/doc/index.rst b/boards/arm/mimxrt595_evk/doc/index.rst
index 9586e8d..51506a7 100644
--- a/boards/arm/mimxrt595_evk/doc/index.rst
+++ b/boards/arm/mimxrt595_evk/doc/index.rst
@@ -83,6 +83,8 @@
+-----------+------------+-------------------------------------+
| CTIMER | on-chip | counter |
+-----------+------------+-------------------------------------+
+| WDT | on-chip | watchdog |
++-----------+------------+-------------------------------------+
The default configuration can be found in the defconfig file:
diff --git a/boards/arm/mimxrt595_evk/mimxrt595_evk_cm33.dts b/boards/arm/mimxrt595_evk/mimxrt595_evk_cm33.dts
index 8a3ba48..5831b46 100644
--- a/boards/arm/mimxrt595_evk/mimxrt595_evk_cm33.dts
+++ b/boards/arm/mimxrt595_evk/mimxrt595_evk_cm33.dts
@@ -21,6 +21,7 @@
led1 = &blue_led;
led2 = &red_led;
usart-0 = &flexcomm0;
+ watchdog0 = &wwdt0;
};
chosen {
@@ -220,6 +221,10 @@
status = "okay";
};
+&wwdt0 {
+ status = "okay";
+};
+
&flexspi {
mx25um51345g: mx25um51345g@2 {
compatible = "nxp,imx-flexspi-mx25um51345g";
diff --git a/boards/arm/mimxrt595_evk/mimxrt595_evk_cm33.yaml b/boards/arm/mimxrt595_evk/mimxrt595_evk_cm33.yaml
index 3878158..6bd71c8 100644
--- a/boards/arm/mimxrt595_evk/mimxrt595_evk_cm33.yaml
+++ b/boards/arm/mimxrt595_evk/mimxrt595_evk_cm33.yaml
@@ -23,3 +23,4 @@
- gpio
- i2c
- spi
+ - watchdog
diff --git a/drivers/watchdog/wdt_mcux_wwdt.c b/drivers/watchdog/wdt_mcux_wwdt.c
index 754e4f3..779732e 100644
--- a/drivers/watchdog/wdt_mcux_wwdt.c
+++ b/drivers/watchdog/wdt_mcux_wwdt.c
@@ -80,7 +80,7 @@
return -ENOMEM;
}
-#if defined(CONFIG_SOC_MIMXRT685S_CM33)
+#if defined(CONFIG_SOC_MIMXRT685S_CM33) || defined(CONFIG_SOC_MIMXRT595S_CM33)
clock_freq = CLOCK_GetWdtClkFreq(0);
#else
const struct mcux_wwdt_config *config = dev->config;
diff --git a/soc/arm/nxp_imx/rt5xx/Kconfig.defconfig.mimxrt595_cm33 b/soc/arm/nxp_imx/rt5xx/Kconfig.defconfig.mimxrt595_cm33
index 5e11eef..83fd8f0 100644
--- a/soc/arm/nxp_imx/rt5xx/Kconfig.defconfig.mimxrt595_cm33
+++ b/soc/arm/nxp_imx/rt5xx/Kconfig.defconfig.mimxrt595_cm33
@@ -40,6 +40,10 @@
default y
depends on COUNTER
+config WDT_MCUX_WWDT
+ default y
+ depends on WATCHDOG
+
if MCUX_OS_TIMER
config SYS_CLOCK_HW_CYCLES_PER_SEC
diff --git a/tests/drivers/watchdog/wdt_basic_api/testcase.yaml b/tests/drivers/watchdog/wdt_basic_api/testcase.yaml
index 59c93dd..9f948fd 100644
--- a/tests/drivers/watchdog/wdt_basic_api/testcase.yaml
+++ b/tests/drivers/watchdog/wdt_basic_api/testcase.yaml
@@ -4,7 +4,7 @@
tests:
drivers.watchdog:
filter: not (CONFIG_WDT_SAM or dt_compat_enabled("st,stm32-window-watchdog") or dt_compat_enabled("st,stm32-watchdog"))
- platform_exclude: mec15xxevb_assy6853 mimxrt685_evk_cm33
+ platform_exclude: mec15xxevb_assy6853 mimxrt685_evk_cm33 mimxrt595_evk_cm33
drivers.watchdog.stm32wwdg:
filter: dt_compat_enabled("st,stm32-window-watchdog") or dt_compat_enabled("st,stm32-watchdog")
extra_args: DTC_OVERLAY_FILE="boards/stm32_wwdg.overlay"