watchdog: add watchdog driver support to mimxrt685 platform
Add watchdog support to the mimxrt685 platform. The mimxrt685 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 rt685 does not retain this memory through a reset. Signed-off-by: David Leach <david.leach@nxp.com>
This commit is contained in:
parent
40fcb1ce9b
commit
bdd536a09e
9 changed files with 46 additions and 4 deletions
|
@ -89,6 +89,8 @@ features:
|
|||
+-----------+------------+-------------------------------------+
|
||||
| PWM | on-chip | pwm |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| WDT | on-chip | watchdog |
|
||||
+-----------+------------+-------------------------------------+
|
||||
|
||||
The default configuration can be found in the defconfig file:
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
green-pwm-led = &green_pwm_led;
|
||||
blue-pwm-led = &blue_pwm_led;
|
||||
red-pwm-led = &red_pwm_led;
|
||||
watchdog0 = &wwdt0;
|
||||
};
|
||||
|
||||
chosen {
|
||||
|
@ -265,6 +266,10 @@ i2s1: &flexcomm3 {
|
|||
status = "okay";
|
||||
};
|
||||
|
||||
&wwdt0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&user_button_1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
|
|
@ -26,3 +26,4 @@ supported:
|
|||
- i2c
|
||||
- i2s
|
||||
- spi
|
||||
- watchdog
|
||||
|
|
|
@ -72,7 +72,6 @@ static int mcux_wwdt_disable(const struct device *dev)
|
|||
static int mcux_wwdt_install_timeout(const struct device *dev,
|
||||
const struct wdt_timeout_cfg *cfg)
|
||||
{
|
||||
const struct mcux_wwdt_config *config = dev->config;
|
||||
struct mcux_wwdt_data *data = dev->data;
|
||||
uint32_t clock_freq;
|
||||
|
||||
|
@ -81,8 +80,14 @@ static int mcux_wwdt_install_timeout(const struct device *dev,
|
|||
return -ENOMEM;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_SOC_MIMXRT685S_CM33)
|
||||
clock_freq = CLOCK_GetWdtClkFreq(0);
|
||||
#else
|
||||
const struct mcux_wwdt_config *config = dev->config;
|
||||
|
||||
CLOCK_SetClkDiv(kCLOCK_DivWdtClk, config->clk_divider, true);
|
||||
clock_freq = CLOCK_GetWdtClkFreq();
|
||||
#endif
|
||||
|
||||
WWDT_GetDefaultConfig(&data->wwdt_config);
|
||||
|
||||
|
|
|
@ -250,6 +250,24 @@
|
|||
label = "SC_TIMER";
|
||||
#pwm-cells = <2>;
|
||||
};
|
||||
|
||||
wwdt0: watchdog@e000 {
|
||||
compatible = "nxp,lpc-wwdt";
|
||||
reg = <0xe000 0x1000>;
|
||||
interrupts = <0 0>;
|
||||
status = "disabled";
|
||||
clk-divider = <1>;
|
||||
label = "WWDT_0";
|
||||
};
|
||||
|
||||
wwdt1: watchdog@2e000 {
|
||||
compatible = "nxp,lpc-wwdt";
|
||||
reg = <0x2e000 0x1000>;
|
||||
interrupts = <52 0>;
|
||||
status = "disabled";
|
||||
clk-divider = <1>;
|
||||
label = "WWDT_1";
|
||||
};
|
||||
};
|
||||
|
||||
&nvic {
|
||||
|
|
|
@ -62,4 +62,8 @@ config PWM_MCUX_SCTIMER
|
|||
default y
|
||||
depends on PWM
|
||||
|
||||
config WDT_MCUX_WWDT
|
||||
default y
|
||||
depends on WATCHDOG
|
||||
|
||||
endif # SOC_MIMXRT685S_CM33
|
||||
|
|
|
@ -171,7 +171,14 @@ static ALWAYS_INLINE void clock_init(void)
|
|||
/* attach AUDIO PLL clock to FLEXCOMM3 (I2S3) */
|
||||
CLOCK_AttachClk(kAUDIO_PLL_to_FLEXCOMM3);
|
||||
#endif
|
||||
|
||||
#if (DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(wwdt0), nxp_lpc_wwdt, okay))
|
||||
CLOCK_AttachClk(kLPOSC_to_WDT0_CLK);
|
||||
#else
|
||||
/* Allowed to select none if not being used for watchdog to
|
||||
* reduce power
|
||||
*/
|
||||
CLOCK_AttachClk(kNONE_to_WDT0_CLK);
|
||||
#endif
|
||||
#endif /* CONFIG_SOC_MIMXRT685S_CM33 */
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ tests:
|
|||
depends_on: watchdog
|
||||
tags: drivers watchdog
|
||||
filter: not (CONFIG_WDT_SAM or dt_compat_enabled("st,stm32-window-watchdog"))
|
||||
platform_exclude: mec15xxevb_assy6853
|
||||
platform_exclude: mec15xxevb_assy6853 mimxrt685_evk_cm33
|
||||
drivers.watchdog.stm32wwdg:
|
||||
depends_on: watchdog
|
||||
tags: drivers watchdog
|
||||
|
|
2
west.yml
2
west.yml
|
@ -92,7 +92,7 @@ manifest:
|
|||
groups:
|
||||
- hal
|
||||
- name: hal_nxp
|
||||
revision: 4b493d4346e841e786a8daa2eb2ee03cbe5cfd37
|
||||
revision: bb97ba1cb3820d5799f53c7af765830d766b56a2
|
||||
path: modules/hal/nxp
|
||||
groups:
|
||||
- hal
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue