diff --git a/soc/arm/nxp_kinetis/kl2x/Kconfig.soc b/soc/arm/nxp_kinetis/kl2x/Kconfig.soc index 7da61c20180..8e38cbb5073 100644 --- a/soc/arm/nxp_kinetis/kl2x/Kconfig.soc +++ b/soc/arm/nxp_kinetis/kl2x/Kconfig.soc @@ -77,4 +77,12 @@ config SOC_PART_NUMBER_KINETIS_KL2X that you should not set directly. The part number selection choice defines the default value for this string. +config WDOG_INIT + def_bool y + help + This processor enables the watchdog timer with a short + window for configuration upon reset. Therefore, this + requires that the watchdog be configured during reset + handling. + endif # SOC_SERIES_KINETIS_KL2X diff --git a/soc/arm/nxp_kinetis/kl2x/soc.c b/soc/arm/nxp_kinetis/kl2x/soc.c index 25103064ca3..96093e49387 100644 --- a/soc/arm/nxp_kinetis/kl2x/soc.c +++ b/soc/arm/nxp_kinetis/kl2x/soc.c @@ -81,9 +81,6 @@ static int kl2x_init(struct device *arg) /* disable interrupts */ oldLevel = irq_lock(); - /* Disable the watchdog */ - SIM->COPC = 0; - /* Initialize system clock to 48 MHz */ clock_init(); @@ -98,4 +95,10 @@ static int kl2x_init(struct device *arg) return 0; } +void z_arm_watchdog_init(void) +{ + /* Disable the watchdog */ + SIM->COPC = 0; +} + SYS_INIT(kl2x_init, PRE_KERNEL_1, 0);