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