summaryrefslogtreecommitdiffstats
path: root/Documentation/devicetree/bindings/ufs/qcom,ufs.yaml
blob: 25a5edeea164592944cb9ce36b1559cd3cf52e87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/ufs/qcom,ufs.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Qualcomm Universal Flash Storage (UFS) Controller

maintainers:
  - Bjorn Andersson <bjorn.andersson@linaro.org>
  - Andy Gross <agross@kernel.org>

# Select only our matches, not all jedec,ufs-2.0
select:
  properties:
    compatible:
      contains:
        const: qcom,ufshc
  required:
    - compatible

properties:
  compatible:
    items:
      - enum:
          - qcom,msm8994-ufshc
          - qcom,msm8996-ufshc
          - qcom,msm8998-ufshc
          - qcom,sa8775p-ufshc
          - qcom,sc7180-ufshc
          - qcom,sc7280-ufshc
          - qcom,sc8180x-ufshc
          - qcom,sc8280xp-ufshc
          - qcom,sdm845-ufshc
          - qcom,sm6115-ufshc
          - qcom,sm6125-ufshc
          - qcom,sm6350-ufshc
          - qcom,sm8150-ufshc
          - qcom,sm8250-ufshc
          - qcom,sm8350-ufshc
          - qcom,sm8450-ufshc
          - qcom,sm8550-ufshc
          - qcom,sm8650-ufshc
      - const: qcom,ufshc
      - const: jedec,ufs-2.0

  clocks:
    minItems: 7
    maxItems: 9

  clock-names:
    minItems: 7
    maxItems: 9

  dma-coherent: true

  interconnects:
    minItems: 2
    maxItems: 2

  interconnect-names:
    items:
      - const: ufs-ddr
      - const: cpu-ufs

  iommus:
    minItems: 1
    maxItems: 2

  phys:
    maxItems: 1

  phy-names:
    items:
      - const: ufsphy

  power-domains:
    maxItems: 1

  qcom,ice:
    $ref: /schemas/types.yaml#/definitions/phandle
    description: phandle to the Inline Crypto Engine node

  reg:
    minItems: 1
    maxItems: 2

  reg-names:
    items:
      - const: std
      - const: ice

  required-opps:
    maxItems: 1

  resets:
    maxItems: 1

  '#reset-cells':
    const: 1

  reset-names:
    items:
      - const: rst

  reset-gpios:
    maxItems: 1
    description:
      GPIO connected to the RESET pin of the UFS memory device.

required:
  - compatible
  - reg

allOf:
  - $ref: ufs-common.yaml

  - if:
      properties:
        compatible:
          contains:
            enum:
              - qcom,sc7180-ufshc
    then:
      properties:
        clocks:
          minItems: 7
          maxItems: 7
        clock-names:
          items:
            - const: core_clk
            - const: bus_aggr_clk
            - const: iface_clk
            - const: core_clk_unipro
            - const: ref_clk
            - const: tx_lane0_sync_clk
            - const: rx_lane0_sync_clk
        reg:
          maxItems: 1
        reg-names:
          maxItems: 1

  - if:
      properties:
        compatible:
          contains:
            enum:
              - qcom,msm8998-ufshc
              - qcom,sa8775p-ufshc
              - qcom,sc7280-ufshc
              - qcom,sc8180x-ufshc
              - qcom,sc8280xp-ufshc
              - qcom,sm8250-ufshc
              - qcom,sm8350-ufshc
              - qcom,sm8450-ufshc
              - qcom,sm8550-ufshc
              - qcom,sm8650-ufshc
    then:
      properties:
        clocks:
          minItems: 8
          maxItems: 8
        clock-names:
          items:
            - const: core_clk
            - const: bus_aggr_clk
            - const: iface_clk
            - const: core_clk_unipro
            - const: ref_clk
            - const: tx_lane0_sync_clk
            - const: rx_lane0_sync_clk
            - const: rx_lane1_sync_clk
        reg:
          minItems: 1
          maxItems: 1
        reg-names:
          maxItems: 1

  - if:
      properties:
        compatible:
          contains:
            enum:
              - qcom,sdm845-ufshc
              - qcom,sm6350-ufshc
              - qcom,sm8150-ufshc
    then:
      properties:
        clocks:
          minItems: 9
          maxItems: 9
        clock-names:
          items:
            - const: core_clk
            - const: bus_aggr_clk
            - const: iface_clk
            - const: core_clk_unipro
            - const: ref_clk
            - const: tx_lane0_sync_clk
            - const: rx_lane0_sync_clk
            - const: rx_lane1_sync_clk
            - const: ice_core_clk
        reg:
          minItems: 2
          maxItems: 2
        reg-names:
          minItems: 2
      required:
        - reg-names

  - if:
      properties:
        compatible:
          contains:
            enum:
              - qcom,msm8996-ufshc
    then:
      properties:
        clocks:
          minItems: 9
          maxItems: 9
        clock-names:
          items:
            - const: core_clk
            - const: bus_clk
            - const: bus_aggr_clk
            - const: iface_clk
            - const: core_clk_unipro
            - const: core_clk_ice
            - const: ref_clk
            - const: tx_lane0_sync_clk
            - const: rx_lane0_sync_clk
        reg:
          minItems: 1
          maxItems: 1
        reg-names:
          maxItems: 1

  - if:
      properties:
        compatible:
          contains:
            enum:
              - qcom,sm6115-ufshc
              - qcom,sm6125-ufshc
    then:
      properties:
        clocks:
          minItems: 8
          maxItems: 8
        clock-names:
          items:
            - const: core_clk
            - const: bus_aggr_clk
            - const: iface_clk
            - const: core_clk_unipro
            - const: ref_clk
            - const: tx_lane0_sync_clk
            - const: rx_lane0_sync_clk
            - const: ice_core_clk
        reg:
          minItems: 2
          maxItems: 2
        reg-names:
          minItems: 2
      required:
        - reg-names

    # TODO: define clock bindings for qcom,msm8994-ufshc

  - if:
      required:
        - qcom,ice
    then:
      properties:
        reg:
          maxItems: 1
        clocks:
          minItems: 7
          maxItems: 8
    else:
      properties:
        reg:
          minItems: 1
          maxItems: 2
        clocks:
          minItems: 7
          maxItems: 9

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/clock/qcom,gcc-sm8450.h>
    #include <dt-bindings/clock/qcom,rpmh.h>
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/interconnect/qcom,sm8450.h>
    #include <dt-bindings/interrupt-controller/arm-gic.h>

    soc {
        #address-cells = <2>;
        #size-cells = <2>;

        ufs@1d84000 {
            compatible = "qcom,sm8450-ufshc", "qcom,ufshc",
                         "jedec,ufs-2.0";
            reg = <0 0x01d84000 0 0x3000>;
            interrupts = <GIC_SPI 265 IRQ_TYPE_LEVEL_HIGH>;
            phys = <&ufs_mem_phy_lanes>;
            phy-names = "ufsphy";
            lanes-per-direction = <2>;
            #reset-cells = <1>;
            resets = <&gcc GCC_UFS_PHY_BCR>;
            reset-names = "rst";
            reset-gpios = <&tlmm 210 GPIO_ACTIVE_LOW>;

            vcc-supply = <&vreg_l7b_2p5>;
            vcc-max-microamp = <1100000>;
            vccq-supply = <&vreg_l9b_1p2>;
            vccq-max-microamp = <1200000>;

            power-domains = <&gcc UFS_PHY_GDSC>;
            iommus = <&apps_smmu 0xe0 0x0>;
            interconnects = <&aggre1_noc MASTER_UFS_MEM &mc_virt SLAVE_EBI1>,
                            <&gem_noc MASTER_APPSS_PROC &config_noc SLAVE_UFS_MEM_CFG>;
            interconnect-names = "ufs-ddr", "cpu-ufs";

            clock-names = "core_clk",
                          "bus_aggr_clk",
                          "iface_clk",
                          "core_clk_unipro",
                          "ref_clk",
                          "tx_lane0_sync_clk",
                          "rx_lane0_sync_clk",
                          "rx_lane1_sync_clk";
            clocks = <&gcc GCC_UFS_PHY_AXI_CLK>,
                     <&gcc GCC_AGGRE_UFS_PHY_AXI_CLK>,
                     <&gcc GCC_UFS_PHY_AHB_CLK>,
                     <&gcc GCC_UFS_PHY_UNIPRO_CORE_CLK>,
                     <&rpmhcc RPMH_CXO_CLK>,
                     <&gcc GCC_UFS_PHY_TX_SYMBOL_0_CLK>,
                     <&gcc GCC_UFS_PHY_RX_SYMBOL_0_CLK>,
                     <&gcc GCC_UFS_PHY_RX_SYMBOL_1_CLK>;
            freq-table-hz = <75000000 300000000>,
                            <0 0>,
                            <0 0>,
                            <75000000 300000000>,
                            <75000000 300000000>,
                            <0 0>,
                            <0 0>,
                            <0 0>;
            qcom,ice = <&ice>;
        };
    };