Skip to content

Commit c3c5138

Browse files
stephan-ghJassi Brar
authored andcommitted
dt-bindings: mailbox: qcom,apcs: Add separate node for clock-controller
APCS "global" is sort of a "miscellaneous" hardware block that combines multiple registers inside the application processor subsystem. Two distinct use cases are currently stuffed together in a single device tree node: - Mailbox: to communicate with other remoteprocs in the system. - Clock: for controlling the CPU frequency. These two use cases have unavoidable circular dependencies: the mailbox is needed as early as possible during boot to start controlling shared resources like clocks and power domains, while the clock controller needs one of these shared clocks as its parent. Currently, there is no way to distinguish these two use cases for generic mechanisms like fw_devlink. This is currently blocking conversion of the deprecated custom "qcom,ipc" properties to the standard "mboxes", see e.g. commit d92e9ea ("arm64: dts: qcom: msm8939: revert use of APCS mbox for RPM"): 1. remoteproc &rpm needs mboxes = <&apcs1_mbox 8>; 2. The clock controller inside &apcs1_mbox needs clocks = <&rpmcc RPM_SMD_XO_CLK_SRC>. 3. &rpmcc is a child of remoteproc &rpm The mailbox itself does not need any clocks and should probe early to unblock the rest of the boot process. The "clocks" are only needed for the separate clock controller. In Linux, these are already two separate drivers that can probe independently. Break up the circular dependency chain in the device tree by separating the clock controller into a separate child node. Deprecate the old approach of specifying the clock properties as part of the root node, but keep them for backwards compatibility. Signed-off-by: Stephan Gerhold <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Jassi Brar <[email protected]>
1 parent 02e66da commit c3c5138

File tree

1 file changed

+118
-51
lines changed

1 file changed

+118
-51
lines changed

Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml

Lines changed: 118 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ properties:
7373
description: phandles to the parent clocks of the clock driver
7474
minItems: 2
7575
maxItems: 3
76+
deprecated: true
7677

7778
'#mbox-cells':
7879
const: 1
@@ -83,6 +84,23 @@ properties:
8384
clock-names:
8485
minItems: 2
8586
maxItems: 3
87+
deprecated: true
88+
89+
clock-controller:
90+
type: object
91+
additionalProperties: false
92+
properties:
93+
clocks:
94+
description: phandles to the parent clocks of the clock driver
95+
minItems: 2
96+
maxItems: 3
97+
98+
'#clock-cells':
99+
enum: [0, 1]
100+
101+
clock-names:
102+
minItems: 2
103+
maxItems: 3
86104

87105
required:
88106
- compatible
@@ -91,6 +109,76 @@ required:
91109

92110
additionalProperties: false
93111

112+
# Clocks should be specified either on the parent node or on the child node
113+
oneOf:
114+
- required:
115+
- clock-controller
116+
properties:
117+
clocks: false
118+
clock-names: false
119+
'#clock-cells': false
120+
- properties:
121+
clock-controller: false
122+
123+
$defs:
124+
msm8916-apcs-clock-controller:
125+
properties:
126+
clocks:
127+
items:
128+
- description: primary pll parent of the clock driver
129+
- description: auxiliary parent
130+
clock-names:
131+
items:
132+
- const: pll
133+
- const: aux
134+
'#clock-cells':
135+
const: 0
136+
137+
msm8939-apcs-clock-controller:
138+
properties:
139+
clocks:
140+
items:
141+
- description: primary pll parent of the clock driver
142+
- description: auxiliary parent
143+
- description: reference clock
144+
clock-names:
145+
items:
146+
- const: pll
147+
- const: aux
148+
- const: ref
149+
'#clock-cells':
150+
const: 0
151+
152+
sdx55-apcs-clock-controller:
153+
properties:
154+
clocks:
155+
items:
156+
- description: reference clock
157+
- description: primary pll parent of the clock driver
158+
- description: auxiliary parent
159+
clock-names:
160+
items:
161+
- const: ref
162+
- const: pll
163+
- const: aux
164+
'#clock-cells':
165+
const: 0
166+
167+
ipq6018-apcs-clock-controller:
168+
properties:
169+
clocks:
170+
items:
171+
- description: primary pll parent of the clock driver
172+
- description: XO clock
173+
- description: GCC GPLL0 clock source
174+
clock-names:
175+
items:
176+
- const: pll
177+
- const: xo
178+
- const: gpll0
179+
'#clock-cells':
180+
const: 1
181+
94182
allOf:
95183
- if:
96184
properties:
@@ -99,15 +187,10 @@ allOf:
99187
enum:
100188
- qcom,msm8916-apcs-kpss-global
101189
then:
190+
$ref: "#/$defs/msm8916-apcs-clock-controller"
102191
properties:
103-
clocks:
104-
items:
105-
- description: primary pll parent of the clock driver
106-
- description: auxiliary parent
107-
clock-names:
108-
items:
109-
- const: pll
110-
- const: aux
192+
clock-controller:
193+
$ref: "#/$defs/msm8916-apcs-clock-controller"
111194

112195
- if:
113196
properties:
@@ -116,17 +199,10 @@ allOf:
116199
enum:
117200
- qcom,msm8939-apcs-kpss-global
118201
then:
202+
$ref: "#/$defs/msm8939-apcs-clock-controller"
119203
properties:
120-
clocks:
121-
items:
122-
- description: primary pll parent of the clock driver
123-
- description: auxiliary parent
124-
- description: reference clock
125-
clock-names:
126-
items:
127-
- const: pll
128-
- const: aux
129-
- const: ref
204+
clock-controller:
205+
$ref: "#/$defs/msm8939-apcs-clock-controller"
130206

131207
- if:
132208
properties:
@@ -135,17 +211,10 @@ allOf:
135211
enum:
136212
- qcom,sdx55-apcs-gcc
137213
then:
214+
$ref: "#/$defs/sdx55-apcs-clock-controller"
138215
properties:
139-
clocks:
140-
items:
141-
- description: reference clock
142-
- description: primary pll parent of the clock driver
143-
- description: auxiliary parent
144-
clock-names:
145-
items:
146-
- const: ref
147-
- const: pll
148-
- const: aux
216+
clock-controller:
217+
$ref: "#/$defs/sdx55-apcs-clock-controller"
149218

150219
- if:
151220
properties:
@@ -154,17 +223,10 @@ allOf:
154223
enum:
155224
- qcom,ipq6018-apcs-apps-global
156225
then:
226+
$ref: "#/$defs/ipq6018-apcs-clock-controller"
157227
properties:
158-
clocks:
159-
items:
160-
- description: primary pll parent of the clock driver
161-
- description: XO clock
162-
- description: GCC GPLL0 clock source
163-
clock-names:
164-
items:
165-
- const: pll
166-
- const: xo
167-
- const: gpll0
228+
clock-controller:
229+
$ref: "#/$defs/ipq6018-apcs-clock-controller"
168230

169231
- if:
170232
properties:
@@ -180,19 +242,7 @@ allOf:
180242
properties:
181243
clocks: false
182244
clock-names: false
183-
184-
- if:
185-
properties:
186-
compatible:
187-
contains:
188-
enum:
189-
- qcom,ipq6018-apcs-apps-global
190-
then:
191-
properties:
192-
'#clock-cells':
193-
const: 1
194-
else:
195-
properties:
245+
clock-controller: false
196246
'#clock-cells':
197247
const: 0
198248

@@ -217,6 +267,23 @@ examples:
217267
};
218268
219269
# Example apcs with qcs404
270+
- |
271+
#define GCC_APSS_AHB_CLK_SRC 1
272+
#define GCC_GPLL0_AO_OUT_MAIN 123
273+
mailbox@b011000 {
274+
compatible = "qcom,qcs404-apcs-apps-global",
275+
"qcom,msm8916-apcs-kpss-global", "syscon";
276+
reg = <0x0b011000 0x1000>;
277+
#mbox-cells = <1>;
278+
279+
apcs_clk: clock-controller {
280+
clocks = <&apcs_hfpll>, <&gcc GCC_GPLL0_AO_OUT_MAIN>;
281+
clock-names = "pll", "aux";
282+
#clock-cells = <0>;
283+
};
284+
};
285+
286+
# Example apcs with qcs404 (deprecated: use clock-controller subnode)
220287
- |
221288
#define GCC_APSS_AHB_CLK_SRC 1
222289
#define GCC_GPLL0_AO_OUT_MAIN 123

0 commit comments

Comments
 (0)