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