Skip to content

Commit 7406ad8

Browse files
erwangonashif
authored andcommitted
dts/bindings: Add binding for STM32WL HSE Clock
STM32WL features a specific HSE clock with dedicated properties. Add a dedicated binding and update STM32 clock control driver header to take it into account. Signed-off-by: Erwan Gouriou <[email protected]>
1 parent eef51a8 commit 7406ad8

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright (c) 2021, Linaro ltd
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
description: STM32WL HSE Clock
5+
6+
compatible: "st,stm32wl-hse-clock"
7+
8+
include: [fixed-clock.yaml]
9+
10+
properties:
11+
hse-tcxo:
12+
type: boolean
13+
required: false
14+
description: |
15+
When set, TCXO is selected as external source clock for HSE.
16+
Otherwise, external cyrstal is selected as HSE source clock.
17+
18+
hse-div2:
19+
type: boolean
20+
required: false
21+
description: |
22+
When set HSE output clock is divided by 2.
23+
Otherwise, no prescaler is used.

include/drivers/clock_control/stm32_clock_control.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,15 @@
309309

310310
#if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(clk_hse), st_stm32_hse_clock, okay)
311311
#define STM32_HSE_BYPASS DT_PROP(DT_NODELABEL(clk_hse), hse_bypass)
312-
#else
312+
#elif !DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(clk_hse), st_stm32wl_hse_clock, okay)
313313
#define STM32_HSE_BYPASS CONFIG_CLOCK_STM32_HSE_BYPASS
314314
#endif
315315

316+
#if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(clk_hse), st_stm32wl_hse_clock, okay)
317+
#define STM32_HSE_TCXO DT_PROP(DT_NODELABEL(clk_hse), hse_tcxo)
318+
#define STM32_HSE_DIV2 DT_PROP(DT_NODELABEL(clk_hse), hse_div2)
319+
#endif
320+
316321
struct stm32_pclken {
317322
uint32_t bus;
318323
uint32_t enr;

0 commit comments

Comments
 (0)