diff --git a/drivers/watchdog/Kconfig.stm32 b/drivers/watchdog/Kconfig.stm32 index 3022eef7105..3c230484da6 100644 --- a/drivers/watchdog/Kconfig.stm32 +++ b/drivers/watchdog/Kconfig.stm32 @@ -9,6 +9,7 @@ menuconfig IWDG_STM32 bool "Independent Watchdog (IWDG) Driver for STM32 family of MCUs" depends on SOC_FAMILY_STM32 + select HAS_DTS_WDT help Enable IWDG driver for STM32 line of MCUs diff --git a/drivers/watchdog/iwdg_stm32.c b/drivers/watchdog/iwdg_stm32.c index 5b7e8ae0f99..653ac3b2360 100644 --- a/drivers/watchdog/iwdg_stm32.c +++ b/drivers/watchdog/iwdg_stm32.c @@ -172,11 +172,10 @@ static int iwdg_stm32_init(struct device *dev) } static struct iwdg_stm32_data iwdg_stm32_dev_data = { - .Instance = IWDG + .Instance = (IWDG_TypeDef *)DT_ST_STM32_WATCHDOG_0_BASE_ADDRESS }; -DEVICE_AND_API_INIT(iwdg_stm32, CONFIG_WDT_0_NAME, +DEVICE_AND_API_INIT(iwdg_stm32, DT_ST_STM32_WATCHDOG_0_LABEL, iwdg_stm32_init, &iwdg_stm32_dev_data, NULL, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &iwdg_stm32_api); - diff --git a/soc/arm/st_stm32/stm32f0/dts_fixup.h b/soc/arm/st_stm32/stm32f0/dts_fixup.h index 746a016b90c..849ad4fab51 100644 --- a/soc/arm/st_stm32/stm32f0/dts_fixup.h +++ b/soc/arm/st_stm32/stm32f0/dts_fixup.h @@ -177,4 +177,6 @@ #define DT_TIM_STM32_17_CLOCK_BITS DT_ST_STM32_TIMERS_40014800_CLOCK_BITS #define DT_TIM_STM32_17_CLOCK_BUS DT_ST_STM32_TIMERS_40014800_CLOCK_BUS +#define DT_WDT_0_NAME DT_ST_STM32_WATCHDOG_0_LABEL + /* End of SoC Level DTS fixup file */ diff --git a/soc/arm/st_stm32/stm32f1/dts_fixup.h b/soc/arm/st_stm32/stm32f1/dts_fixup.h index 43699e35c0a..c8ba1bdb500 100644 --- a/soc/arm/st_stm32/stm32f1/dts_fixup.h +++ b/soc/arm/st_stm32/stm32f1/dts_fixup.h @@ -198,4 +198,6 @@ #define DT_TIM_STM32_8_CLOCK_BITS DT_ST_STM32_TIMERS_40013400_CLOCK_BITS #define DT_TIM_STM32_8_CLOCK_BUS DT_ST_STM32_TIMERS_40013400_CLOCK_BUS +#define DT_WDT_0_NAME DT_ST_STM32_WATCHDOG_0_LABEL + /* End of SoC Level DTS fixup file */ diff --git a/soc/arm/st_stm32/stm32f2/dts_fixup.h b/soc/arm/st_stm32/stm32f2/dts_fixup.h index a3237b30ce9..1d6d4bfd596 100644 --- a/soc/arm/st_stm32/stm32f2/dts_fixup.h +++ b/soc/arm/st_stm32/stm32f2/dts_fixup.h @@ -138,4 +138,6 @@ #define DT_USB_RAM_SIZE DT_ST_STM32_OTGFS_50000000_RAM_SIZE #define DT_USB_MAXIMUM_SPEED DT_ST_STM32_OTGFS_50000000_MAXIMUM_SPEED +#define DT_WDT_0_NAME DT_ST_STM32_WATCHDOG_0_LABEL + /* End of SoC Level DTS fixup file */ diff --git a/soc/arm/st_stm32/stm32f3/dts_fixup.h b/soc/arm/st_stm32/stm32f3/dts_fixup.h index 5a6eb5ac079..c9490c1de33 100644 --- a/soc/arm/st_stm32/stm32f3/dts_fixup.h +++ b/soc/arm/st_stm32/stm32f3/dts_fixup.h @@ -254,4 +254,6 @@ #define DT_RTC_0_IRQ DT_ST_STM32_RTC_40002800_IRQ_0 #define CONFIG_RTC_0_NAME DT_ST_STM32_RTC_40002800_LABEL #define CONFIG_RTC_PRESCALER DT_ST_STM32_RTC_40002800_PRESCALER + +#define DT_WDT_0_NAME DT_ST_STM32_WATCHDOG_0_LABEL /* End of SoC Level DTS fixup file */ diff --git a/soc/arm/st_stm32/stm32f4/dts_fixup.h b/soc/arm/st_stm32/stm32f4/dts_fixup.h index 0830718ed75..b27ceb2f891 100644 --- a/soc/arm/st_stm32/stm32f4/dts_fixup.h +++ b/soc/arm/st_stm32/stm32f4/dts_fixup.h @@ -366,4 +366,5 @@ #define CONFIG_RTC_0_NAME DT_ST_STM32_RTC_40002800_LABEL #define CONFIG_RTC_PRESCALER DT_ST_STM32_RTC_40002800_PRESCALER +#define DT_WDT_0_NAME DT_ST_STM32_WATCHDOG_0_LABEL /* End of SoC Level DTS fixup file */ diff --git a/soc/arm/st_stm32/stm32f7/dts_fixup.h b/soc/arm/st_stm32/stm32f7/dts_fixup.h index af4e7997789..eac2eebaca5 100644 --- a/soc/arm/st_stm32/stm32f7/dts_fixup.h +++ b/soc/arm/st_stm32/stm32f7/dts_fixup.h @@ -358,4 +358,5 @@ #define DT_FLASH_DEV_BASE_ADDRESS DT_ST_STM32F7_FLASH_CONTROLLER_40023C00_BASE_ADDRESS #define DT_FLASH_DEV_NAME DT_ST_STM32F7_FLASH_CONTROLLER_40023C00_LABEL +#define DT_WDT_0_NAME DT_ST_STM32_WATCHDOG_0_LABEL /* End of SoC Level DTS fixup file */ diff --git a/soc/arm/st_stm32/stm32l0/dts_fixup.h b/soc/arm/st_stm32/stm32l0/dts_fixup.h index 4e7f0eac052..6ac634bf508 100644 --- a/soc/arm/st_stm32/stm32l0/dts_fixup.h +++ b/soc/arm/st_stm32/stm32l0/dts_fixup.h @@ -126,4 +126,5 @@ #define DT_USB_NUM_BIDIR_ENDPOINTS DT_ST_STM32_USB_40005C00_NUM_BIDIR_ENDPOINTS #define DT_USB_RAM_SIZE DT_ST_STM32_USB_40005C00_RAM_SIZE +#define DT_WDT_0_NAME DT_ST_STM32_WATCHDOG_0_LABEL /* End of SoC Level DTS fixup file */ diff --git a/soc/arm/st_stm32/stm32l4/dts_fixup.h b/soc/arm/st_stm32/stm32l4/dts_fixup.h index ad67f12c8ab..868407efbd7 100644 --- a/soc/arm/st_stm32/stm32l4/dts_fixup.h +++ b/soc/arm/st_stm32/stm32l4/dts_fixup.h @@ -298,4 +298,5 @@ #define DT_CAN_1_CLOCK_BUS DT_ST_STM32_CAN_40006400_CLOCK_BUS #define DT_CAN_1_CLOCK_BITS DT_ST_STM32_CAN_40006400_CLOCK_BITS +#define DT_WDT_0_NAME DT_ST_STM32_WATCHDOG_0_LABEL /* End of SoC Level DTS fixup file */