Skip to content

Commit 86469b1

Browse files
benediktibkcarlescufi
authored andcommitted
drivers: clock_control: Make LSE driving configurable
Make the LSE driving capability configurable for the STM32 series. Fixes #44737. Signed-off-by: Benedikt Schmidt <[email protected]>
1 parent 0d44525 commit 86469b1

File tree

20 files changed

+65
-12
lines changed

20 files changed

+65
-12
lines changed

drivers/bluetooth/hci/ipm_stm32wb.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,8 @@ static void start_ble_rf(void)
397397
}
398398

399399
#if STM32_LSE_ENABLED
400+
/* Configure driving capability */
401+
LL_RCC_LSE_SetDriveCapability(STM32_LSE_DRIVING << RCC_BDCR_LSEDRV_Pos);
400402
/* Select LSE clock */
401403
LL_RCC_LSE_Enable();
402404
while (!LL_RCC_LSE_IsReady()) {

drivers/clock_control/clock_stm32_ll_h7.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,9 @@ static void set_up_fixed_clock_sources(void)
473473
/* Enable backup domain */
474474
LL_PWR_EnableBkUpAccess();
475475

476+
/* Configure driving capability */
477+
LL_RCC_LSE_SetDriveCapability(STM32_LSE_DRIVING << RCC_BDCR_LSEDRV_Pos);
478+
476479
/* Enable LSE oscillator */
477480
LL_RCC_LSE_Enable();
478481
while (LL_RCC_LSE_IsReady() != 1) {

drivers/clock_control/clock_stm32_ll_u5.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,9 @@ static void set_up_fixed_clock_sources(void)
336336
}
337337
}
338338

339+
/* Configure driving capability */
340+
LL_RCC_LSE_SetDriveCapability(STM32_LSE_DRIVING << RCC_BDCR_LSEDRV_Pos);
341+
339342
/* Enable LSE Oscillator */
340343
LL_RCC_LSE_Enable();
341344
/* Wait for LSE ready */

drivers/clock_control/clock_stm32g4.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ void config_enable_default_clocks(void)
7575
/* Wait for Backup domain access */
7676
}
7777

78+
/* Configure driving capability */
79+
LL_RCC_LSE_SetDriveCapability(STM32_LSE_DRIVING << RCC_BDCR_LSEDRV_Pos);
7880
/* Enable LSE Oscillator (32.768 kHz) */
7981
LL_RCC_LSE_Enable();
8082
while (!LL_RCC_LSE_IsReady()) {

drivers/clock_control/clock_stm32l4_l5_wb_wl.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ void config_enable_default_clocks(void)
8888
/* Wait for Backup domain access */
8989
}
9090

91+
/* Configure driving capability */
92+
LL_RCC_LSE_SetDriveCapability(STM32_LSE_DRIVING << RCC_BDCR_LSEDRV_Pos);
9193
/* Enable LSE Oscillator (32.768 kHz) */
9294
LL_RCC_LSE_Enable();
9395
while (!LL_RCC_LSE_IsReady()) {

drivers/timer/stm32_lptim_timer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ static int sys_clock_driver_init(const struct device *dev)
279279

280280
/* enable LSE clock */
281281
LL_RCC_LSE_DisableBypass();
282+
LL_RCC_LSE_SetDriveCapability(STM32_LSE_DRIVING << RCC_BDCR_LSEDRV_Pos);
282283
LL_RCC_LSE_Enable();
283284
while (!LL_RCC_LSE_IsReady()) {
284285
/* Wait for LSE ready */

dts/arm/st/f0/stm32f0.dtsi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@
4949

5050
clk_lse: clk-lse {
5151
#clock-cells = <0>;
52-
compatible = "fixed-clock";
52+
compatible = "st,stm32-lse-clock";
5353
clock-frequency = <32768>;
54+
driving-capability = <0>;
5455
status = "disabled";
5556
};
5657

dts/arm/st/f3/stm32f3.dtsi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@
5050

5151
clk_lse: clk-lse {
5252
#clock-cells = <0>;
53-
compatible = "fixed-clock";
53+
compatible = "st,stm32-lse-clock";
5454
clock-frequency = <32768>;
55+
driving-capability = <0>;
5556
status = "disabled";
5657
};
5758

dts/arm/st/f7/stm32f7.dtsi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@
5555

5656
clk_lse: clk-lse {
5757
#clock-cells = <0>;
58-
compatible = "fixed-clock";
58+
compatible = "st,stm32-lse-clock";
5959
clock-frequency = <32768>;
60+
driving-capability = <0>;
6061
status = "disabled";
6162
};
6263

dts/arm/st/g0/stm32g0.dtsi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@
5252

5353
clk_lse: clk-lse {
5454
#clock-cells = <0>;
55-
compatible = "fixed-clock";
55+
compatible = "st,stm32-lse-clock";
5656
clock-frequency = <32768>;
57+
driving-capability = <0>;
5758
status = "disabled";
5859
};
5960

0 commit comments

Comments
 (0)