From 91884302bfdb2fe363dc144a06f36b63d7c6c920 Mon Sep 17 00:00:00 2001 From: Francois Ramu Date: Wed, 23 Oct 2019 14:03:55 +0200 Subject: [PATCH] soc: arm: st_stm32: add driver lptimer management to stm32wb series This patch introduces the support of the Low Power Timer for the STM32WBxx from STMicroelectronics. Signed-off-by: Francois Ramu --- dts/arm/st/wb/stm32wb.dtsi | 12 ++++++++++++ soc/arm/st_stm32/stm32wb/dts_fixup.h | 7 +++++++ soc/arm/st_stm32/stm32wb/soc.h | 5 +++++ 3 files changed, 24 insertions(+) diff --git a/dts/arm/st/wb/stm32wb.dtsi b/dts/arm/st/wb/stm32wb.dtsi index aad89eeb9b7..c78393076a7 100644 --- a/dts/arm/st/wb/stm32wb.dtsi +++ b/dts/arm/st/wb/stm32wb.dtsi @@ -277,6 +277,18 @@ reg = <0x40003000 0x400>; label = "IWDG"; }; + + lptim1: timers@40007c00 { + compatible = "st,stm32-timers"; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x80000000>; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x40007c00 0x400>; + interrupts = <47 0>; + interrupt-names = "wakeup"; + status = "disabled"; + label = "LPTIM_1"; + }; }; }; diff --git a/soc/arm/st_stm32/stm32wb/dts_fixup.h b/soc/arm/st_stm32/stm32wb/dts_fixup.h index 938c0217d3d..29706f33840 100644 --- a/soc/arm/st_stm32/stm32wb/dts_fixup.h +++ b/soc/arm/st_stm32/stm32wb/dts_fixup.h @@ -164,4 +164,11 @@ #define DT_WWDT_0_CLOCK_BITS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BITS #define DT_WWDT_0_CLOCK_BUS DT_INST_0_ST_STM32_WINDOW_WATCHDOG_CLOCK_BUS +#define DT_LPTIM_1_BASE_ADDRESS DT_ST_STM32_TIMERS_40007C00_BASE_ADDRESS +#define DT_LPTIM_1_IRQ DT_ST_STM32_TIMERS_40007C00_IRQ_0 +#define DT_LPTIM_1_IRQ_PRI DT_ST_STM32_TIMERS_40007C00_IRQ_0_PRIORITY +#define DT_LPTIM_1_NAME DT_ST_STM32_TIMERS_40007C00_LABEL +#define DT_LPTIM_1_CLOCK_BITS DT_ST_STM32_TIMERS_40007C00_CLOCK_BITS_0 +#define DT_LPTIM_1_CLOCK_BUS DT_ST_STM32_TIMERS_40007C00_CLOCK_BUS_0 + /* End of SoC Level DTS fixup file */ diff --git a/soc/arm/st_stm32/stm32wb/soc.h b/soc/arm/st_stm32/stm32wb/soc.h index a3a2f7c8daa..fdc21aada01 100644 --- a/soc/arm/st_stm32/stm32wb/soc.h +++ b/soc/arm/st_stm32/stm32wb/soc.h @@ -73,6 +73,11 @@ #include #endif +#ifdef CONFIG_STM32_LPTIM_TIMER +#include +#include +#endif + #endif /* !_ASMLANGUAGE */ #endif /* _STM32WBX_SOC_H_ */