1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2
3%YAML 1.2
4---
5$id: "http://devicetree.org/schemas/phy/qcom,qusb2-phy.yaml#"
6$schema: "http://devicetree.org/meta-schemas/core.yaml#"
7
8title: Qualcomm QUSB2 phy controller
9
10maintainers:
11  - Manu Gautam <mgautam@codeaurora.org>
12
13description:
14  QUSB2 controller supports LS/FS/HS usb connectivity on Qualcomm chipsets.
15
16properties:
17  compatible:
18    oneOf:
19      - items:
20        - enum:
21          - qcom,msm8996-qusb2-phy
22          - qcom,msm8998-qusb2-phy
23      - items:
24        - enum:
25          - qcom,sc7180-qusb2-phy
26          - qcom,sdm845-qusb2-phy
27        - const: qcom,qusb2-v2-phy
28  reg:
29    maxItems: 1
30
31  "#phy-cells":
32    const: 0
33
34  clocks:
35    minItems: 2
36    maxItems: 3
37    items:
38      - description: phy config clock
39      - description: 19.2 MHz ref clk
40      - description: phy interface clock (Optional)
41
42  clock-names:
43    minItems: 2
44    maxItems: 3
45    items:
46      - const: cfg_ahb
47      - const: ref
48      - const: iface
49
50  vdda-pll-supply:
51     description:
52       Phandle to 1.8V regulator supply to PHY refclk pll block.
53
54  vdda-phy-dpdm-supply:
55     description:
56       Phandle to 3.1V regulator supply to Dp/Dm port signals.
57
58  resets:
59    maxItems: 1
60    description:
61      Phandle to reset to phy block.
62
63  nvmem-cells:
64    maxItems: 1
65    description:
66        Phandle to nvmem cell that contains 'HS Tx trim'
67        tuning parameter value for qusb2 phy.
68
69  qcom,tcsr-syscon:
70    description:
71        Phandle to TCSR syscon register region.
72    $ref: /schemas/types.yaml#/definitions/phandle
73
74if:
75  properties:
76    compatible:
77      contains:
78        const: qcom,qusb2-v2-phy
79then:
80  properties:
81    qcom,imp-res-offset-value:
82      description:
83        It is a 6 bit value that specifies offset to be
84        added to PHY refgen RESCODE via IMP_CTRL1 register. It is a PHY
85        tuning parameter that may vary for different boards of same SOC.
86      allOf:
87        - $ref: /schemas/types.yaml#/definitions/uint32
88        - minimum: 0
89          maximum: 63
90          default: 0
91
92    qcom,bias-ctrl-value:
93      description:
94        It is a 6 bit value that specifies bias-ctrl-value. It is a PHY
95        tuning parameter that may vary for different boards of same SOC.
96      allOf:
97        - $ref: /schemas/types.yaml#/definitions/uint32
98        - minimum: 0
99          maximum: 63
100          default: 0
101
102    qcom,charge-ctrl-value:
103     description:
104        It is a 2 bit value that specifies charge-ctrl-value. It is a PHY
105        tuning parameter that may vary for different boards of same SOC.
106     allOf:
107       - $ref: /schemas/types.yaml#/definitions/uint32
108       - minimum: 0
109         maximum: 3
110         default: 0
111
112    qcom,hstx-trim-value:
113      description:
114        It is a 4 bit value that specifies tuning for HSTX
115        output current.
116        Possible range is - 15mA to 24mA (stepsize of 600 uA).
117        See dt-bindings/phy/phy-qcom-qusb2.h for applicable values.
118      allOf:
119        - $ref: /schemas/types.yaml#/definitions/uint32
120        - minimum: 0
121          maximum: 15
122          default: 3
123
124    qcom,preemphasis-level:
125      description:
126        It is a 2 bit value that specifies pre-emphasis level.
127        Possible range is 0 to 15% (stepsize of 5%).
128        See dt-bindings/phy/phy-qcom-qusb2.h for applicable values.
129      allOf:
130        - $ref: /schemas/types.yaml#/definitions/uint32
131        - minimum: 0
132          maximum: 3
133          default: 2
134
135    qcom,preemphasis-width:
136      description:
137        It is a 1 bit value that specifies how long the HSTX
138        pre-emphasis (specified using qcom,preemphasis-level) must be in
139        effect. Duration could be half-bit of full-bit.
140        See dt-bindings/phy/phy-qcom-qusb2.h for applicable values.
141      allOf:
142        - $ref: /schemas/types.yaml#/definitions/uint32
143        - minimum: 0
144          maximum: 1
145          default: 0
146
147    qcom,hsdisc-trim-value:
148      description:
149        It is a 2 bit value tuning parameter that control disconnect
150        threshold and may vary for different boards of same SOC.
151      allOf:
152        - $ref: /schemas/types.yaml#/definitions/uint32
153        - minimum: 0
154          maximum: 3
155          default: 0
156
157required:
158  - compatible
159  - reg
160  - "#phy-cells"
161  - clocks
162  - clock-names
163  - vdda-pll-supply
164  - vdda-phy-dpdm-supply
165  - resets
166
167
168examples:
169  - |
170    #include <dt-bindings/clock/qcom,gcc-msm8996.h>
171    hsusb_phy: phy@7411000 {
172        compatible = "qcom,msm8996-qusb2-phy";
173        reg = <0x7411000 0x180>;
174        #phy-cells = <0>;
175
176        clocks = <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>,
177                 <&gcc GCC_RX1_USB2_CLKREF_CLK>;
178        clock-names = "cfg_ahb", "ref";
179
180        vdda-pll-supply = <&pm8994_l12>;
181        vdda-phy-dpdm-supply = <&pm8994_l24>;
182
183        resets = <&gcc GCC_QUSB2PHY_PRIM_BCR>;
184        nvmem-cells = <&qusb2p_hstx_trim>;
185    };
186