1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/phy/qcom,msm8996-qmp-usb3-phy.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Qualcomm QMP PHY controller (USB, MSM8996)
8
9maintainers:
10  - Vinod Koul <vkoul@kernel.org>
11
12description:
13  QMP PHY controller supports physical layer functionality for a number of
14  controllers on Qualcomm chipsets, such as, PCIe, UFS, and USB.
15
16  Note that these bindings are for SoCs up to SC8180X. For newer SoCs, see
17  qcom,sc8280xp-qmp-usb3-uni-phy.yaml.
18
19properties:
20  compatible:
21    enum:
22      - qcom,ipq6018-qmp-usb3-phy
23      - qcom,ipq8074-qmp-usb3-phy
24      - qcom,msm8996-qmp-usb3-phy
25      - qcom,msm8998-qmp-usb3-phy
26      - qcom,qcm2290-qmp-usb3-phy
27      - qcom,sc7180-qmp-usb3-phy
28      - qcom,sc8180x-qmp-usb3-phy
29      - qcom,sdm845-qmp-usb3-phy
30      - qcom,sdm845-qmp-usb3-uni-phy
31      - qcom,sdx55-qmp-usb3-uni-phy
32      - qcom,sdx65-qmp-usb3-uni-phy
33      - qcom,sm6115-qmp-usb3-phy
34      - qcom,sm8150-qmp-usb3-phy
35      - qcom,sm8150-qmp-usb3-uni-phy
36      - qcom,sm8250-qmp-usb3-phy
37      - qcom,sm8250-qmp-usb3-uni-phy
38      - qcom,sm8350-qmp-usb3-phy
39      - qcom,sm8350-qmp-usb3-uni-phy
40      - qcom,sm8450-qmp-usb3-phy
41
42  reg:
43    minItems: 1
44    items:
45      - description: serdes
46      - description: DP_COM
47
48  "#address-cells":
49    enum: [ 1, 2 ]
50
51  "#size-cells":
52    enum: [ 1, 2 ]
53
54  ranges: true
55
56  clocks:
57    minItems: 3
58    maxItems: 4
59
60  clock-names:
61    minItems: 3
62    maxItems: 4
63
64  power-domains:
65    maxItems: 1
66
67  resets:
68    maxItems: 2
69
70  reset-names:
71    maxItems: 2
72
73  vdda-phy-supply: true
74
75  vdda-pll-supply: true
76
77  vddp-ref-clk-supply: true
78
79patternProperties:
80  "^phy@[0-9a-f]+$":
81    type: object
82    description: single PHY-provider child node
83    properties:
84      reg:
85        minItems: 3
86        maxItems: 6
87
88      clocks:
89        items:
90          - description: PIPE clock
91
92      clock-names:
93        deprecated: true
94        items:
95          - const: pipe0
96
97      "#clock-cells":
98        const: 0
99
100      clock-output-names:
101        maxItems: 1
102
103      "#phy-cells":
104        const: 0
105
106    required:
107      - reg
108      - clocks
109      - "#clock-cells"
110      - clock-output-names
111      - "#phy-cells"
112
113    additionalProperties: false
114
115required:
116  - compatible
117  - reg
118  - "#address-cells"
119  - "#size-cells"
120  - ranges
121  - clocks
122  - clock-names
123  - resets
124  - reset-names
125  - vdda-phy-supply
126  - vdda-pll-supply
127
128additionalProperties: false
129
130allOf:
131  - if:
132      properties:
133        compatible:
134          contains:
135            enum:
136              - qcom,sc7180-qmp-usb3-phy
137    then:
138      properties:
139        clocks:
140          maxItems: 4
141        clock-names:
142          items:
143            - const: aux
144            - const: cfg_ahb
145            - const: ref
146            - const: com_aux
147        resets:
148          maxItems: 1
149        reset-names:
150          items:
151            - const: phy
152
153  - if:
154      properties:
155        compatible:
156          contains:
157            enum:
158              - qcom,sdm845-qmp-usb3-uni-phy
159    then:
160      properties:
161        clocks:
162          maxItems: 4
163        clock-names:
164          items:
165            - const: aux
166            - const: cfg_ahb
167            - const: ref
168            - const: com_aux
169        resets:
170          maxItems: 2
171        reset-names:
172          items:
173            - const: phy
174            - const: common
175
176  - if:
177      properties:
178        compatible:
179          contains:
180            enum:
181              - qcom,ipq8074-qmp-usb3-phy
182              - qcom,msm8996-qmp-usb3-phy
183              - qcom,msm8998-qmp-usb3-phy
184              - qcom,sdx55-qmp-usb3-uni-phy
185              - qcom,sdx65-qmp-usb3-uni-phy
186    then:
187      properties:
188        clocks:
189          maxItems: 3
190        clock-names:
191          items:
192            - const: aux
193            - const: cfg_ahb
194            - const: ref
195        resets:
196          maxItems: 2
197        reset-names:
198          items:
199            - const: phy
200            - const: common
201
202  - if:
203      properties:
204        compatible:
205          contains:
206            enum:
207              - qcom,sm8150-qmp-usb3-phy
208              - qcom,sm8150-qmp-usb3-uni-phy
209              - qcom,sm8250-qmp-usb3-uni-phy
210              - qcom,sm8350-qmp-usb3-uni-phy
211    then:
212      properties:
213        clocks:
214          maxItems: 4
215        clock-names:
216          items:
217            - const: aux
218            - const: ref_clk_src
219            - const: ref
220            - const: com_aux
221        resets:
222          maxItems: 2
223        reset-names:
224          items:
225            - const: phy
226            - const: common
227
228  - if:
229      properties:
230        compatible:
231          contains:
232            enum:
233              - qcom,sm8250-qmp-usb3-phy
234              - qcom,sm8350-qmp-usb3-phy
235    then:
236      properties:
237        clocks:
238          maxItems: 3
239        clock-names:
240          items:
241            - const: aux
242            - const: ref_clk_src
243            - const: com_aux
244        resets:
245          maxItems: 2
246        reset-names:
247          items:
248            - const: phy
249            - const: common
250
251  - if:
252      properties:
253        compatible:
254          contains:
255            enum:
256              - qcom,qcm2290-qmp-usb3-phy
257              - qcom,sm6115-qmp-usb3-phy
258    then:
259      properties:
260        clocks:
261          maxItems: 3
262        clock-names:
263          items:
264            - const: cfg_ahb
265            - const: ref
266            - const: com_aux
267        resets:
268          maxItems: 2
269        reset-names:
270          items:
271            - const: phy_phy
272            - const: phy
273
274  - if:
275      properties:
276        compatible:
277          contains:
278            enum:
279              - qcom,sdm845-qmp-usb3-phy
280              - qcom,sm8150-qmp-usb3-phy
281              - qcom,sm8350-qmp-usb3-phy
282              - qcom,sm8450-qmp-usb3-phy
283    then:
284      patternProperties:
285        "^phy@[0-9a-f]+$":
286          properties:
287            reg:
288              items:
289                - description: TX lane 1
290                - description: RX lane 1
291                - description: PCS
292                - description: TX lane 2
293                - description: RX lane 2
294                - description: PCS_MISC
295
296  - if:
297      properties:
298        compatible:
299          contains:
300            enum:
301              - qcom,msm8998-qmp-usb3-phy
302    then:
303      patternProperties:
304        "^phy@[0-9a-f]+$":
305          properties:
306            reg:
307              items:
308                - description: TX lane 1
309                - description: RX lane 1
310                - description: PCS
311                - description: TX lane 2
312                - description: RX lane 2
313
314  - if:
315      properties:
316        compatible:
317          contains:
318            enum:
319              - qcom,ipq6018-qmp-usb3-phy
320              - qcom,ipq8074-qmp-usb3-phy
321              - qcom,qcm2290-qmp-usb3-phy
322              - qcom,sc7180-qmp-usb3-phy
323              - qcom,sc8180x-qmp-usb3-phy
324              - qcom,sdx55-qmp-usb3-uni-phy
325              - qcom,sdx65-qmp-usb3-uni-phy
326              - qcom,sm6115-qmp-usb3-phy
327              - qcom,sm8150-qmp-usb3-uni-phy
328              - qcom,sm8250-qmp-usb3-phy
329    then:
330      patternProperties:
331        "^phy@[0-9a-f]+$":
332          properties:
333            reg:
334              items:
335                - description: TX
336                - description: RX
337                - description: PCS
338                - description: PCS_MISC
339
340  - if:
341      properties:
342        compatible:
343          contains:
344            enum:
345              - qcom,msm8996-qmp-usb3-phy
346              - qcom,sm8250-qmp-usb3-uni-phy
347              - qcom,sm8350-qmp-usb3-uni-phy
348    then:
349      patternProperties:
350        "^phy@[0-9a-f]+$":
351          properties:
352            reg:
353              items:
354                - description: TX
355                - description: RX
356                - description: PCS
357
358examples:
359  - |
360    #include <dt-bindings/clock/qcom,gcc-sdm845.h>
361    usb_2_qmpphy: phy-wrapper@88eb000 {
362        compatible = "qcom,sdm845-qmp-usb3-uni-phy";
363        reg = <0x088eb000 0x18c>;
364        #address-cells = <1>;
365        #size-cells = <1>;
366        ranges = <0x0 0x088eb000 0x2000>;
367
368        clocks = <&gcc GCC_USB3_SEC_PHY_AUX_CLK >,
369                 <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>,
370                 <&gcc GCC_USB3_SEC_CLKREF_CLK>,
371                 <&gcc GCC_USB3_SEC_PHY_COM_AUX_CLK>;
372        clock-names = "aux", "cfg_ahb", "ref", "com_aux";
373
374        resets = <&gcc GCC_USB3PHY_PHY_SEC_BCR>,
375                 <&gcc GCC_USB3_PHY_SEC_BCR>;
376        reset-names = "phy", "common";
377
378        vdda-phy-supply = <&vdda_usb2_ss_1p2>;
379        vdda-pll-supply = <&vdda_usb2_ss_core>;
380
381        usb_2_ssphy: phy@200 {
382                reg = <0x200 0x128>,
383                      <0x400 0x1fc>,
384                      <0x800 0x218>,
385                      <0x600 0x70>;
386
387                clocks = <&gcc GCC_USB3_SEC_PHY_PIPE_CLK>;
388
389                #clock-cells = <0>;
390                clock-output-names = "usb3_uni_phy_pipe_clk_src";
391
392                #phy-cells = <0>;
393            };
394        };
395