xref: /linux/Documentation/devicetree/bindings/mmc/mtk-sd.yaml (revision 2fee14ac97dc74f6a8525e69640c6972a4f36899)
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
34*2fee14acSWenbin Mei          - const: mediatek,mt8183-mmc
35*2fee14acSWenbin Mei      - items:
36eb9cb722SSeiya Wang          - const: mediatek,mt8195-mmc
3759a23395SWenbin Mei          - const: mediatek,mt8183-mmc
38c626695eSWenbin Mei
39c626695eSWenbin Mei  clocks:
40c626695eSWenbin Mei    description:
41c626695eSWenbin Mei      Should contain phandle for the clock feeding the MMC controller.
42c626695eSWenbin Mei    minItems: 2
4359a23395SWenbin Mei    maxItems: 8
44c626695eSWenbin Mei    items:
45c626695eSWenbin Mei      - description: source clock (required).
46c626695eSWenbin Mei      - description: HCLK which used for host (required).
47c626695eSWenbin Mei      - description: independent source clock gate (required for MT2712).
48c626695eSWenbin Mei      - description: bus clock used for internal register access (required for MT2712 MSDC0/3).
4959a23395SWenbin Mei      - description: msdc subsys clock gate (required for MT8192).
5059a23395SWenbin Mei      - description: peripheral bus clock gate (required for MT8192).
5159a23395SWenbin Mei      - description: AXI bus clock gate (required for MT8192).
5259a23395SWenbin Mei      - description: AHB bus clock gate (required for MT8192).
53c626695eSWenbin Mei
54c626695eSWenbin Mei  clock-names:
55c626695eSWenbin Mei    minItems: 2
5659a23395SWenbin Mei    maxItems: 8
57c626695eSWenbin Mei    items:
58c626695eSWenbin Mei      - const: source
59c626695eSWenbin Mei      - const: hclk
60c626695eSWenbin Mei      - const: source_cg
61c626695eSWenbin Mei      - const: bus_clk
6259a23395SWenbin Mei      - const: sys_cg
6359a23395SWenbin Mei      - const: pclk_cg
6459a23395SWenbin Mei      - const: axi_cg
6559a23395SWenbin Mei      - const: ahb_cg
66c626695eSWenbin Mei
67c626695eSWenbin Mei  pinctrl-names:
68c626695eSWenbin Mei    items:
69c626695eSWenbin Mei      - const: default
70c626695eSWenbin Mei      - const: state_uhs
71c626695eSWenbin Mei
72c626695eSWenbin Mei  pinctrl-0:
73c626695eSWenbin Mei    description:
74c626695eSWenbin Mei      should contain default/high speed pin ctrl.
75c626695eSWenbin Mei    maxItems: 1
76c626695eSWenbin Mei
77c626695eSWenbin Mei  pinctrl-1:
78c626695eSWenbin Mei    description:
79c626695eSWenbin Mei      should contain uhs mode pin ctrl.
80c626695eSWenbin Mei    maxItems: 1
81c626695eSWenbin Mei
82c626695eSWenbin Mei  assigned-clocks:
83c626695eSWenbin Mei    description:
84c626695eSWenbin Mei      PLL of the source clock.
85c626695eSWenbin Mei    maxItems: 1
86c626695eSWenbin Mei
87c626695eSWenbin Mei  assigned-clock-parents:
88c626695eSWenbin Mei    description:
89c626695eSWenbin Mei      parent of source clock, used for HS400 mode to get 400Mhz source clock.
90c626695eSWenbin Mei    maxItems: 1
91c626695eSWenbin Mei
92c626695eSWenbin Mei  hs400-ds-delay:
93c626695eSWenbin Mei    $ref: /schemas/types.yaml#/definitions/uint32
94c626695eSWenbin Mei    description:
95c626695eSWenbin Mei      HS400 DS delay setting.
96c626695eSWenbin Mei    minimum: 0
97c626695eSWenbin Mei    maximum: 0xffffffff
98c626695eSWenbin Mei
99c626695eSWenbin Mei  mediatek,hs200-cmd-int-delay:
100c626695eSWenbin Mei    $ref: /schemas/types.yaml#/definitions/uint32
101c626695eSWenbin Mei    description:
102c626695eSWenbin Mei      HS200 command internal delay setting.
103c626695eSWenbin Mei      This field has total 32 stages.
104c626695eSWenbin Mei      The value is an integer from 0 to 31.
105c626695eSWenbin Mei    minimum: 0
106c626695eSWenbin Mei    maximum: 31
107c626695eSWenbin Mei
108c626695eSWenbin Mei  mediatek,hs400-cmd-int-delay:
109c626695eSWenbin Mei    $ref: /schemas/types.yaml#/definitions/uint32
110c626695eSWenbin Mei    description:
111c626695eSWenbin Mei      HS400 command internal delay setting.
112c626695eSWenbin Mei      This field has total 32 stages.
113c626695eSWenbin Mei      The value is an integer from 0 to 31.
114c626695eSWenbin Mei    minimum: 0
115c626695eSWenbin Mei    maximum: 31
116c626695eSWenbin Mei
117c626695eSWenbin Mei  mediatek,hs400-cmd-resp-sel-rising:
118c626695eSWenbin Mei    $ref: /schemas/types.yaml#/definitions/flag
119c626695eSWenbin Mei    description:
120c626695eSWenbin Mei      HS400 command response sample selection.
121c626695eSWenbin Mei      If present, HS400 command responses are sampled on rising edges.
122c626695eSWenbin Mei      If not present, HS400 command responses are sampled on falling edges.
123c626695eSWenbin Mei
124c626695eSWenbin Mei  mediatek,latch-ck:
125c626695eSWenbin Mei    $ref: /schemas/types.yaml#/definitions/uint32
126c626695eSWenbin Mei    description:
127c626695eSWenbin Mei      Some SoCs do not support enhance_rx, need set correct latch-ck to avoid
128c626695eSWenbin Mei      data crc error caused by stop clock(fifo full) Valid range = [0:0x7].
129c626695eSWenbin Mei      if not present, default value is 0.
130c626695eSWenbin Mei      applied to compatible "mediatek,mt2701-mmc".
131c626695eSWenbin Mei    minimum: 0
132c626695eSWenbin Mei    maximum: 7
133c626695eSWenbin Mei
134c626695eSWenbin Mei  resets:
135c626695eSWenbin Mei    maxItems: 1
136c626695eSWenbin Mei
137c626695eSWenbin Mei  reset-names:
138c626695eSWenbin Mei    const: hrst
139c626695eSWenbin Mei
140c626695eSWenbin Meirequired:
141c626695eSWenbin Mei  - compatible
142c626695eSWenbin Mei  - reg
143c626695eSWenbin Mei  - interrupts
144c626695eSWenbin Mei  - clocks
145c626695eSWenbin Mei  - clock-names
146c626695eSWenbin Mei  - pinctrl-names
147c626695eSWenbin Mei  - pinctrl-0
148c626695eSWenbin Mei  - pinctrl-1
149c626695eSWenbin Mei  - vmmc-supply
150c626695eSWenbin Mei  - vqmmc-supply
151c626695eSWenbin Mei
152c626695eSWenbin MeiunevaluatedProperties: false
153c626695eSWenbin Mei
154c626695eSWenbin Meiexamples:
155c626695eSWenbin Mei  - |
156c626695eSWenbin Mei    #include <dt-bindings/interrupt-controller/irq.h>
157c626695eSWenbin Mei    #include <dt-bindings/interrupt-controller/arm-gic.h>
158c626695eSWenbin Mei    #include <dt-bindings/clock/mt8173-clk.h>
159c626695eSWenbin Mei    mmc0: mmc@11230000 {
160c626695eSWenbin Mei        compatible = "mediatek,mt8173-mmc";
161c626695eSWenbin Mei        reg = <0x11230000 0x1000>;
162c626695eSWenbin Mei        interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_LOW>;
163c626695eSWenbin Mei        vmmc-supply = <&mt6397_vemc_3v3_reg>;
164c626695eSWenbin Mei        vqmmc-supply = <&mt6397_vio18_reg>;
165c626695eSWenbin Mei        clocks = <&pericfg CLK_PERI_MSDC30_0>,
166c626695eSWenbin Mei                 <&topckgen CLK_TOP_MSDC50_0_H_SEL>;
167c626695eSWenbin Mei        clock-names = "source", "hclk";
168c626695eSWenbin Mei        pinctrl-names = "default", "state_uhs";
169c626695eSWenbin Mei        pinctrl-0 = <&mmc0_pins_default>;
170c626695eSWenbin Mei        pinctrl-1 = <&mmc0_pins_uhs>;
171c626695eSWenbin Mei        assigned-clocks = <&topckgen CLK_TOP_MSDC50_0_SEL>;
172c626695eSWenbin Mei        assigned-clock-parents = <&topckgen CLK_TOP_MSDCPLL_D2>;
173c626695eSWenbin Mei        hs400-ds-delay = <0x14015>;
174c626695eSWenbin Mei        mediatek,hs200-cmd-int-delay = <26>;
175c626695eSWenbin Mei        mediatek,hs400-cmd-int-delay = <14>;
176c626695eSWenbin Mei        mediatek,hs400-cmd-resp-sel-rising;
177c626695eSWenbin Mei    };
178c626695eSWenbin Mei
179c626695eSWenbin Mei...
180