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