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 784e85359SKrzysztof Kozlowskititle: MTK MSDC Storage Host Controller 8c626695eSWenbin Mei 9c626695eSWenbin Meimaintainers: 10c626695eSWenbin Mei - Chaotian Jing <chaotian.jing@mediatek.com> 11c626695eSWenbin Mei - Wenbin Mei <wenbin.mei@mediatek.com> 12c626695eSWenbin Mei 13c626695eSWenbin Meiproperties: 14c626695eSWenbin Mei compatible: 15c626695eSWenbin Mei oneOf: 16c626695eSWenbin Mei - enum: 17c626695eSWenbin Mei - mediatek,mt2701-mmc 18c626695eSWenbin Mei - mediatek,mt2712-mmc 19c626695eSWenbin Mei - mediatek,mt6779-mmc 2055e7dceeSAngeloGioacchino Del Regno - mediatek,mt6795-mmc 21c626695eSWenbin Mei - mediatek,mt7620-mmc 22c626695eSWenbin Mei - mediatek,mt7622-mmc 231b845c5aSSam Shih - mediatek,mt7986-mmc 24c626695eSWenbin Mei - mediatek,mt8135-mmc 25c626695eSWenbin Mei - mediatek,mt8173-mmc 26c626695eSWenbin Mei - mediatek,mt8183-mmc 27c626695eSWenbin Mei - mediatek,mt8516-mmc 28c626695eSWenbin Mei - items: 29c626695eSWenbin Mei - const: mediatek,mt7623-mmc 30c626695eSWenbin Mei - const: mediatek,mt2701-mmc 3159a23395SWenbin Mei - items: 324ec43b87SJohnson Wang - enum: 334ec43b87SJohnson Wang - mediatek,mt8186-mmc 344ec43b87SJohnson Wang - mediatek,mt8188-mmc 354ec43b87SJohnson Wang - mediatek,mt8192-mmc 364ec43b87SJohnson Wang - mediatek,mt8195-mmc 37*e37556d9SAlexandre Mergnat - mediatek,mt8365-mmc 3859a23395SWenbin Mei - const: mediatek,mt8183-mmc 39c626695eSWenbin Mei 404df297aaSRob Herring reg: 417792fdf6STinghan Shen minItems: 1 427792fdf6STinghan Shen items: 437792fdf6STinghan Shen - description: base register (required). 447792fdf6STinghan Shen - description: top base register (required for MT8183). 454df297aaSRob Herring 46c626695eSWenbin Mei clocks: 47c626695eSWenbin Mei description: 48c626695eSWenbin Mei Should contain phandle for the clock feeding the MMC controller. 49c626695eSWenbin Mei minItems: 2 500b36b7cdSNícolas F. R. A. Prado maxItems: 7 51c626695eSWenbin Mei 52c626695eSWenbin Mei clock-names: 53c626695eSWenbin Mei minItems: 2 540b36b7cdSNícolas F. R. A. Prado maxItems: 7 55c626695eSWenbin Mei 564df297aaSRob Herring interrupts: 57035cc395SAxe Yang description: 58035cc395SAxe Yang Should at least contain MSDC GIC interrupt. To support SDIO in-band wakeup, an extended 59035cc395SAxe Yang interrupt is required and be configured as wakeup source irq. 60035cc395SAxe Yang minItems: 1 61035cc395SAxe Yang maxItems: 2 62035cc395SAxe Yang 63035cc395SAxe Yang interrupt-names: 64035cc395SAxe Yang items: 65035cc395SAxe Yang - const: msdc 66035cc395SAxe Yang - const: sdio_wakeup 674df297aaSRob Herring 68c626695eSWenbin Mei pinctrl-names: 69035cc395SAxe Yang description: 70035cc395SAxe Yang Should at least contain default and state_uhs. To support SDIO in-band wakeup, dat1 pin 71035cc395SAxe Yang will be switched between GPIO mode and SDIO DAT1 mode, state_eint is mandatory in this 72035cc395SAxe Yang scenario. 73035cc395SAxe Yang minItems: 2 74c626695eSWenbin Mei items: 75c626695eSWenbin Mei - const: default 76c626695eSWenbin Mei - const: state_uhs 77035cc395SAxe Yang - const: state_eint 78c626695eSWenbin Mei 79c626695eSWenbin Mei pinctrl-0: 80c626695eSWenbin Mei description: 81c626695eSWenbin Mei should contain default/high speed pin ctrl. 82c626695eSWenbin Mei maxItems: 1 83c626695eSWenbin Mei 84c626695eSWenbin Mei pinctrl-1: 85c626695eSWenbin Mei description: 86c626695eSWenbin Mei should contain uhs mode pin ctrl. 87c626695eSWenbin Mei maxItems: 1 88c626695eSWenbin Mei 89035cc395SAxe Yang pinctrl-2: 90035cc395SAxe Yang description: 91035cc395SAxe Yang should switch dat1 pin to GPIO mode. 92035cc395SAxe Yang maxItems: 1 93035cc395SAxe Yang 94c626695eSWenbin Mei hs400-ds-delay: 95c626695eSWenbin Mei $ref: /schemas/types.yaml#/definitions/uint32 96c626695eSWenbin Mei description: 97c626695eSWenbin Mei HS400 DS delay setting. 98c626695eSWenbin Mei minimum: 0 99c626695eSWenbin Mei maximum: 0xffffffff 100c626695eSWenbin Mei 101c626695eSWenbin Mei mediatek,hs200-cmd-int-delay: 102c626695eSWenbin Mei $ref: /schemas/types.yaml#/definitions/uint32 103c626695eSWenbin Mei description: 104c626695eSWenbin Mei HS200 command internal delay setting. 105c626695eSWenbin Mei This field has total 32 stages. 106c626695eSWenbin Mei The value is an integer from 0 to 31. 107c626695eSWenbin Mei minimum: 0 108c626695eSWenbin Mei maximum: 31 109c626695eSWenbin Mei 110c626695eSWenbin Mei mediatek,hs400-cmd-int-delay: 111c626695eSWenbin Mei $ref: /schemas/types.yaml#/definitions/uint32 112c626695eSWenbin Mei description: 113c626695eSWenbin Mei HS400 command internal delay setting. 114c626695eSWenbin Mei This field has total 32 stages. 115c626695eSWenbin Mei The value is an integer from 0 to 31. 116c626695eSWenbin Mei minimum: 0 117c626695eSWenbin Mei maximum: 31 118c626695eSWenbin Mei 119c626695eSWenbin Mei mediatek,hs400-cmd-resp-sel-rising: 120c626695eSWenbin Mei $ref: /schemas/types.yaml#/definitions/flag 121c626695eSWenbin Mei description: 122c626695eSWenbin Mei HS400 command response sample selection. 123c626695eSWenbin Mei If present, HS400 command responses are sampled on rising edges. 124c626695eSWenbin Mei If not present, HS400 command responses are sampled on falling edges. 125c626695eSWenbin Mei 126fb4708e6SWenbin Mei mediatek,hs400-ds-dly3: 127fb4708e6SWenbin Mei $ref: /schemas/types.yaml#/definitions/uint32 128fb4708e6SWenbin Mei description: 129fb4708e6SWenbin Mei Gear of the third delay line for DS for input data latch in data 130fb4708e6SWenbin Mei pad macro, there are 32 stages from 0 to 31. 131fb4708e6SWenbin Mei For different corner IC, the time is different about one step, it is 132fb4708e6SWenbin Mei about 100ps. 133fb4708e6SWenbin Mei The value is confirmed by doing scan and calibration to find a best 134fb4708e6SWenbin Mei value with corner IC and it is valid only for HS400 mode. 135fb4708e6SWenbin Mei minimum: 0 136fb4708e6SWenbin Mei maximum: 31 137fb4708e6SWenbin Mei 138c626695eSWenbin Mei mediatek,latch-ck: 139c626695eSWenbin Mei $ref: /schemas/types.yaml#/definitions/uint32 140c626695eSWenbin Mei description: 141c626695eSWenbin Mei Some SoCs do not support enhance_rx, need set correct latch-ck to avoid 142c626695eSWenbin Mei data crc error caused by stop clock(fifo full) Valid range = [0:0x7]. 143c626695eSWenbin Mei if not present, default value is 0. 144c626695eSWenbin Mei applied to compatible "mediatek,mt2701-mmc". 145c626695eSWenbin Mei minimum: 0 146c626695eSWenbin Mei maximum: 7 147c626695eSWenbin Mei 148c626695eSWenbin Mei resets: 149c626695eSWenbin Mei maxItems: 1 150c626695eSWenbin Mei 151c626695eSWenbin Mei reset-names: 152c626695eSWenbin Mei const: hrst 153c626695eSWenbin Mei 154c626695eSWenbin Meirequired: 155c626695eSWenbin Mei - compatible 156c626695eSWenbin Mei - reg 157c626695eSWenbin Mei - interrupts 158c626695eSWenbin Mei - clocks 159c626695eSWenbin Mei - clock-names 160c626695eSWenbin Mei - pinctrl-names 161c626695eSWenbin Mei - pinctrl-0 162c626695eSWenbin Mei - pinctrl-1 163c626695eSWenbin Mei - vmmc-supply 164c626695eSWenbin Mei - vqmmc-supply 165c626695eSWenbin Mei 1660b36b7cdSNícolas F. R. A. PradoallOf: 1670b36b7cdSNícolas F. R. A. Prado - $ref: mmc-controller.yaml# 1680b36b7cdSNícolas F. R. A. Prado - if: 1690b36b7cdSNícolas F. R. A. Prado properties: 1700b36b7cdSNícolas F. R. A. Prado compatible: 1710b36b7cdSNícolas F. R. A. Prado enum: 1720b36b7cdSNícolas F. R. A. Prado - mediatek,mt2701-mmc 1730b36b7cdSNícolas F. R. A. Prado - mediatek,mt6779-mmc 1740b36b7cdSNícolas F. R. A. Prado - mediatek,mt6795-mmc 1750b36b7cdSNícolas F. R. A. Prado - mediatek,mt7620-mmc 1760b36b7cdSNícolas F. R. A. Prado - mediatek,mt7622-mmc 1770b36b7cdSNícolas F. R. A. Prado - mediatek,mt7623-mmc 1780b36b7cdSNícolas F. R. A. Prado - mediatek,mt8135-mmc 1790b36b7cdSNícolas F. R. A. Prado - mediatek,mt8173-mmc 1800b36b7cdSNícolas F. R. A. Prado - mediatek,mt8183-mmc 1810b36b7cdSNícolas F. R. A. Prado - mediatek,mt8186-mmc 1820b36b7cdSNícolas F. R. A. Prado - mediatek,mt8188-mmc 1830b36b7cdSNícolas F. R. A. Prado - mediatek,mt8195-mmc 1840b36b7cdSNícolas F. R. A. Prado - mediatek,mt8516-mmc 1850b36b7cdSNícolas F. R. A. Prado then: 1860b36b7cdSNícolas F. R. A. Prado properties: 1870b36b7cdSNícolas F. R. A. Prado clocks: 1880b36b7cdSNícolas F. R. A. Prado minItems: 2 1890b36b7cdSNícolas F. R. A. Prado items: 1900b36b7cdSNícolas F. R. A. Prado - description: source clock 1910b36b7cdSNícolas F. R. A. Prado - description: HCLK which used for host 1920b36b7cdSNícolas F. R. A. Prado - description: independent source clock gate 1930b36b7cdSNícolas F. R. A. Prado clock-names: 1940b36b7cdSNícolas F. R. A. Prado minItems: 2 1950b36b7cdSNícolas F. R. A. Prado items: 1960b36b7cdSNícolas F. R. A. Prado - const: source 1970b36b7cdSNícolas F. R. A. Prado - const: hclk 1980b36b7cdSNícolas F. R. A. Prado - const: source_cg 1990b36b7cdSNícolas F. R. A. Prado 2000b36b7cdSNícolas F. R. A. Prado - if: 2010b36b7cdSNícolas F. R. A. Prado properties: 2020b36b7cdSNícolas F. R. A. Prado compatible: 2030b36b7cdSNícolas F. R. A. Prado contains: 2040b36b7cdSNícolas F. R. A. Prado const: mediatek,mt2712-mmc 2050b36b7cdSNícolas F. R. A. Prado then: 2060b36b7cdSNícolas F. R. A. Prado properties: 2070b36b7cdSNícolas F. R. A. Prado clocks: 2080b36b7cdSNícolas F. R. A. Prado minItems: 3 2090b36b7cdSNícolas F. R. A. Prado items: 2100b36b7cdSNícolas F. R. A. Prado - description: source clock 2110b36b7cdSNícolas F. R. A. Prado - description: HCLK which used for host 2120b36b7cdSNícolas F. R. A. Prado - description: independent source clock gate 2130b36b7cdSNícolas F. R. A. Prado - description: bus clock used for internal register access (required for MSDC0/3). 2140b36b7cdSNícolas F. R. A. Prado clock-names: 2150b36b7cdSNícolas F. R. A. Prado minItems: 3 2160b36b7cdSNícolas F. R. A. Prado items: 2170b36b7cdSNícolas F. R. A. Prado - const: source 2180b36b7cdSNícolas F. R. A. Prado - const: hclk 2190b36b7cdSNícolas F. R. A. Prado - const: source_cg 2200b36b7cdSNícolas F. R. A. Prado - const: bus_clk 2210b36b7cdSNícolas F. R. A. Prado 2220b36b7cdSNícolas F. R. A. Prado - if: 2237792fdf6STinghan Shen properties: 2247792fdf6STinghan Shen compatible: 2257792fdf6STinghan Shen contains: 2267792fdf6STinghan Shen const: mediatek,mt8183-mmc 2277792fdf6STinghan Shen then: 2287792fdf6STinghan Shen properties: 2297792fdf6STinghan Shen reg: 2307792fdf6STinghan Shen minItems: 2 2317792fdf6STinghan Shen 2320b36b7cdSNícolas F. R. A. Prado - if: 2330b36b7cdSNícolas F. R. A. Prado properties: 2340b36b7cdSNícolas F. R. A. Prado compatible: 2350b36b7cdSNícolas F. R. A. Prado contains: 2361b845c5aSSam Shih enum: 2371b845c5aSSam Shih - mediatek,mt7986-mmc 2381b845c5aSSam Shih then: 2391b845c5aSSam Shih properties: 2401b845c5aSSam Shih clocks: 2411b845c5aSSam Shih minItems: 3 2421b845c5aSSam Shih items: 2431b845c5aSSam Shih - description: source clock 2441b845c5aSSam Shih - description: HCLK which used for host 2451b845c5aSSam Shih - description: independent source clock gate 2461b845c5aSSam Shih - description: bus clock used for internal register access (required for MSDC0/3). 2471b845c5aSSam Shih - description: msdc subsys clock gate 2481b845c5aSSam Shih clock-names: 2491b845c5aSSam Shih minItems: 3 2501b845c5aSSam Shih items: 2511b845c5aSSam Shih - const: source 2521b845c5aSSam Shih - const: hclk 2531b845c5aSSam Shih - const: source_cg 2541b845c5aSSam Shih - const: bus_clk 2551b845c5aSSam Shih - const: sys_cg 2561b845c5aSSam Shih 2571b845c5aSSam Shih - if: 2581b845c5aSSam Shih properties: 2591b845c5aSSam Shih compatible: 2605c133688SMengqi Zhang enum: 2615c133688SMengqi Zhang - mediatek,mt8186-mmc 2625c133688SMengqi Zhang - mediatek,mt8188-mmc 2635c133688SMengqi Zhang - mediatek,mt8195-mmc 2645c133688SMengqi Zhang then: 2655c133688SMengqi Zhang properties: 2665c133688SMengqi Zhang clocks: 2675c133688SMengqi Zhang items: 2685c133688SMengqi Zhang - description: source clock 2695c133688SMengqi Zhang - description: HCLK which used for host 2705c133688SMengqi Zhang - description: independent source clock gate 2715c133688SMengqi Zhang - description: crypto clock used for data encrypt/decrypt (optional) 2725c133688SMengqi Zhang clock-names: 2735c133688SMengqi Zhang items: 2745c133688SMengqi Zhang - const: source 2755c133688SMengqi Zhang - const: hclk 2765c133688SMengqi Zhang - const: source_cg 2775c133688SMengqi Zhang - const: crypto 2785c133688SMengqi Zhang 2795c133688SMengqi Zhang - if: 2805c133688SMengqi Zhang properties: 2815c133688SMengqi Zhang compatible: 2821b845c5aSSam Shih contains: 2830b36b7cdSNícolas F. R. A. Prado const: mediatek,mt8192-mmc 2840b36b7cdSNícolas F. R. A. Prado then: 2850b36b7cdSNícolas F. R. A. Prado properties: 2860b36b7cdSNícolas F. R. A. Prado clocks: 2870b36b7cdSNícolas F. R. A. Prado items: 2880b36b7cdSNícolas F. R. A. Prado - description: source clock 2890b36b7cdSNícolas F. R. A. Prado - description: HCLK which used for host 2900b36b7cdSNícolas F. R. A. Prado - description: independent source clock gate 2910b36b7cdSNícolas F. R. A. Prado - description: msdc subsys clock gate 2920b36b7cdSNícolas F. R. A. Prado - description: peripheral bus clock gate 2930b36b7cdSNícolas F. R. A. Prado - description: AXI bus clock gate 2940b36b7cdSNícolas F. R. A. Prado - description: AHB bus clock gate 2950b36b7cdSNícolas F. R. A. Prado clock-names: 2960b36b7cdSNícolas F. R. A. Prado items: 2970b36b7cdSNícolas F. R. A. Prado - const: source 2980b36b7cdSNícolas F. R. A. Prado - const: hclk 2990b36b7cdSNícolas F. R. A. Prado - const: source_cg 3000b36b7cdSNícolas F. R. A. Prado - const: sys_cg 3010b36b7cdSNícolas F. R. A. Prado - const: pclk_cg 3020b36b7cdSNícolas F. R. A. Prado - const: axi_cg 3030b36b7cdSNícolas F. R. A. Prado - const: ahb_cg 3040b36b7cdSNícolas F. R. A. Prado 305c626695eSWenbin MeiunevaluatedProperties: false 306c626695eSWenbin Mei 307c626695eSWenbin Meiexamples: 308c626695eSWenbin Mei - | 309c626695eSWenbin Mei #include <dt-bindings/interrupt-controller/irq.h> 310c626695eSWenbin Mei #include <dt-bindings/interrupt-controller/arm-gic.h> 311c626695eSWenbin Mei #include <dt-bindings/clock/mt8173-clk.h> 312c626695eSWenbin Mei mmc0: mmc@11230000 { 313c626695eSWenbin Mei compatible = "mediatek,mt8173-mmc"; 314c626695eSWenbin Mei reg = <0x11230000 0x1000>; 315c626695eSWenbin Mei interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_LOW>; 316c626695eSWenbin Mei vmmc-supply = <&mt6397_vemc_3v3_reg>; 317c626695eSWenbin Mei vqmmc-supply = <&mt6397_vio18_reg>; 318c626695eSWenbin Mei clocks = <&pericfg CLK_PERI_MSDC30_0>, 319c626695eSWenbin Mei <&topckgen CLK_TOP_MSDC50_0_H_SEL>; 320c626695eSWenbin Mei clock-names = "source", "hclk"; 321c626695eSWenbin Mei pinctrl-names = "default", "state_uhs"; 322c626695eSWenbin Mei pinctrl-0 = <&mmc0_pins_default>; 323c626695eSWenbin Mei pinctrl-1 = <&mmc0_pins_uhs>; 324c626695eSWenbin Mei assigned-clocks = <&topckgen CLK_TOP_MSDC50_0_SEL>; 325c626695eSWenbin Mei assigned-clock-parents = <&topckgen CLK_TOP_MSDCPLL_D2>; 326c626695eSWenbin Mei hs400-ds-delay = <0x14015>; 327c626695eSWenbin Mei mediatek,hs200-cmd-int-delay = <26>; 328c626695eSWenbin Mei mediatek,hs400-cmd-int-delay = <14>; 329c626695eSWenbin Mei mediatek,hs400-cmd-resp-sel-rising; 330c626695eSWenbin Mei }; 331c626695eSWenbin Mei 332035cc395SAxe Yang mmc3: mmc@11260000 { 333035cc395SAxe Yang compatible = "mediatek,mt8173-mmc"; 334035cc395SAxe Yang reg = <0x11260000 0x1000>; 335035cc395SAxe Yang clock-names = "source", "hclk"; 336035cc395SAxe Yang clocks = <&pericfg CLK_PERI_MSDC30_3>, 337035cc395SAxe Yang <&topckgen CLK_TOP_MSDC50_2_H_SEL>; 338035cc395SAxe Yang interrupt-names = "msdc", "sdio_wakeup"; 339035cc395SAxe Yang interrupts-extended = <&gic GIC_SPI 74 IRQ_TYPE_LEVEL_LOW 0>, 340035cc395SAxe Yang <&pio 23 IRQ_TYPE_LEVEL_LOW>; 341035cc395SAxe Yang pinctrl-names = "default", "state_uhs", "state_eint"; 342035cc395SAxe Yang pinctrl-0 = <&mmc2_pins_default>; 343035cc395SAxe Yang pinctrl-1 = <&mmc2_pins_uhs>; 344035cc395SAxe Yang pinctrl-2 = <&mmc2_pins_eint>; 345035cc395SAxe Yang bus-width = <4>; 346035cc395SAxe Yang max-frequency = <200000000>; 347035cc395SAxe Yang cap-sd-highspeed; 348035cc395SAxe Yang sd-uhs-sdr104; 349035cc395SAxe Yang keep-power-in-suspend; 350035cc395SAxe Yang wakeup-source; 351035cc395SAxe Yang cap-sdio-irq; 352035cc395SAxe Yang no-mmc; 353035cc395SAxe Yang no-sd; 354035cc395SAxe Yang non-removable; 355035cc395SAxe Yang vmmc-supply = <&sdio_fixed_3v3>; 356035cc395SAxe Yang vqmmc-supply = <&mt6397_vgp3_reg>; 357035cc395SAxe Yang mmc-pwrseq = <&wifi_pwrseq>; 358035cc395SAxe Yang }; 359035cc395SAxe Yang 360c626695eSWenbin Mei... 361