From a44e9f496e91942c408143a5212e097821a533be Mon Sep 17 00:00:00 2001 From: Thomas Stranger Date: Wed, 4 Mar 2020 23:39:28 +0100 Subject: [PATCH] soc: stm32g0: Add support for STM32 IWDG The driver for STM32's independent watchdog already exists and is compatible with the stm32g0 SoC. Enable the independent watchdog for the stm32g0 series for use with this driver. Signed-off-by: Thomas Stranger --- dts/arm/st/g0/stm32g0.dtsi | 7 +++++++ soc/arm/st_stm32/stm32g0/dts_fixup.h | 2 ++ soc/arm/st_stm32/stm32g0/soc.h | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/dts/arm/st/g0/stm32g0.dtsi b/dts/arm/st/g0/stm32g0.dtsi index d03f9839de1..692eac5f29b 100644 --- a/dts/arm/st/g0/stm32g0.dtsi +++ b/dts/arm/st/g0/stm32g0.dtsi @@ -105,6 +105,13 @@ }; }; + iwdg: watchdog@40003000 { + compatible = "st,stm32-watchdog"; + reg = <0x40003000 0x400>; + label = "IWDG"; + status = "disabled"; + }; + wwdg: watchdog@40002c00 { compatible = "st,stm32-window-watchdog"; reg = <0x40002C00 0x400>; diff --git a/soc/arm/st_stm32/stm32g0/dts_fixup.h b/soc/arm/st_stm32/stm32g0/dts_fixup.h index 5a14004bcc0..0a73f0bdc44 100644 --- a/soc/arm/st_stm32/stm32g0/dts_fixup.h +++ b/soc/arm/st_stm32/stm32g0/dts_fixup.h @@ -97,6 +97,8 @@ #define DT_UART_STM32_USART_2_CLOCK_BUS DT_ST_STM32_USART_40004400_CLOCK_BUS #define DT_UART_STM32_USART_2_HW_FLOW_CONTROL DT_ST_STM32_USART_40004400_HW_FLOW_CONTROL +#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/stm32g0/soc.h b/soc/arm/st_stm32/stm32g0/soc.h index 00de3518792..70262c71da9 100644 --- a/soc/arm/st_stm32/stm32g0/soc.h +++ b/soc/arm/st_stm32/stm32g0/soc.h @@ -44,6 +44,10 @@ #include #endif +#ifdef CONFIG_IWDG_STM32 +#include +#endif + #ifdef CONFIG_WWDG_STM32 #include #endif