From 5debc6a94d6af7738cc3a0e33a0eda1a5aae8c89 Mon Sep 17 00:00:00 2001 From: Francois Ramu Date: Wed, 3 Jun 2020 10:13:05 +0200 Subject: [PATCH] soc: arm: stm32f2 add rtc feature on this serie This patch enables the rtc on the stm32f2 soc series from STMicroelectronics Signed-off-by: Francois Ramu --- dts/arm/st/f2/stm32f2.dtsi | 10 ++++++++++ soc/arm/st_stm32/stm32f2/soc.h | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/dts/arm/st/f2/stm32f2.dtsi b/dts/arm/st/f2/stm32f2.dtsi index 549afec4ba0..c1fd4f27d55 100644 --- a/dts/arm/st/f2/stm32f2.dtsi +++ b/dts/arm/st/f2/stm32f2.dtsi @@ -142,6 +142,16 @@ }; }; + rtc: rtc@40002800 { + compatible = "st,stm32-rtc"; + reg = <0x40002800 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x10000000>; + interrupts = <41 0>; + prescaler = <32768>; + status = "disabled"; + label = "RTC_0"; + }; + iwdg: watchdog@40003000 { compatible = "st,stm32-watchdog"; reg = <0x40003000 0x400>; diff --git a/soc/arm/st_stm32/stm32f2/soc.h b/soc/arm/st_stm32/stm32f2/soc.h index 32e0ebb5ff8..bb6f5b3091d 100644 --- a/soc/arm/st_stm32/stm32f2/soc.h +++ b/soc/arm/st_stm32/stm32f2/soc.h @@ -54,6 +54,12 @@ #include #endif +#if defined(CONFIG_COUNTER_RTC_STM32) +#include +#include +#include +#endif + #ifdef CONFIG_ADC_STM32 #include #endif