Skip to content

Commit bcad9cb

Browse files
gautierg-stkartben
authored andcommitted
dts: bindings: clock: add stm32n6 rcc clocks
Add STM32N6 RCC clock bindings Signed-off-by: Guillaume Gautier <[email protected]>
1 parent 722310e commit bcad9cb

File tree

5 files changed

+270
-0
lines changed

5 files changed

+270
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright (c) 2025, STMicroelectronics
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
description: |
5+
STM32N6 CPU Clock
6+
Describes the STM32N6 CPU clock multiplexer. On STM32N6, this is the CPU
7+
clock that feeds the SysTick.
8+
For instance:
9+
&cpusw {
10+
clocks = <&rcc STM32_SRC_IC1 CPU_SEL(3)>;
11+
clock-frequency = <DT_FREQ_M(600)>;
12+
status = "okay";
13+
};
14+
15+
compatible: "st,stm32n6-cpu-clock-mux"
16+
17+
include:
18+
- name: base.yaml
19+
property-allowlist:
20+
- status
21+
- compatible
22+
- clocks
23+
24+
properties:
25+
clock-frequency:
26+
required: true
27+
type: int
28+
description: |
29+
default frequency in Hz for CPU clock (sysa_ck/sys_cpu_ck)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (c) 2024 STMicroelectronics
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
description: STM32N6 HSE Clock
5+
6+
compatible: "st,stm32n6-hse-clock"
7+
8+
include: [fixed-clock.yaml]
9+
10+
properties:
11+
hse-bypass:
12+
type: boolean
13+
description: |
14+
HSE crystal oscillator bypass
15+
Set to the property to by-pass the oscillator with an external clock.
16+
17+
hse-div2:
18+
type: boolean
19+
description: |
20+
When set HSE output clock is divided by 2.
21+
Otherwise, no prescaler is used.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright (c) 2024 STMicroelectronics
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
description: |
5+
STM32N6 Divider IC multiplexer
6+
This node select a clock input and a divider.
7+
For instance:
8+
&ic6 {
9+
pll-src = <2>;
10+
div = <16>;
11+
status = "okay";
12+
};
13+
14+
compatible: "st,stm32n6-ic-clock-mux"
15+
16+
properties:
17+
pll-src:
18+
type: int
19+
required: true
20+
description: |
21+
PLL clock source
22+
enum:
23+
- 1
24+
- 2
25+
- 3
26+
- 4
27+
28+
ic-div:
29+
type: int
30+
description: |
31+
ICx integer division factor
32+
The input ICx frequency is divided by the specified value
33+
Valid range: 1 - 256
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Copyright (c) 2024 STMicroelectronics
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
description: |
5+
PLL node binding for STM32N6 devices
6+
7+
It can be used to describe 4 different PLLs: PLL1, PLL2, PLL3 and PLL4.
8+
9+
These PLLs can take one of clk_hse, clk_hsi or clk_msi as input clock, with
10+
an input frequency from 5 to 50 MHz. PLLM factor is used to set the input
11+
clock in this acceptable range.
12+
13+
Each PLL has one output clock whose frequency can be computed with the
14+
following formula:
15+
16+
f(PLL_P) = f(VCO clock) / (PLLP1 × PLLP2)
17+
18+
with f(VCO clock) = f(PLL clock input) × (PLLN / PLLM)
19+
20+
Note: To reduce the power consumption, it is recommended to configure the VCOx
21+
clock output to the lowest frequency.
22+
23+
The PLL output frequency must not exceed 3200 MHz.
24+
25+
compatible: "st,stm32n6-pll-clock"
26+
27+
include: [clock-controller.yaml, base.yaml]
28+
29+
properties:
30+
31+
"#clock-cells":
32+
const: 0
33+
34+
clocks:
35+
required: true
36+
37+
div-m:
38+
type: int
39+
required: true
40+
description: |
41+
Prescaler for PLLx
42+
input clock
43+
Valid range: 1 - 63
44+
45+
mul-n:
46+
type: int
47+
required: true
48+
description: |
49+
PLLx multiplication factor for VCO
50+
Valid range: 16 - 2500
51+
52+
div-p1:
53+
type: int
54+
description: |
55+
PLLx DIVP1 division factor
56+
Valid range: 1 - 7
57+
58+
div-p2:
59+
type: int
60+
description: |
61+
PLLx DIVP2 division factor
62+
Valid range: 1 - 7
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# Copyright (c) 2024 STMicroelectronics
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
description: |
5+
STM32 Reset and Clock controller node for STM32N6 devices
6+
This node is in charge of system clock ('SYSCLK') source selection and
7+
System Clock Generation.
8+
9+
Configuring STM32 Reset and Clock controller node:
10+
11+
System clock source should be selected amongst the clock nodes available in "clocks"
12+
node (typically 'clk_hse, clk_csi', 'pll', ...).
13+
As part of this node configuration, SYSCLK frequency should also be defined, using
14+
"clock-frequency" property.
15+
Last, bus clocks (typically HCLK, PCLK1, PCLK2) should be configured using matching
16+
prescaler properties.
17+
Here is an example of correctly configured rcc node:
18+
&rcc {
19+
clocks = <&ic2>;
20+
clock-frequency = <DT_FREQ_M(400)>;
21+
ahb-prescaler = <2>;
22+
apb1-prescaler = <1>;
23+
apb2-prescaler = <1>;
24+
apb4-prescaler = <1>;
25+
apb5-prescaler = <1>;
26+
}
27+
28+
Confere st,stm32-rcc binding for information about domain clocks configuration.
29+
30+
compatible: "st,stm32n6-rcc"
31+
32+
include: [clock-controller.yaml, base.yaml]
33+
34+
properties:
35+
reg:
36+
required: true
37+
38+
"#clock-cells":
39+
const: 2
40+
41+
clock-frequency:
42+
required: true
43+
type: int
44+
description: |
45+
default frequency in Hz for clock output
46+
47+
ahb-prescaler:
48+
type: int
49+
required: true
50+
description: |
51+
AHB clock prescaler
52+
enum:
53+
- 1
54+
- 2
55+
- 4
56+
- 8
57+
- 16
58+
- 32
59+
- 64
60+
- 128
61+
62+
apb1-prescaler:
63+
type: int
64+
required: true
65+
description: |
66+
CPU domain APB1 prescaler
67+
enum:
68+
- 1
69+
- 2
70+
- 4
71+
- 8
72+
- 16
73+
- 32
74+
- 64
75+
- 128
76+
77+
apb2-prescaler:
78+
type: int
79+
required: true
80+
description: |
81+
CPU domain APB2 prescaler
82+
enum:
83+
- 1
84+
- 2
85+
- 4
86+
- 8
87+
- 16
88+
- 32
89+
- 64
90+
- 128
91+
92+
apb4-prescaler:
93+
type: int
94+
required: true
95+
description: |
96+
CPU domain APB4 prescaler
97+
enum:
98+
- 1
99+
- 2
100+
- 4
101+
- 8
102+
- 16
103+
- 32
104+
- 64
105+
- 128
106+
107+
apb5-prescaler:
108+
type: int
109+
required: true
110+
description: |
111+
CPU domain APB5 prescaler
112+
enum:
113+
- 1
114+
- 2
115+
- 4
116+
- 8
117+
- 16
118+
- 32
119+
- 64
120+
- 128
121+
122+
123+
clock-cells:
124+
- bus
125+
- bits

0 commit comments

Comments
 (0)