xref: /freebsd/sys/contrib/device-tree/Bindings/ufs/qcom,ufs.yaml (revision b97ee269eae3cbaf35c18f51a459aea581c2a7dc)
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*b97ee269SEmmanuel Vadot          - qcom,sc8280xp-ufshc
30c9ccf3a3SEmmanuel Vadot          - qcom,sdm845-ufshc
31c9ccf3a3SEmmanuel Vadot          - qcom,sm6350-ufshc
32c9ccf3a3SEmmanuel Vadot          - qcom,sm8150-ufshc
33c9ccf3a3SEmmanuel Vadot          - qcom,sm8250-ufshc
34c9ccf3a3SEmmanuel Vadot          - qcom,sm8350-ufshc
35c9ccf3a3SEmmanuel Vadot          - qcom,sm8450-ufshc
36c9ccf3a3SEmmanuel Vadot      - const: qcom,ufshc
37c9ccf3a3SEmmanuel Vadot      - const: jedec,ufs-2.0
38c9ccf3a3SEmmanuel Vadot
39c9ccf3a3SEmmanuel Vadot  clocks:
40c9ccf3a3SEmmanuel Vadot    minItems: 8
41c9ccf3a3SEmmanuel Vadot    maxItems: 11
42c9ccf3a3SEmmanuel Vadot
43c9ccf3a3SEmmanuel Vadot  clock-names:
44c9ccf3a3SEmmanuel Vadot    minItems: 8
45c9ccf3a3SEmmanuel Vadot    maxItems: 11
46c9ccf3a3SEmmanuel Vadot
47c9ccf3a3SEmmanuel Vadot  interconnects:
48c9ccf3a3SEmmanuel Vadot    minItems: 2
49c9ccf3a3SEmmanuel Vadot    maxItems: 2
50c9ccf3a3SEmmanuel Vadot
51c9ccf3a3SEmmanuel Vadot  interconnect-names:
52c9ccf3a3SEmmanuel Vadot    items:
53c9ccf3a3SEmmanuel Vadot      - const: ufs-ddr
54c9ccf3a3SEmmanuel Vadot      - const: cpu-ufs
55c9ccf3a3SEmmanuel Vadot
56c9ccf3a3SEmmanuel Vadot  iommus:
57c9ccf3a3SEmmanuel Vadot    minItems: 1
58c9ccf3a3SEmmanuel Vadot    maxItems: 2
59c9ccf3a3SEmmanuel Vadot
60c9ccf3a3SEmmanuel Vadot  phys:
61c9ccf3a3SEmmanuel Vadot    maxItems: 1
62c9ccf3a3SEmmanuel Vadot
63c9ccf3a3SEmmanuel Vadot  phy-names:
64c9ccf3a3SEmmanuel Vadot    items:
65c9ccf3a3SEmmanuel Vadot      - const: ufsphy
66c9ccf3a3SEmmanuel Vadot
67c9ccf3a3SEmmanuel Vadot  power-domains:
68c9ccf3a3SEmmanuel Vadot    maxItems: 1
69c9ccf3a3SEmmanuel Vadot
70c9ccf3a3SEmmanuel Vadot  reg:
71c9ccf3a3SEmmanuel Vadot    minItems: 1
72c9ccf3a3SEmmanuel Vadot    maxItems: 2
73c9ccf3a3SEmmanuel Vadot
74c9ccf3a3SEmmanuel Vadot  resets:
75c9ccf3a3SEmmanuel Vadot    maxItems: 1
76c9ccf3a3SEmmanuel Vadot
77c9ccf3a3SEmmanuel Vadot  '#reset-cells':
78c9ccf3a3SEmmanuel Vadot    const: 1
79c9ccf3a3SEmmanuel Vadot
80c9ccf3a3SEmmanuel Vadot  reset-names:
81c9ccf3a3SEmmanuel Vadot    items:
82c9ccf3a3SEmmanuel Vadot      - const: rst
83c9ccf3a3SEmmanuel Vadot
84c9ccf3a3SEmmanuel Vadot  reset-gpios:
85c9ccf3a3SEmmanuel Vadot    maxItems: 1
86c9ccf3a3SEmmanuel Vadot    description:
87c9ccf3a3SEmmanuel Vadot      GPIO connected to the RESET pin of the UFS memory device.
88c9ccf3a3SEmmanuel Vadot
89c9ccf3a3SEmmanuel Vadotrequired:
90c9ccf3a3SEmmanuel Vadot  - compatible
91c9ccf3a3SEmmanuel Vadot  - reg
92c9ccf3a3SEmmanuel Vadot
93c9ccf3a3SEmmanuel VadotallOf:
94c9ccf3a3SEmmanuel Vadot  - $ref: ufs-common.yaml
95c9ccf3a3SEmmanuel Vadot
96c9ccf3a3SEmmanuel Vadot  - if:
97c9ccf3a3SEmmanuel Vadot      properties:
98c9ccf3a3SEmmanuel Vadot        compatible:
99c9ccf3a3SEmmanuel Vadot          contains:
100c9ccf3a3SEmmanuel Vadot            enum:
101c9ccf3a3SEmmanuel Vadot              - qcom,msm8998-ufshc
102*b97ee269SEmmanuel Vadot              - qcom,sc8280xp-ufshc
103c9ccf3a3SEmmanuel Vadot              - qcom,sm8250-ufshc
104c9ccf3a3SEmmanuel Vadot              - qcom,sm8350-ufshc
105c9ccf3a3SEmmanuel Vadot              - qcom,sm8450-ufshc
106c9ccf3a3SEmmanuel Vadot    then:
107c9ccf3a3SEmmanuel Vadot      properties:
108c9ccf3a3SEmmanuel Vadot        clocks:
109c9ccf3a3SEmmanuel Vadot          minItems: 8
110c9ccf3a3SEmmanuel Vadot          maxItems: 8
111c9ccf3a3SEmmanuel Vadot        clock-names:
112c9ccf3a3SEmmanuel Vadot          items:
113c9ccf3a3SEmmanuel Vadot            - const: core_clk
114c9ccf3a3SEmmanuel Vadot            - const: bus_aggr_clk
115c9ccf3a3SEmmanuel Vadot            - const: iface_clk
116c9ccf3a3SEmmanuel Vadot            - const: core_clk_unipro
117c9ccf3a3SEmmanuel Vadot            - const: ref_clk
118c9ccf3a3SEmmanuel Vadot            - const: tx_lane0_sync_clk
119c9ccf3a3SEmmanuel Vadot            - const: rx_lane0_sync_clk
120c9ccf3a3SEmmanuel Vadot            - const: rx_lane1_sync_clk
121c9ccf3a3SEmmanuel Vadot        reg:
122c9ccf3a3SEmmanuel Vadot          minItems: 1
123c9ccf3a3SEmmanuel Vadot          maxItems: 1
124c9ccf3a3SEmmanuel Vadot
125c9ccf3a3SEmmanuel Vadot  - if:
126c9ccf3a3SEmmanuel Vadot      properties:
127c9ccf3a3SEmmanuel Vadot        compatible:
128c9ccf3a3SEmmanuel Vadot          contains:
129c9ccf3a3SEmmanuel Vadot            enum:
130c9ccf3a3SEmmanuel Vadot              - qcom,sdm845-ufshc
131c9ccf3a3SEmmanuel Vadot              - qcom,sm6350-ufshc
132c9ccf3a3SEmmanuel Vadot              - qcom,sm8150-ufshc
133c9ccf3a3SEmmanuel Vadot    then:
134c9ccf3a3SEmmanuel Vadot      properties:
135c9ccf3a3SEmmanuel Vadot        clocks:
136c9ccf3a3SEmmanuel Vadot          minItems: 9
137c9ccf3a3SEmmanuel Vadot          maxItems: 9
138c9ccf3a3SEmmanuel Vadot        clock-names:
139c9ccf3a3SEmmanuel Vadot          items:
140c9ccf3a3SEmmanuel Vadot            - const: core_clk
141c9ccf3a3SEmmanuel Vadot            - const: bus_aggr_clk
142c9ccf3a3SEmmanuel Vadot            - const: iface_clk
143c9ccf3a3SEmmanuel Vadot            - const: core_clk_unipro
144c9ccf3a3SEmmanuel Vadot            - const: ref_clk
145c9ccf3a3SEmmanuel Vadot            - const: tx_lane0_sync_clk
146c9ccf3a3SEmmanuel Vadot            - const: rx_lane0_sync_clk
147c9ccf3a3SEmmanuel Vadot            - const: rx_lane1_sync_clk
148c9ccf3a3SEmmanuel Vadot            - const: ice_core_clk
149c9ccf3a3SEmmanuel Vadot        reg:
150c9ccf3a3SEmmanuel Vadot          minItems: 2
151c9ccf3a3SEmmanuel Vadot          maxItems: 2
152c9ccf3a3SEmmanuel Vadot
153c9ccf3a3SEmmanuel Vadot  - if:
154c9ccf3a3SEmmanuel Vadot      properties:
155c9ccf3a3SEmmanuel Vadot        compatible:
156c9ccf3a3SEmmanuel Vadot          contains:
157c9ccf3a3SEmmanuel Vadot            enum:
158c9ccf3a3SEmmanuel Vadot              - qcom,msm8996-ufshc
159c9ccf3a3SEmmanuel Vadot    then:
160c9ccf3a3SEmmanuel Vadot      properties:
161c9ccf3a3SEmmanuel Vadot        clocks:
162c9ccf3a3SEmmanuel Vadot          minItems: 11
163c9ccf3a3SEmmanuel Vadot          maxItems: 11
164c9ccf3a3SEmmanuel Vadot        clock-names:
165c9ccf3a3SEmmanuel Vadot          items:
166c9ccf3a3SEmmanuel Vadot            - const: core_clk_src
167c9ccf3a3SEmmanuel Vadot            - const: core_clk
168c9ccf3a3SEmmanuel Vadot            - const: bus_clk
169c9ccf3a3SEmmanuel Vadot            - const: bus_aggr_clk
170c9ccf3a3SEmmanuel Vadot            - const: iface_clk
171c9ccf3a3SEmmanuel Vadot            - const: core_clk_unipro_src
172c9ccf3a3SEmmanuel Vadot            - const: core_clk_unipro
173c9ccf3a3SEmmanuel Vadot            - const: core_clk_ice
174c9ccf3a3SEmmanuel Vadot            - const: ref_clk
175c9ccf3a3SEmmanuel Vadot            - const: tx_lane0_sync_clk
176c9ccf3a3SEmmanuel Vadot            - const: rx_lane0_sync_clk
177c9ccf3a3SEmmanuel Vadot        reg:
178c9ccf3a3SEmmanuel Vadot          minItems: 1
179c9ccf3a3SEmmanuel Vadot          maxItems: 1
180c9ccf3a3SEmmanuel Vadot
181c9ccf3a3SEmmanuel Vadot    # TODO: define clock bindings for qcom,msm8994-ufshc
182c9ccf3a3SEmmanuel Vadot
183c9ccf3a3SEmmanuel VadotunevaluatedProperties: false
184c9ccf3a3SEmmanuel Vadot
185c9ccf3a3SEmmanuel Vadotexamples:
186c9ccf3a3SEmmanuel Vadot  - |
187c9ccf3a3SEmmanuel Vadot    #include <dt-bindings/clock/qcom,gcc-sm8450.h>
188c9ccf3a3SEmmanuel Vadot    #include <dt-bindings/clock/qcom,rpmh.h>
189c9ccf3a3SEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
190c9ccf3a3SEmmanuel Vadot    #include <dt-bindings/interconnect/qcom,sm8450.h>
191c9ccf3a3SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
192c9ccf3a3SEmmanuel Vadot
193c9ccf3a3SEmmanuel Vadot    soc {
194c9ccf3a3SEmmanuel Vadot        #address-cells = <2>;
195c9ccf3a3SEmmanuel Vadot        #size-cells = <2>;
196c9ccf3a3SEmmanuel Vadot
197c9ccf3a3SEmmanuel Vadot        ufs@1d84000 {
198c9ccf3a3SEmmanuel Vadot            compatible = "qcom,sm8450-ufshc", "qcom,ufshc",
199c9ccf3a3SEmmanuel Vadot                         "jedec,ufs-2.0";
200c9ccf3a3SEmmanuel Vadot            reg = <0 0x01d84000 0 0x3000>;
201c9ccf3a3SEmmanuel Vadot            interrupts = <GIC_SPI 265 IRQ_TYPE_LEVEL_HIGH>;
202c9ccf3a3SEmmanuel Vadot            phys = <&ufs_mem_phy_lanes>;
203c9ccf3a3SEmmanuel Vadot            phy-names = "ufsphy";
204c9ccf3a3SEmmanuel Vadot            lanes-per-direction = <2>;
205c9ccf3a3SEmmanuel Vadot            #reset-cells = <1>;
206c9ccf3a3SEmmanuel Vadot            resets = <&gcc GCC_UFS_PHY_BCR>;
207c9ccf3a3SEmmanuel Vadot            reset-names = "rst";
208c9ccf3a3SEmmanuel Vadot            reset-gpios = <&tlmm 210 GPIO_ACTIVE_LOW>;
209c9ccf3a3SEmmanuel Vadot
210c9ccf3a3SEmmanuel Vadot            vcc-supply = <&vreg_l7b_2p5>;
211c9ccf3a3SEmmanuel Vadot            vcc-max-microamp = <1100000>;
212c9ccf3a3SEmmanuel Vadot            vccq-supply = <&vreg_l9b_1p2>;
213c9ccf3a3SEmmanuel Vadot            vccq-max-microamp = <1200000>;
214c9ccf3a3SEmmanuel Vadot
215c9ccf3a3SEmmanuel Vadot            power-domains = <&gcc UFS_PHY_GDSC>;
216c9ccf3a3SEmmanuel Vadot            iommus = <&apps_smmu 0xe0 0x0>;
217c9ccf3a3SEmmanuel Vadot            interconnects = <&aggre1_noc MASTER_UFS_MEM &mc_virt SLAVE_EBI1>,
218c9ccf3a3SEmmanuel Vadot                            <&gem_noc MASTER_APPSS_PROC &config_noc SLAVE_UFS_MEM_CFG>;
219c9ccf3a3SEmmanuel Vadot            interconnect-names = "ufs-ddr", "cpu-ufs";
220c9ccf3a3SEmmanuel Vadot
221c9ccf3a3SEmmanuel Vadot            clock-names = "core_clk",
222c9ccf3a3SEmmanuel Vadot                          "bus_aggr_clk",
223c9ccf3a3SEmmanuel Vadot                          "iface_clk",
224c9ccf3a3SEmmanuel Vadot                          "core_clk_unipro",
225c9ccf3a3SEmmanuel Vadot                          "ref_clk",
226c9ccf3a3SEmmanuel Vadot                          "tx_lane0_sync_clk",
227c9ccf3a3SEmmanuel Vadot                          "rx_lane0_sync_clk",
228c9ccf3a3SEmmanuel Vadot                          "rx_lane1_sync_clk";
229c9ccf3a3SEmmanuel Vadot            clocks = <&gcc GCC_UFS_PHY_AXI_CLK>,
230c9ccf3a3SEmmanuel Vadot                     <&gcc GCC_AGGRE_UFS_PHY_AXI_CLK>,
231c9ccf3a3SEmmanuel Vadot                     <&gcc GCC_UFS_PHY_AHB_CLK>,
232c9ccf3a3SEmmanuel Vadot                     <&gcc GCC_UFS_PHY_UNIPRO_CORE_CLK>,
233c9ccf3a3SEmmanuel Vadot                     <&rpmhcc RPMH_CXO_CLK>,
234c9ccf3a3SEmmanuel Vadot                     <&gcc GCC_UFS_PHY_TX_SYMBOL_0_CLK>,
235c9ccf3a3SEmmanuel Vadot                     <&gcc GCC_UFS_PHY_RX_SYMBOL_0_CLK>,
236c9ccf3a3SEmmanuel Vadot                     <&gcc GCC_UFS_PHY_RX_SYMBOL_1_CLK>;
237c9ccf3a3SEmmanuel Vadot            freq-table-hz = <75000000 300000000>,
238c9ccf3a3SEmmanuel Vadot                            <0 0>,
239c9ccf3a3SEmmanuel Vadot                            <0 0>,
240c9ccf3a3SEmmanuel Vadot                            <75000000 300000000>,
241c9ccf3a3SEmmanuel Vadot                            <75000000 300000000>,
242c9ccf3a3SEmmanuel Vadot                            <0 0>,
243c9ccf3a3SEmmanuel Vadot                            <0 0>,
244c9ccf3a3SEmmanuel Vadot                            <0 0>;
245c9ccf3a3SEmmanuel Vadot        };
246c9ccf3a3SEmmanuel Vadot    };
247