From 17f545be7da426df4157753752f201c45657ca15 Mon Sep 17 00:00:00 2001 From: Robert Weber Date: Tue, 13 Aug 2019 22:21:57 -0700 Subject: [PATCH] soc: stm32wb: Add support for STM32 IWDG The driver for STM32's independent watchdog already exists and is compatible with the stm32wb SoC. Enable the independent watchdog for the stm32wb series for use with this driver. Signed-off-by: Robert Weber --- dts/arm/st/wb/stm32wb.dtsi | 6 ++++++ soc/arm/st_stm32/stm32wb/dts_fixup.h | 2 ++ soc/arm/st_stm32/stm32wb/soc.h | 8 ++++++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/dts/arm/st/wb/stm32wb.dtsi b/dts/arm/st/wb/stm32wb.dtsi index a54d47cdf40..aad89eeb9b7 100644 --- a/dts/arm/st/wb/stm32wb.dtsi +++ b/dts/arm/st/wb/stm32wb.dtsi @@ -271,6 +271,12 @@ label = "ADC_1"; #io-channel-cells = <1>; }; + + iwdg: watchdog@40003000 { + compatible = "st,stm32-watchdog"; + reg = <0x40003000 0x400>; + label = "IWDG"; + }; }; }; diff --git a/soc/arm/st_stm32/stm32wb/dts_fixup.h b/soc/arm/st_stm32/stm32wb/dts_fixup.h index d8d93d93fe9..ce546d2dbf2 100644 --- a/soc/arm/st_stm32/stm32wb/dts_fixup.h +++ b/soc/arm/st_stm32/stm32wb/dts_fixup.h @@ -155,6 +155,8 @@ #define DT_ADC_1_CLOCK_BITS DT_ST_STM32_ADC_50040000_CLOCK_BITS_0 #define DT_ADC_1_CLOCK_BUS DT_ST_STM32_ADC_50040000_CLOCK_BUS_0 +#define DT_WDT_0_NAME DT_INST_0_ST_STM32_WATCHDOG_LABEL + #define DT_WWDT_0_BASE_ADDRESS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_BASE_ADDRESS #define DT_WWDT_0_NAME DT_INST_0_ST_STM32_WINDOW_WATCHDOG_LABEL #define DT_WWDT_0_IRQ DT_INST_0_ST_STM32_WINDOW_WATCHDOG_IRQ_0 diff --git a/soc/arm/st_stm32/stm32wb/soc.h b/soc/arm/st_stm32/stm32wb/soc.h index 26c4fa4464a..ca1b77ab1e6 100644 --- a/soc/arm/st_stm32/stm32wb/soc.h +++ b/soc/arm/st_stm32/stm32wb/soc.h @@ -55,7 +55,7 @@ #endif /* CONFIG_FLASH */ #ifdef CONFIG_I2C #include -#endif +#endif /* CONFIG_I2C */ #ifdef CONFIG_SPI_STM32 #include @@ -63,7 +63,11 @@ #ifdef CONFIG_ADC_STM32 #include -#endif +#endif /* CONFIG_ADC_STM32 */ + +#ifdef CONFIG_IWDG_STM32 +#include +#endif /* CONFIG_IWDG_STM32 */ #ifdef CONFIG_WWDG_STM32 #include