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,sdm845-qmp-usb3-uni-phy
27      - qcom,sdx55-qmp-usb3-uni-phy
28      - qcom,sdx65-qmp-usb3-uni-phy
29      - qcom,sm8150-qmp-usb3-uni-phy
30      - qcom,sm8250-qmp-usb3-uni-phy
31      - qcom,sm8350-qmp-usb3-uni-phy
32
33  reg:
34    items:
35      - description: serdes
36
37  "#address-cells":
38    enum: [ 1, 2 ]
39
40  "#size-cells":
41    enum: [ 1, 2 ]
42
43  ranges: true
44
45  clocks:
46    minItems: 3
47    maxItems: 4
48
49  clock-names:
50    minItems: 3
51    maxItems: 4
52
53  power-domains:
54    maxItems: 1
55
56  resets:
57    maxItems: 2
58
59  reset-names:
60    maxItems: 2
61
62  vdda-phy-supply: true
63
64  vdda-pll-supply: true
65
66  vddp-ref-clk-supply: true
67
68patternProperties:
69  "^phy@[0-9a-f]+$":
70    type: object
71    description: single PHY-provider child node
72    properties:
73      reg:
74        minItems: 3
75        maxItems: 6
76
77      clocks:
78        items:
79          - description: PIPE clock
80
81      clock-names:
82        deprecated: true
83        items:
84          - const: pipe0
85
86      "#clock-cells":
87        const: 0
88
89      clock-output-names:
90        maxItems: 1
91
92      "#phy-cells":
93        const: 0
94
95    required:
96      - reg
97      - clocks
98      - "#clock-cells"
99      - clock-output-names
100      - "#phy-cells"
101
102    additionalProperties: false
103
104required:
105  - compatible
106  - reg
107  - "#address-cells"
108  - "#size-cells"
109  - ranges
110  - clocks
111  - clock-names
112  - resets
113  - reset-names
114  - vdda-phy-supply
115  - vdda-pll-supply
116
117additionalProperties: false
118
119allOf:
120  - if:
121      properties:
122        compatible:
123          contains:
124            enum:
125              - qcom,sdm845-qmp-usb3-uni-phy
126    then:
127      properties:
128        clocks:
129          maxItems: 4
130        clock-names:
131          items:
132            - const: aux
133            - const: cfg_ahb
134            - const: ref
135            - const: com_aux
136        resets:
137          maxItems: 2
138        reset-names:
139          items:
140            - const: phy
141            - const: common
142
143  - if:
144      properties:
145        compatible:
146          contains:
147            enum:
148              - qcom,ipq8074-qmp-usb3-phy
149              - qcom,msm8996-qmp-usb3-phy
150              - qcom,msm8998-qmp-usb3-phy
151              - qcom,sdx55-qmp-usb3-uni-phy
152              - qcom,sdx65-qmp-usb3-uni-phy
153    then:
154      properties:
155        clocks:
156          maxItems: 3
157        clock-names:
158          items:
159            - const: aux
160            - const: cfg_ahb
161            - const: ref
162        resets:
163          maxItems: 2
164        reset-names:
165          items:
166            - const: phy
167            - const: common
168
169  - if:
170      properties:
171        compatible:
172          contains:
173            enum:
174              - qcom,sm8150-qmp-usb3-uni-phy
175              - qcom,sm8250-qmp-usb3-uni-phy
176              - qcom,sm8350-qmp-usb3-uni-phy
177    then:
178      properties:
179        clocks:
180          maxItems: 4
181        clock-names:
182          items:
183            - const: aux
184            - const: ref_clk_src
185            - const: ref
186            - const: com_aux
187        resets:
188          maxItems: 2
189        reset-names:
190          items:
191            - const: phy
192            - const: common
193
194  - if:
195      properties:
196        compatible:
197          contains:
198            enum:
199              - qcom,msm8998-qmp-usb3-phy
200    then:
201      patternProperties:
202        "^phy@[0-9a-f]+$":
203          properties:
204            reg:
205              items:
206                - description: TX lane 1
207                - description: RX lane 1
208                - description: PCS
209                - description: TX lane 2
210                - description: RX lane 2
211
212  - if:
213      properties:
214        compatible:
215          contains:
216            enum:
217              - qcom,ipq6018-qmp-usb3-phy
218              - qcom,ipq8074-qmp-usb3-phy
219              - qcom,sdx55-qmp-usb3-uni-phy
220              - qcom,sdx65-qmp-usb3-uni-phy
221              - qcom,sm8150-qmp-usb3-uni-phy
222    then:
223      patternProperties:
224        "^phy@[0-9a-f]+$":
225          properties:
226            reg:
227              items:
228                - description: TX
229                - description: RX
230                - description: PCS
231                - description: PCS_MISC
232
233  - if:
234      properties:
235        compatible:
236          contains:
237            enum:
238              - qcom,msm8996-qmp-usb3-phy
239              - qcom,sm8250-qmp-usb3-uni-phy
240              - qcom,sm8350-qmp-usb3-uni-phy
241    then:
242      patternProperties:
243        "^phy@[0-9a-f]+$":
244          properties:
245            reg:
246              items:
247                - description: TX
248                - description: RX
249                - description: PCS
250
251examples:
252  - |
253    #include <dt-bindings/clock/qcom,gcc-sdm845.h>
254    usb_2_qmpphy: phy-wrapper@88eb000 {
255        compatible = "qcom,sdm845-qmp-usb3-uni-phy";
256        reg = <0x088eb000 0x18c>;
257        #address-cells = <1>;
258        #size-cells = <1>;
259        ranges = <0x0 0x088eb000 0x2000>;
260
261        clocks = <&gcc GCC_USB3_SEC_PHY_AUX_CLK >,
262                 <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>,
263                 <&gcc GCC_USB3_SEC_CLKREF_CLK>,
264                 <&gcc GCC_USB3_SEC_PHY_COM_AUX_CLK>;
265        clock-names = "aux", "cfg_ahb", "ref", "com_aux";
266
267        resets = <&gcc GCC_USB3PHY_PHY_SEC_BCR>,
268                 <&gcc GCC_USB3_PHY_SEC_BCR>;
269        reset-names = "phy", "common";
270
271        vdda-phy-supply = <&vdda_usb2_ss_1p2>;
272        vdda-pll-supply = <&vdda_usb2_ss_core>;
273
274        usb_2_ssphy: phy@200 {
275                reg = <0x200 0x128>,
276                      <0x400 0x1fc>,
277                      <0x800 0x218>,
278                      <0x600 0x70>;
279
280                clocks = <&gcc GCC_USB3_SEC_PHY_PIPE_CLK>;
281
282                #clock-cells = <0>;
283                clock-output-names = "usb3_uni_phy_pipe_clk_src";
284
285                #phy-cells = <0>;
286            };
287        };
288