Skip to content

Commit ebca397

Browse files
passgatbebarino
authored andcommitted
dt-bindings: clock: convert stm32 rcc bindings to json-schema
The patch converts st,stm32-rcc.txt to the JSON schema, but it does more than that. The old bindings, in fact, only covered the stm32f{4,7} platforms and not the stm32h7. Therefore, to avoid patch submission tests failing, it was necessary to add the corresponding compatible (i. e. st,stm32h743-rcc) and specify that, in this case, 3 are the clocks instead of the 2 required for the stm32f{4,7} platforms. Additionally, the old bindings made no mention of the st,syscfg property, which is used by both the stm32f{4,7} and the stm32h7 platforms. The patch also fixes the files referencing to the old st,stm32-rcc.txt. Signed-off-by: Dario Binacchi <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent 40384c8 commit ebca397

File tree

4 files changed

+110
-140
lines changed

4 files changed

+110
-140
lines changed

Documentation/devicetree/bindings/clock/st,stm32-rcc.txt

Lines changed: 0 additions & 138 deletions
This file was deleted.
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/clock/st,stm32-rcc.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: STMicroelectronics STM32 Reset Clock Controller
8+
9+
maintainers:
10+
- Dario Binacchi <[email protected]>
11+
12+
description: |
13+
The RCC IP is both a reset and a clock controller.
14+
The reset phandle argument is the bit number within the RCC registers bank,
15+
starting from RCC base address.
16+
17+
properties:
18+
compatible:
19+
oneOf:
20+
- items:
21+
- enum:
22+
- st,stm32f42xx-rcc
23+
- st,stm32f746-rcc
24+
- st,stm32h743-rcc
25+
- const: st,stm32-rcc
26+
- items:
27+
- enum:
28+
- st,stm32f469-rcc
29+
- const: st,stm32f42xx-rcc
30+
- const: st,stm32-rcc
31+
- items:
32+
- enum:
33+
- st,stm32f769-rcc
34+
- const: st,stm32f746-rcc
35+
- const: st,stm32-rcc
36+
37+
reg:
38+
maxItems: 1
39+
40+
'#reset-cells':
41+
const: 1
42+
43+
'#clock-cells':
44+
enum: [1, 2]
45+
46+
clocks:
47+
minItems: 2
48+
maxItems: 3
49+
50+
st,syscfg:
51+
$ref: /schemas/types.yaml#/definitions/phandle
52+
description:
53+
Phandle to system configuration controller. It can be used to control the
54+
power domain circuitry.
55+
56+
required:
57+
- compatible
58+
- reg
59+
- '#reset-cells'
60+
- '#clock-cells'
61+
- clocks
62+
- st,syscfg
63+
64+
allOf:
65+
- if:
66+
properties:
67+
compatible:
68+
contains:
69+
const: st,stm32h743-rcc
70+
then:
71+
properties:
72+
'#clock-cells':
73+
const: 1
74+
description: |
75+
The clock index for the specified type.
76+
clocks:
77+
items:
78+
- description: high speed external (HSE) clock input
79+
- description: low speed external (LSE) clock input
80+
- description: Inter-IC sound (I2S) clock input
81+
else:
82+
properties:
83+
'#clock-cells':
84+
const: 2
85+
description: |
86+
- The first cell is the clock type, possible values are 0 for
87+
gated clocks and 1 otherwise.
88+
- The second cell is the clock index for the specified type.
89+
clocks:
90+
items:
91+
- description: high speed external (HSE) clock input
92+
- description: Inter-IC sound (I2S) clock input
93+
94+
additionalProperties: false
95+
96+
examples:
97+
# Reset and Clock Control Module node:
98+
- |
99+
clock-controller@58024400 {
100+
compatible = "st,stm32h743-rcc", "st,stm32-rcc";
101+
reg = <0x58024400 0x400>;
102+
#clock-cells = <1>;
103+
#reset-cells = <1>;
104+
clocks = <&clk_hse>, <&clk_lse>, <&clk_i2s>;
105+
st,syscfg = <&pwrcfg>;
106+
};
107+
108+
...

Documentation/devicetree/bindings/reset/st,stm32-rcc.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ STMicroelectronics STM32 Peripheral Reset Controller
33

44
The RCC IP is both a reset and a clock controller.
55

6-
Please see Documentation/devicetree/bindings/clock/st,stm32-rcc.txt
6+
Please see Documentation/devicetree/bindings/clock/st,stm32-rcc.yaml

include/dt-bindings/clock/stm32fx-clock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* List of clocks which are not derived from system clock (SYSCLOCK)
1111
*
1212
* The index of these clocks is the secondary index of DT bindings
13-
* (see Documentation/devicetree/bindings/clock/st,stm32-rcc.txt)
13+
* (see Documentation/devicetree/bindings/clock/st,stm32-rcc.yaml)
1414
*
1515
* e.g:
1616
<assigned-clocks = <&rcc 1 CLK_LSE>;

0 commit comments

Comments
 (0)