xref: /freebsd/sys/contrib/device-tree/Bindings/ufs/qcom,ufs.yaml (revision f126890ac5386406dadf7c4cfa9566cbb56537c5)
1c9ccf3a3SEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2c9ccf3a3SEmmanuel Vadot%YAML 1.2
3c9ccf3a3SEmmanuel Vadot---
4c9ccf3a3SEmmanuel Vadot$id: http://devicetree.org/schemas/ufs/qcom,ufs.yaml#
5c9ccf3a3SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c9ccf3a3SEmmanuel Vadot
7c9ccf3a3SEmmanuel Vadottitle: Qualcomm Universal Flash Storage (UFS) Controller
8c9ccf3a3SEmmanuel Vadot
9c9ccf3a3SEmmanuel Vadotmaintainers:
10c9ccf3a3SEmmanuel Vadot  - Bjorn Andersson <bjorn.andersson@linaro.org>
11c9ccf3a3SEmmanuel Vadot  - Andy Gross <agross@kernel.org>
12c9ccf3a3SEmmanuel Vadot
13c9ccf3a3SEmmanuel Vadot# Select only our matches, not all jedec,ufs-2.0
14c9ccf3a3SEmmanuel Vadotselect:
15c9ccf3a3SEmmanuel Vadot  properties:
16c9ccf3a3SEmmanuel Vadot    compatible:
17c9ccf3a3SEmmanuel Vadot      contains:
18c9ccf3a3SEmmanuel Vadot        const: qcom,ufshc
19c9ccf3a3SEmmanuel Vadot  required:
20c9ccf3a3SEmmanuel Vadot    - compatible
21c9ccf3a3SEmmanuel Vadot
22c9ccf3a3SEmmanuel Vadotproperties:
23c9ccf3a3SEmmanuel Vadot  compatible:
24c9ccf3a3SEmmanuel Vadot    items:
25c9ccf3a3SEmmanuel Vadot      - enum:
26c9ccf3a3SEmmanuel Vadot          - qcom,msm8994-ufshc
27c9ccf3a3SEmmanuel Vadot          - qcom,msm8996-ufshc
28c9ccf3a3SEmmanuel Vadot          - qcom,msm8998-ufshc
29*f126890aSEmmanuel Vadot          - qcom,sa8775p-ufshc
30b97ee269SEmmanuel Vadot          - qcom,sc8280xp-ufshc
31c9ccf3a3SEmmanuel Vadot          - qcom,sdm845-ufshc
32c9ccf3a3SEmmanuel Vadot          - qcom,sm6350-ufshc
33c9ccf3a3SEmmanuel Vadot          - qcom,sm8150-ufshc
34c9ccf3a3SEmmanuel Vadot          - qcom,sm8250-ufshc
35c9ccf3a3SEmmanuel Vadot          - qcom,sm8350-ufshc
36c9ccf3a3SEmmanuel Vadot          - qcom,sm8450-ufshc
37cb7aa33aSEmmanuel Vadot          - qcom,sm8550-ufshc
38c9ccf3a3SEmmanuel Vadot      - const: qcom,ufshc
39c9ccf3a3SEmmanuel Vadot      - const: jedec,ufs-2.0
40c9ccf3a3SEmmanuel Vadot
41c9ccf3a3SEmmanuel Vadot  clocks:
42c9ccf3a3SEmmanuel Vadot    minItems: 8
43c9ccf3a3SEmmanuel Vadot    maxItems: 11
44c9ccf3a3SEmmanuel Vadot
45c9ccf3a3SEmmanuel Vadot  clock-names:
46c9ccf3a3SEmmanuel Vadot    minItems: 8
47c9ccf3a3SEmmanuel Vadot    maxItems: 11
48c9ccf3a3SEmmanuel Vadot
49cb7aa33aSEmmanuel Vadot  dma-coherent: true
50cb7aa33aSEmmanuel Vadot
51c9ccf3a3SEmmanuel Vadot  interconnects:
52c9ccf3a3SEmmanuel Vadot    minItems: 2
53c9ccf3a3SEmmanuel Vadot    maxItems: 2
54c9ccf3a3SEmmanuel Vadot
55c9ccf3a3SEmmanuel Vadot  interconnect-names:
56c9ccf3a3SEmmanuel Vadot    items:
57c9ccf3a3SEmmanuel Vadot      - const: ufs-ddr
58c9ccf3a3SEmmanuel Vadot      - const: cpu-ufs
59c9ccf3a3SEmmanuel Vadot
60c9ccf3a3SEmmanuel Vadot  iommus:
61c9ccf3a3SEmmanuel Vadot    minItems: 1
62c9ccf3a3SEmmanuel Vadot    maxItems: 2
63c9ccf3a3SEmmanuel Vadot
64c9ccf3a3SEmmanuel Vadot  phys:
65c9ccf3a3SEmmanuel Vadot    maxItems: 1
66c9ccf3a3SEmmanuel Vadot
67c9ccf3a3SEmmanuel Vadot  phy-names:
68c9ccf3a3SEmmanuel Vadot    items:
69c9ccf3a3SEmmanuel Vadot      - const: ufsphy
70c9ccf3a3SEmmanuel Vadot
71c9ccf3a3SEmmanuel Vadot  power-domains:
72c9ccf3a3SEmmanuel Vadot    maxItems: 1
73c9ccf3a3SEmmanuel Vadot
74*f126890aSEmmanuel Vadot  qcom,ice:
75*f126890aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/phandle
76*f126890aSEmmanuel Vadot    description: phandle to the Inline Crypto Engine node
77*f126890aSEmmanuel Vadot
78c9ccf3a3SEmmanuel Vadot  reg:
79c9ccf3a3SEmmanuel Vadot    minItems: 1
80c9ccf3a3SEmmanuel Vadot    maxItems: 2
81c9ccf3a3SEmmanuel Vadot
82cb7aa33aSEmmanuel Vadot  required-opps:
83cb7aa33aSEmmanuel Vadot    maxItems: 1
84cb7aa33aSEmmanuel Vadot
85c9ccf3a3SEmmanuel Vadot  resets:
86c9ccf3a3SEmmanuel Vadot    maxItems: 1
87c9ccf3a3SEmmanuel Vadot
88c9ccf3a3SEmmanuel Vadot  '#reset-cells':
89c9ccf3a3SEmmanuel Vadot    const: 1
90c9ccf3a3SEmmanuel Vadot
91c9ccf3a3SEmmanuel Vadot  reset-names:
92c9ccf3a3SEmmanuel Vadot    items:
93c9ccf3a3SEmmanuel Vadot      - const: rst
94c9ccf3a3SEmmanuel Vadot
95c9ccf3a3SEmmanuel Vadot  reset-gpios:
96c9ccf3a3SEmmanuel Vadot    maxItems: 1
97c9ccf3a3SEmmanuel Vadot    description:
98c9ccf3a3SEmmanuel Vadot      GPIO connected to the RESET pin of the UFS memory device.
99c9ccf3a3SEmmanuel Vadot
100c9ccf3a3SEmmanuel Vadotrequired:
101c9ccf3a3SEmmanuel Vadot  - compatible
102c9ccf3a3SEmmanuel Vadot  - reg
103c9ccf3a3SEmmanuel Vadot
104c9ccf3a3SEmmanuel VadotallOf:
105c9ccf3a3SEmmanuel Vadot  - $ref: ufs-common.yaml
106c9ccf3a3SEmmanuel Vadot
107c9ccf3a3SEmmanuel Vadot  - if:
108c9ccf3a3SEmmanuel Vadot      properties:
109c9ccf3a3SEmmanuel Vadot        compatible:
110c9ccf3a3SEmmanuel Vadot          contains:
111c9ccf3a3SEmmanuel Vadot            enum:
112c9ccf3a3SEmmanuel Vadot              - qcom,msm8998-ufshc
113*f126890aSEmmanuel Vadot              - qcom,sa8775p-ufshc
114b97ee269SEmmanuel Vadot              - qcom,sc8280xp-ufshc
115c9ccf3a3SEmmanuel Vadot              - qcom,sm8250-ufshc
116c9ccf3a3SEmmanuel Vadot              - qcom,sm8350-ufshc
117c9ccf3a3SEmmanuel Vadot              - qcom,sm8450-ufshc
118cb7aa33aSEmmanuel Vadot              - qcom,sm8550-ufshc
119c9ccf3a3SEmmanuel Vadot    then:
120c9ccf3a3SEmmanuel Vadot      properties:
121c9ccf3a3SEmmanuel Vadot        clocks:
122c9ccf3a3SEmmanuel Vadot          minItems: 8
123c9ccf3a3SEmmanuel Vadot          maxItems: 8
124c9ccf3a3SEmmanuel Vadot        clock-names:
125c9ccf3a3SEmmanuel Vadot          items:
126c9ccf3a3SEmmanuel Vadot            - const: core_clk
127c9ccf3a3SEmmanuel Vadot            - const: bus_aggr_clk
128c9ccf3a3SEmmanuel Vadot            - const: iface_clk
129c9ccf3a3SEmmanuel Vadot            - const: core_clk_unipro
130c9ccf3a3SEmmanuel Vadot            - const: ref_clk
131c9ccf3a3SEmmanuel Vadot            - const: tx_lane0_sync_clk
132c9ccf3a3SEmmanuel Vadot            - const: rx_lane0_sync_clk
133c9ccf3a3SEmmanuel Vadot            - const: rx_lane1_sync_clk
134c9ccf3a3SEmmanuel Vadot        reg:
135c9ccf3a3SEmmanuel Vadot          minItems: 1
136c9ccf3a3SEmmanuel Vadot          maxItems: 1
137c9ccf3a3SEmmanuel Vadot
138c9ccf3a3SEmmanuel Vadot  - if:
139c9ccf3a3SEmmanuel Vadot      properties:
140c9ccf3a3SEmmanuel Vadot        compatible:
141c9ccf3a3SEmmanuel Vadot          contains:
142c9ccf3a3SEmmanuel Vadot            enum:
143c9ccf3a3SEmmanuel Vadot              - qcom,sdm845-ufshc
144c9ccf3a3SEmmanuel Vadot              - qcom,sm6350-ufshc
145c9ccf3a3SEmmanuel Vadot              - qcom,sm8150-ufshc
146c9ccf3a3SEmmanuel Vadot    then:
147c9ccf3a3SEmmanuel Vadot      properties:
148c9ccf3a3SEmmanuel Vadot        clocks:
149c9ccf3a3SEmmanuel Vadot          minItems: 9
150c9ccf3a3SEmmanuel Vadot          maxItems: 9
151c9ccf3a3SEmmanuel Vadot        clock-names:
152c9ccf3a3SEmmanuel Vadot          items:
153c9ccf3a3SEmmanuel Vadot            - const: core_clk
154c9ccf3a3SEmmanuel Vadot            - const: bus_aggr_clk
155c9ccf3a3SEmmanuel Vadot            - const: iface_clk
156c9ccf3a3SEmmanuel Vadot            - const: core_clk_unipro
157c9ccf3a3SEmmanuel Vadot            - const: ref_clk
158c9ccf3a3SEmmanuel Vadot            - const: tx_lane0_sync_clk
159c9ccf3a3SEmmanuel Vadot            - const: rx_lane0_sync_clk
160c9ccf3a3SEmmanuel Vadot            - const: rx_lane1_sync_clk
161c9ccf3a3SEmmanuel Vadot            - const: ice_core_clk
162c9ccf3a3SEmmanuel Vadot        reg:
163c9ccf3a3SEmmanuel Vadot          minItems: 2
164c9ccf3a3SEmmanuel Vadot          maxItems: 2
165c9ccf3a3SEmmanuel Vadot
166c9ccf3a3SEmmanuel Vadot  - if:
167c9ccf3a3SEmmanuel Vadot      properties:
168c9ccf3a3SEmmanuel Vadot        compatible:
169c9ccf3a3SEmmanuel Vadot          contains:
170c9ccf3a3SEmmanuel Vadot            enum:
171c9ccf3a3SEmmanuel Vadot              - qcom,msm8996-ufshc
172c9ccf3a3SEmmanuel Vadot    then:
173c9ccf3a3SEmmanuel Vadot      properties:
174c9ccf3a3SEmmanuel Vadot        clocks:
175c9ccf3a3SEmmanuel Vadot          minItems: 11
176c9ccf3a3SEmmanuel Vadot          maxItems: 11
177c9ccf3a3SEmmanuel Vadot        clock-names:
178c9ccf3a3SEmmanuel Vadot          items:
179c9ccf3a3SEmmanuel Vadot            - const: core_clk_src
180c9ccf3a3SEmmanuel Vadot            - const: core_clk
181c9ccf3a3SEmmanuel Vadot            - const: bus_clk
182c9ccf3a3SEmmanuel Vadot            - const: bus_aggr_clk
183c9ccf3a3SEmmanuel Vadot            - const: iface_clk
184c9ccf3a3SEmmanuel Vadot            - const: core_clk_unipro_src
185c9ccf3a3SEmmanuel Vadot            - const: core_clk_unipro
186c9ccf3a3SEmmanuel Vadot            - const: core_clk_ice
187c9ccf3a3SEmmanuel Vadot            - const: ref_clk
188c9ccf3a3SEmmanuel Vadot            - const: tx_lane0_sync_clk
189c9ccf3a3SEmmanuel Vadot            - const: rx_lane0_sync_clk
190c9ccf3a3SEmmanuel Vadot        reg:
191c9ccf3a3SEmmanuel Vadot          minItems: 1
192c9ccf3a3SEmmanuel Vadot          maxItems: 1
193c9ccf3a3SEmmanuel Vadot
194c9ccf3a3SEmmanuel Vadot    # TODO: define clock bindings for qcom,msm8994-ufshc
195c9ccf3a3SEmmanuel Vadot
196*f126890aSEmmanuel Vadot  - if:
197*f126890aSEmmanuel Vadot      required:
198*f126890aSEmmanuel Vadot        - qcom,ice
199*f126890aSEmmanuel Vadot    then:
200*f126890aSEmmanuel Vadot      properties:
201*f126890aSEmmanuel Vadot        reg:
202*f126890aSEmmanuel Vadot          maxItems: 1
203*f126890aSEmmanuel Vadot        clocks:
204*f126890aSEmmanuel Vadot          minItems: 8
205*f126890aSEmmanuel Vadot          maxItems: 8
206*f126890aSEmmanuel Vadot    else:
207*f126890aSEmmanuel Vadot      properties:
208*f126890aSEmmanuel Vadot        reg:
209*f126890aSEmmanuel Vadot          minItems: 1
210*f126890aSEmmanuel Vadot          maxItems: 2
211*f126890aSEmmanuel Vadot        clocks:
212*f126890aSEmmanuel Vadot          minItems: 8
213*f126890aSEmmanuel Vadot          maxItems: 11
214*f126890aSEmmanuel Vadot
215c9ccf3a3SEmmanuel VadotunevaluatedProperties: false
216c9ccf3a3SEmmanuel Vadot
217c9ccf3a3SEmmanuel Vadotexamples:
218c9ccf3a3SEmmanuel Vadot  - |
219c9ccf3a3SEmmanuel Vadot    #include <dt-bindings/clock/qcom,gcc-sm8450.h>
220c9ccf3a3SEmmanuel Vadot    #include <dt-bindings/clock/qcom,rpmh.h>
221c9ccf3a3SEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
222c9ccf3a3SEmmanuel Vadot    #include <dt-bindings/interconnect/qcom,sm8450.h>
223c9ccf3a3SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
224c9ccf3a3SEmmanuel Vadot
225c9ccf3a3SEmmanuel Vadot    soc {
226c9ccf3a3SEmmanuel Vadot        #address-cells = <2>;
227c9ccf3a3SEmmanuel Vadot        #size-cells = <2>;
228c9ccf3a3SEmmanuel Vadot
229c9ccf3a3SEmmanuel Vadot        ufs@1d84000 {
230c9ccf3a3SEmmanuel Vadot            compatible = "qcom,sm8450-ufshc", "qcom,ufshc",
231c9ccf3a3SEmmanuel Vadot                         "jedec,ufs-2.0";
232c9ccf3a3SEmmanuel Vadot            reg = <0 0x01d84000 0 0x3000>;
233c9ccf3a3SEmmanuel Vadot            interrupts = <GIC_SPI 265 IRQ_TYPE_LEVEL_HIGH>;
234c9ccf3a3SEmmanuel Vadot            phys = <&ufs_mem_phy_lanes>;
235c9ccf3a3SEmmanuel Vadot            phy-names = "ufsphy";
236c9ccf3a3SEmmanuel Vadot            lanes-per-direction = <2>;
237c9ccf3a3SEmmanuel Vadot            #reset-cells = <1>;
238c9ccf3a3SEmmanuel Vadot            resets = <&gcc GCC_UFS_PHY_BCR>;
239c9ccf3a3SEmmanuel Vadot            reset-names = "rst";
240c9ccf3a3SEmmanuel Vadot            reset-gpios = <&tlmm 210 GPIO_ACTIVE_LOW>;
241c9ccf3a3SEmmanuel Vadot
242c9ccf3a3SEmmanuel Vadot            vcc-supply = <&vreg_l7b_2p5>;
243c9ccf3a3SEmmanuel Vadot            vcc-max-microamp = <1100000>;
244c9ccf3a3SEmmanuel Vadot            vccq-supply = <&vreg_l9b_1p2>;
245c9ccf3a3SEmmanuel Vadot            vccq-max-microamp = <1200000>;
246c9ccf3a3SEmmanuel Vadot
247c9ccf3a3SEmmanuel Vadot            power-domains = <&gcc UFS_PHY_GDSC>;
248c9ccf3a3SEmmanuel Vadot            iommus = <&apps_smmu 0xe0 0x0>;
249c9ccf3a3SEmmanuel Vadot            interconnects = <&aggre1_noc MASTER_UFS_MEM &mc_virt SLAVE_EBI1>,
250c9ccf3a3SEmmanuel Vadot                            <&gem_noc MASTER_APPSS_PROC &config_noc SLAVE_UFS_MEM_CFG>;
251c9ccf3a3SEmmanuel Vadot            interconnect-names = "ufs-ddr", "cpu-ufs";
252c9ccf3a3SEmmanuel Vadot
253c9ccf3a3SEmmanuel Vadot            clock-names = "core_clk",
254c9ccf3a3SEmmanuel Vadot                          "bus_aggr_clk",
255c9ccf3a3SEmmanuel Vadot                          "iface_clk",
256c9ccf3a3SEmmanuel Vadot                          "core_clk_unipro",
257c9ccf3a3SEmmanuel Vadot                          "ref_clk",
258c9ccf3a3SEmmanuel Vadot                          "tx_lane0_sync_clk",
259c9ccf3a3SEmmanuel Vadot                          "rx_lane0_sync_clk",
260c9ccf3a3SEmmanuel Vadot                          "rx_lane1_sync_clk";
261c9ccf3a3SEmmanuel Vadot            clocks = <&gcc GCC_UFS_PHY_AXI_CLK>,
262c9ccf3a3SEmmanuel Vadot                     <&gcc GCC_AGGRE_UFS_PHY_AXI_CLK>,
263c9ccf3a3SEmmanuel Vadot                     <&gcc GCC_UFS_PHY_AHB_CLK>,
264c9ccf3a3SEmmanuel Vadot                     <&gcc GCC_UFS_PHY_UNIPRO_CORE_CLK>,
265c9ccf3a3SEmmanuel Vadot                     <&rpmhcc RPMH_CXO_CLK>,
266c9ccf3a3SEmmanuel Vadot                     <&gcc GCC_UFS_PHY_TX_SYMBOL_0_CLK>,
267c9ccf3a3SEmmanuel Vadot                     <&gcc GCC_UFS_PHY_RX_SYMBOL_0_CLK>,
268c9ccf3a3SEmmanuel Vadot                     <&gcc GCC_UFS_PHY_RX_SYMBOL_1_CLK>;
269c9ccf3a3SEmmanuel Vadot            freq-table-hz = <75000000 300000000>,
270c9ccf3a3SEmmanuel Vadot                            <0 0>,
271c9ccf3a3SEmmanuel Vadot                            <0 0>,
272c9ccf3a3SEmmanuel Vadot                            <75000000 300000000>,
273c9ccf3a3SEmmanuel Vadot                            <75000000 300000000>,
274c9ccf3a3SEmmanuel Vadot                            <0 0>,
275c9ccf3a3SEmmanuel Vadot                            <0 0>,
276c9ccf3a3SEmmanuel Vadot                            <0 0>;
277c9ccf3a3SEmmanuel Vadot        };
278c9ccf3a3SEmmanuel Vadot    };
279