xref: /linux/Documentation/devicetree/bindings/mmc/mtk-sd.yaml (revision 4df297aaeb9c50c6399ee70ba4347f750c87b387)
1c626695eSWenbin Mei# SPDX-License-Identifier: GPL-2.0
2c626695eSWenbin Mei%YAML 1.2
3c626695eSWenbin Mei---
4c626695eSWenbin Mei$id: http://devicetree.org/schemas/mmc/mtk-sd.yaml#
5c626695eSWenbin Mei$schema: http://devicetree.org/meta-schemas/core.yaml#
6c626695eSWenbin Mei
7c626695eSWenbin Meititle: MTK MSDC Storage Host Controller Binding
8c626695eSWenbin Mei
9c626695eSWenbin Meimaintainers:
10c626695eSWenbin Mei  - Chaotian Jing <chaotian.jing@mediatek.com>
11c626695eSWenbin Mei  - Wenbin Mei <wenbin.mei@mediatek.com>
12c626695eSWenbin Mei
13c626695eSWenbin MeiallOf:
14c626695eSWenbin Mei  - $ref: mmc-controller.yaml#
15c626695eSWenbin Mei
16c626695eSWenbin Meiproperties:
17c626695eSWenbin Mei  compatible:
18c626695eSWenbin Mei    oneOf:
19c626695eSWenbin Mei      - enum:
20c626695eSWenbin Mei          - mediatek,mt2701-mmc
21c626695eSWenbin Mei          - mediatek,mt2712-mmc
22c626695eSWenbin Mei          - mediatek,mt6779-mmc
23c626695eSWenbin Mei          - mediatek,mt7620-mmc
24c626695eSWenbin Mei          - mediatek,mt7622-mmc
25c626695eSWenbin Mei          - mediatek,mt8135-mmc
26c626695eSWenbin Mei          - mediatek,mt8173-mmc
27c626695eSWenbin Mei          - mediatek,mt8183-mmc
28c626695eSWenbin Mei          - mediatek,mt8516-mmc
29c626695eSWenbin Mei      - items:
30c626695eSWenbin Mei          - const: mediatek,mt7623-mmc
31c626695eSWenbin Mei          - const: mediatek,mt2701-mmc
3259a23395SWenbin Mei      - items:
3359a23395SWenbin Mei          - const: mediatek,mt8192-mmc
342fee14acSWenbin Mei          - const: mediatek,mt8183-mmc
352fee14acSWenbin Mei      - items:
36eb9cb722SSeiya Wang          - const: mediatek,mt8195-mmc
3759a23395SWenbin Mei          - const: mediatek,mt8183-mmc
38c626695eSWenbin Mei
39*4df297aaSRob Herring  reg:
40*4df297aaSRob Herring    maxItems: 1
41*4df297aaSRob Herring
42c626695eSWenbin Mei  clocks:
43c626695eSWenbin Mei    description:
44c626695eSWenbin Mei      Should contain phandle for the clock feeding the MMC controller.
45c626695eSWenbin Mei    minItems: 2
46c626695eSWenbin Mei    items:
47c626695eSWenbin Mei      - description: source clock (required).
48c626695eSWenbin Mei      - description: HCLK which used for host (required).
49c626695eSWenbin Mei      - description: independent source clock gate (required for MT2712).
50c626695eSWenbin Mei      - description: bus clock used for internal register access (required for MT2712 MSDC0/3).
5159a23395SWenbin Mei      - description: msdc subsys clock gate (required for MT8192).
5259a23395SWenbin Mei      - description: peripheral bus clock gate (required for MT8192).
5359a23395SWenbin Mei      - description: AXI bus clock gate (required for MT8192).
5459a23395SWenbin Mei      - description: AHB bus clock gate (required for MT8192).
55c626695eSWenbin Mei
56c626695eSWenbin Mei  clock-names:
57c626695eSWenbin Mei    minItems: 2
58c626695eSWenbin Mei    items:
59c626695eSWenbin Mei      - const: source
60c626695eSWenbin Mei      - const: hclk
61c626695eSWenbin Mei      - const: source_cg
62c626695eSWenbin Mei      - const: bus_clk
6359a23395SWenbin Mei      - const: sys_cg
6459a23395SWenbin Mei      - const: pclk_cg
6559a23395SWenbin Mei      - const: axi_cg
6659a23395SWenbin Mei      - const: ahb_cg
67c626695eSWenbin Mei
68*4df297aaSRob Herring  interrupts:
69*4df297aaSRob Herring    maxItems: 1
70*4df297aaSRob Herring
71c626695eSWenbin Mei  pinctrl-names:
72c626695eSWenbin Mei    items:
73c626695eSWenbin Mei      - const: default
74c626695eSWenbin Mei      - const: state_uhs
75c626695eSWenbin Mei
76c626695eSWenbin Mei  pinctrl-0:
77c626695eSWenbin Mei    description:
78c626695eSWenbin Mei      should contain default/high speed pin ctrl.
79c626695eSWenbin Mei    maxItems: 1
80c626695eSWenbin Mei
81c626695eSWenbin Mei  pinctrl-1:
82c626695eSWenbin Mei    description:
83c626695eSWenbin Mei      should contain uhs mode pin ctrl.
84c626695eSWenbin Mei    maxItems: 1
85c626695eSWenbin Mei
86c626695eSWenbin Mei  assigned-clocks:
87c626695eSWenbin Mei    description:
88c626695eSWenbin Mei      PLL of the source clock.
89c626695eSWenbin Mei    maxItems: 1
90c626695eSWenbin Mei
91c626695eSWenbin Mei  assigned-clock-parents:
92c626695eSWenbin Mei    description:
93c626695eSWenbin Mei      parent of source clock, used for HS400 mode to get 400Mhz source clock.
94c626695eSWenbin Mei    maxItems: 1
95c626695eSWenbin Mei
96c626695eSWenbin Mei  hs400-ds-delay:
97c626695eSWenbin Mei    $ref: /schemas/types.yaml#/definitions/uint32
98c626695eSWenbin Mei    description:
99c626695eSWenbin Mei      HS400 DS delay setting.
100c626695eSWenbin Mei    minimum: 0
101c626695eSWenbin Mei    maximum: 0xffffffff
102c626695eSWenbin Mei
103c626695eSWenbin Mei  mediatek,hs200-cmd-int-delay:
104c626695eSWenbin Mei    $ref: /schemas/types.yaml#/definitions/uint32
105c626695eSWenbin Mei    description:
106c626695eSWenbin Mei      HS200 command internal delay setting.
107c626695eSWenbin Mei      This field has total 32 stages.
108c626695eSWenbin Mei      The value is an integer from 0 to 31.
109c626695eSWenbin Mei    minimum: 0
110c626695eSWenbin Mei    maximum: 31
111c626695eSWenbin Mei
112c626695eSWenbin Mei  mediatek,hs400-cmd-int-delay:
113c626695eSWenbin Mei    $ref: /schemas/types.yaml#/definitions/uint32
114c626695eSWenbin Mei    description:
115c626695eSWenbin Mei      HS400 command internal delay setting.
116c626695eSWenbin Mei      This field has total 32 stages.
117c626695eSWenbin Mei      The value is an integer from 0 to 31.
118c626695eSWenbin Mei    minimum: 0
119c626695eSWenbin Mei    maximum: 31
120c626695eSWenbin Mei
121c626695eSWenbin Mei  mediatek,hs400-cmd-resp-sel-rising:
122c626695eSWenbin Mei    $ref: /schemas/types.yaml#/definitions/flag
123c626695eSWenbin Mei    description:
124c626695eSWenbin Mei      HS400 command response sample selection.
125c626695eSWenbin Mei      If present, HS400 command responses are sampled on rising edges.
126c626695eSWenbin Mei      If not present, HS400 command responses are sampled on falling edges.
127c626695eSWenbin Mei
128fb4708e6SWenbin Mei  mediatek,hs400-ds-dly3:
129fb4708e6SWenbin Mei    $ref: /schemas/types.yaml#/definitions/uint32
130fb4708e6SWenbin Mei    description:
131fb4708e6SWenbin Mei      Gear of the third delay line for DS for input data latch in data
132fb4708e6SWenbin Mei      pad macro, there are 32 stages from 0 to 31.
133fb4708e6SWenbin Mei      For different corner IC, the time is different about one step, it is
134fb4708e6SWenbin Mei      about 100ps.
135fb4708e6SWenbin Mei      The value is confirmed by doing scan and calibration to find a best
136fb4708e6SWenbin Mei      value with corner IC and it is valid only for HS400 mode.
137fb4708e6SWenbin Mei    minimum: 0
138fb4708e6SWenbin Mei    maximum: 31
139fb4708e6SWenbin Mei
140c626695eSWenbin Mei  mediatek,latch-ck:
141c626695eSWenbin Mei    $ref: /schemas/types.yaml#/definitions/uint32
142c626695eSWenbin Mei    description:
143c626695eSWenbin Mei      Some SoCs do not support enhance_rx, need set correct latch-ck to avoid
144c626695eSWenbin Mei      data crc error caused by stop clock(fifo full) Valid range = [0:0x7].
145c626695eSWenbin Mei      if not present, default value is 0.
146c626695eSWenbin Mei      applied to compatible "mediatek,mt2701-mmc".
147c626695eSWenbin Mei    minimum: 0
148c626695eSWenbin Mei    maximum: 7
149c626695eSWenbin Mei
150c626695eSWenbin Mei  resets:
151c626695eSWenbin Mei    maxItems: 1
152c626695eSWenbin Mei
153c626695eSWenbin Mei  reset-names:
154c626695eSWenbin Mei    const: hrst
155c626695eSWenbin Mei
156c626695eSWenbin Meirequired:
157c626695eSWenbin Mei  - compatible
158c626695eSWenbin Mei  - reg
159c626695eSWenbin Mei  - interrupts
160c626695eSWenbin Mei  - clocks
161c626695eSWenbin Mei  - clock-names
162c626695eSWenbin Mei  - pinctrl-names
163c626695eSWenbin Mei  - pinctrl-0
164c626695eSWenbin Mei  - pinctrl-1
165c626695eSWenbin Mei  - vmmc-supply
166c626695eSWenbin Mei  - vqmmc-supply
167c626695eSWenbin Mei
168c626695eSWenbin MeiunevaluatedProperties: false
169c626695eSWenbin Mei
170c626695eSWenbin Meiexamples:
171c626695eSWenbin Mei  - |
172c626695eSWenbin Mei    #include <dt-bindings/interrupt-controller/irq.h>
173c626695eSWenbin Mei    #include <dt-bindings/interrupt-controller/arm-gic.h>
174c626695eSWenbin Mei    #include <dt-bindings/clock/mt8173-clk.h>
175c626695eSWenbin Mei    mmc0: mmc@11230000 {
176c626695eSWenbin Mei        compatible = "mediatek,mt8173-mmc";
177c626695eSWenbin Mei        reg = <0x11230000 0x1000>;
178c626695eSWenbin Mei        interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_LOW>;
179c626695eSWenbin Mei        vmmc-supply = <&mt6397_vemc_3v3_reg>;
180c626695eSWenbin Mei        vqmmc-supply = <&mt6397_vio18_reg>;
181c626695eSWenbin Mei        clocks = <&pericfg CLK_PERI_MSDC30_0>,
182c626695eSWenbin Mei                 <&topckgen CLK_TOP_MSDC50_0_H_SEL>;
183c626695eSWenbin Mei        clock-names = "source", "hclk";
184c626695eSWenbin Mei        pinctrl-names = "default", "state_uhs";
185c626695eSWenbin Mei        pinctrl-0 = <&mmc0_pins_default>;
186c626695eSWenbin Mei        pinctrl-1 = <&mmc0_pins_uhs>;
187c626695eSWenbin Mei        assigned-clocks = <&topckgen CLK_TOP_MSDC50_0_SEL>;
188c626695eSWenbin Mei        assigned-clock-parents = <&topckgen CLK_TOP_MSDCPLL_D2>;
189c626695eSWenbin Mei        hs400-ds-delay = <0x14015>;
190c626695eSWenbin Mei        mediatek,hs200-cmd-int-delay = <26>;
191c626695eSWenbin Mei        mediatek,hs400-cmd-int-delay = <14>;
192c626695eSWenbin Mei        mediatek,hs400-cmd-resp-sel-rising;
193c626695eSWenbin Mei    };
194c626695eSWenbin Mei
195c626695eSWenbin Mei...
196