drivers/counter: stm32 rtc: Use dts to get RTC clock information

RTC clock information should be provided by dts files

Fixes #10451

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This commit is contained in:
Erwan Gouriou 2018-11-29 11:37:45 +01:00 committed by Anas Nashif
commit 3074e393db
10 changed files with 20 additions and 3 deletions

View file

@ -320,8 +320,8 @@ static const struct rtc_stm32_config rtc_config = {
.channels = 1,
},
.pclken = {
.enr = LL_APB1_GRP1_PERIPH_PWR,
.bus = STM32_CLOCK_BUS_APB1,
.enr = DT_RTC_0_CLOCK_BITS,
.bus = DT_RTC_0_CLOCK_BUS,
},
.ll_rtc_config = {
.HourFormat = LL_RTC_HOURFORMAT_24HOUR,

View file

@ -288,6 +288,7 @@
rtc: rtc@40002800 {
compatible = "st,stm32-rtc";
reg = <0x40002800 0x400>;
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x10000000>;
interrupts = <41 0>;
prescaler = <32768>;
status = "disabled";

View file

@ -363,6 +363,7 @@
compatible = "st,stm32-rtc";
reg = <0x40002800 0x400>;
interrupts = <41 0>;
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x10000000>;
prescaler = <32768>;
status = "disabled";
label = "RTC_0";

View file

@ -578,6 +578,7 @@
compatible = "st,stm32-rtc";
reg = <0x40002800 0x300>;
interrupts = <41 0>;
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x10000000>;
prescaler = <32768>;
status = "disabled";
label = "RTC_0";

View file

@ -286,6 +286,7 @@
compatible = "st,stm32-rtc";
reg = <0x40002800 0x400>;
interrupts = <41 0>;
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x10000000>;
prescaler = <32768>;
status = "disabled";
label = "RTC_0";

View file

@ -25,4 +25,10 @@ properties:
description: mmio register space
generation: define
category: required
clocks:
type: array
category: optional
description: Clock gate information
generation: define
...

View file

@ -255,6 +255,7 @@
#define CONFIG_RTC_0_NAME DT_ST_STM32_RTC_40002800_LABEL
#define DT_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
#define DT_RTC_0_CLOCK_BITS DT_ST_STM32_RTC_40002800_CLOCK_BITS
#define DT_RTC_0_CLOCK_BUS DT_ST_STM32_RTC_40002800_CLOCK_BUS
/* End of SoC Level DTS fixup file */

View file

@ -366,6 +366,8 @@
#define CONFIG_RTC_0_NAME DT_ST_STM32_RTC_40002800_LABEL
#define DT_RTC_0_NAME DT_ST_STM32_RTC_40002800_LABEL
#define CONFIG_RTC_PRESCALER DT_ST_STM32_RTC_40002800_PRESCALER
#define DT_RTC_0_CLOCK_BITS DT_ST_STM32_RTC_40002800_CLOCK_BITS
#define DT_RTC_0_CLOCK_BUS DT_ST_STM32_RTC_40002800_CLOCK_BUS
#define DT_WDT_0_NAME DT_ST_STM32_WATCHDOG_0_LABEL
/* End of SoC Level DTS fixup file */

View file

@ -355,6 +355,8 @@
#define CONFIG_RTC_0_NAME DT_ST_STM32_RTC_40002800_LABEL
#define DT_RTC_0_NAME DT_ST_STM32_RTC_40002800_LABEL
#define CONFIG_RTC_PRESCALER DT_ST_STM32_RTC_40002800_PRESCALER
#define DT_RTC_0_CLOCK_BITS DT_ST_STM32_RTC_40002800_CLOCK_BITS
#define DT_RTC_0_CLOCK_BUS DT_ST_STM32_RTC_40002800_CLOCK_BUS
#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

View file

@ -177,6 +177,8 @@
#define CONFIG_RTC_0_NAME DT_ST_STM32_RTC_40002800_LABEL
#define DT_RTC_0_NAME DT_ST_STM32_RTC_40002800_LABEL
#define CONFIG_RTC_PRESCALER DT_ST_STM32_RTC_40002800_PRESCALER
#define DT_RTC_0_CLOCK_BITS DT_ST_STM32_RTC_40002800_CLOCK_BITS
#define DT_RTC_0_CLOCK_BUS DT_ST_STM32_RTC_40002800_CLOCK_BUS
#define DT_SPI_1_BASE_ADDRESS DT_ST_STM32_SPI_FIFO_40013000_BASE_ADDRESS
#define DT_SPI_1_IRQ_PRI DT_ST_STM32_SPI_FIFO_40013000_IRQ_0_PRIORITY