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 37e37556d9SAlexandre 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 148*ec1aaf79SAxe Yang mediatek,tuning-step: 149*ec1aaf79SAxe Yang $ref: /schemas/types.yaml#/definitions/uint32 150*ec1aaf79SAxe Yang description: 151*ec1aaf79SAxe Yang Some SoCs need extend tuning step for better delay value to avoid CRC issue. 152*ec1aaf79SAxe Yang If not present, default tuning step is 32. For eMMC and SD, this can yield 153*ec1aaf79SAxe Yang satisfactory calibration results in most cases. 154*ec1aaf79SAxe Yang enum: [32, 64] 155*ec1aaf79SAxe Yang default: 32 156*ec1aaf79SAxe Yang 157c626695eSWenbin Mei resets: 158c626695eSWenbin Mei maxItems: 1 159c626695eSWenbin Mei 160c626695eSWenbin Mei reset-names: 161c626695eSWenbin Mei const: hrst 162c626695eSWenbin Mei 163c626695eSWenbin Meirequired: 164c626695eSWenbin Mei - compatible 165c626695eSWenbin Mei - reg 166c626695eSWenbin Mei - interrupts 167c626695eSWenbin Mei - clocks 168c626695eSWenbin Mei - clock-names 169c626695eSWenbin Mei - pinctrl-names 170c626695eSWenbin Mei - pinctrl-0 171c626695eSWenbin Mei - pinctrl-1 172c626695eSWenbin Mei - vmmc-supply 173c626695eSWenbin Mei - vqmmc-supply 174c626695eSWenbin Mei 1750b36b7cdSNícolas F. R. A. PradoallOf: 1760b36b7cdSNícolas F. R. A. Prado - $ref: mmc-controller.yaml# 1770b36b7cdSNícolas F. R. A. Prado - if: 1780b36b7cdSNícolas F. R. A. Prado properties: 1790b36b7cdSNícolas F. R. A. Prado compatible: 1800b36b7cdSNícolas F. R. A. Prado enum: 1810b36b7cdSNícolas F. R. A. Prado - mediatek,mt2701-mmc 1820b36b7cdSNícolas F. R. A. Prado - mediatek,mt6779-mmc 1830b36b7cdSNícolas F. R. A. Prado - mediatek,mt6795-mmc 1840b36b7cdSNícolas F. R. A. Prado - mediatek,mt7620-mmc 1850b36b7cdSNícolas F. R. A. Prado - mediatek,mt7622-mmc 1860b36b7cdSNícolas F. R. A. Prado - mediatek,mt7623-mmc 1870b36b7cdSNícolas F. R. A. Prado - mediatek,mt8135-mmc 1880b36b7cdSNícolas F. R. A. Prado - mediatek,mt8173-mmc 1890b36b7cdSNícolas F. R. A. Prado - mediatek,mt8183-mmc 1900b36b7cdSNícolas F. R. A. Prado - mediatek,mt8186-mmc 1910b36b7cdSNícolas F. R. A. Prado - mediatek,mt8188-mmc 1920b36b7cdSNícolas F. R. A. Prado - mediatek,mt8195-mmc 1930b36b7cdSNícolas F. R. A. Prado - mediatek,mt8516-mmc 1940b36b7cdSNícolas F. R. A. Prado then: 1950b36b7cdSNícolas F. R. A. Prado properties: 1960b36b7cdSNícolas F. R. A. Prado clocks: 1970b36b7cdSNícolas F. R. A. Prado minItems: 2 1980b36b7cdSNícolas F. R. A. Prado items: 1990b36b7cdSNícolas F. R. A. Prado - description: source clock 2000b36b7cdSNícolas F. R. A. Prado - description: HCLK which used for host 2010b36b7cdSNícolas F. R. A. Prado - description: independent source clock gate 2020b36b7cdSNícolas F. R. A. Prado clock-names: 2030b36b7cdSNícolas F. R. A. Prado minItems: 2 2040b36b7cdSNícolas F. R. A. Prado items: 2050b36b7cdSNícolas F. R. A. Prado - const: source 2060b36b7cdSNícolas F. R. A. Prado - const: hclk 2070b36b7cdSNícolas F. R. A. Prado - const: source_cg 2080b36b7cdSNícolas F. R. A. Prado 2090b36b7cdSNícolas F. R. A. Prado - if: 2100b36b7cdSNícolas F. R. A. Prado properties: 2110b36b7cdSNícolas F. R. A. Prado compatible: 2120b36b7cdSNícolas F. R. A. Prado contains: 2130b36b7cdSNícolas F. R. A. Prado const: mediatek,mt2712-mmc 2140b36b7cdSNícolas F. R. A. Prado then: 2150b36b7cdSNícolas F. R. A. Prado properties: 2160b36b7cdSNícolas F. R. A. Prado clocks: 2170b36b7cdSNícolas F. R. A. Prado minItems: 3 2180b36b7cdSNícolas F. R. A. Prado items: 2190b36b7cdSNícolas F. R. A. Prado - description: source clock 2200b36b7cdSNícolas F. R. A. Prado - description: HCLK which used for host 2210b36b7cdSNícolas F. R. A. Prado - description: independent source clock gate 2220b36b7cdSNícolas F. R. A. Prado - description: bus clock used for internal register access (required for MSDC0/3). 2230b36b7cdSNícolas F. R. A. Prado clock-names: 2240b36b7cdSNícolas F. R. A. Prado minItems: 3 2250b36b7cdSNícolas F. R. A. Prado items: 2260b36b7cdSNícolas F. R. A. Prado - const: source 2270b36b7cdSNícolas F. R. A. Prado - const: hclk 2280b36b7cdSNícolas F. R. A. Prado - const: source_cg 2290b36b7cdSNícolas F. R. A. Prado - const: bus_clk 2300b36b7cdSNícolas F. R. A. Prado 2310b36b7cdSNícolas F. R. A. Prado - if: 2327792fdf6STinghan Shen properties: 2337792fdf6STinghan Shen compatible: 2347792fdf6STinghan Shen contains: 2357792fdf6STinghan Shen const: mediatek,mt8183-mmc 2367792fdf6STinghan Shen then: 2377792fdf6STinghan Shen properties: 2387792fdf6STinghan Shen reg: 2397792fdf6STinghan Shen minItems: 2 2407792fdf6STinghan Shen 2410b36b7cdSNícolas F. R. A. Prado - if: 2420b36b7cdSNícolas F. R. A. Prado properties: 2430b36b7cdSNícolas F. R. A. Prado compatible: 2440b36b7cdSNícolas F. R. A. Prado contains: 2451b845c5aSSam Shih enum: 2461b845c5aSSam Shih - mediatek,mt7986-mmc 2471b845c5aSSam Shih then: 2481b845c5aSSam Shih properties: 2491b845c5aSSam Shih clocks: 2501b845c5aSSam Shih minItems: 3 2511b845c5aSSam Shih items: 2521b845c5aSSam Shih - description: source clock 2531b845c5aSSam Shih - description: HCLK which used for host 2541b845c5aSSam Shih - description: independent source clock gate 2551b845c5aSSam Shih - description: bus clock used for internal register access (required for MSDC0/3). 2561b845c5aSSam Shih - description: msdc subsys clock gate 2571b845c5aSSam Shih clock-names: 2581b845c5aSSam Shih minItems: 3 2591b845c5aSSam Shih items: 2601b845c5aSSam Shih - const: source 2611b845c5aSSam Shih - const: hclk 2621b845c5aSSam Shih - const: source_cg 2631b845c5aSSam Shih - const: bus_clk 2641b845c5aSSam Shih - const: sys_cg 2651b845c5aSSam Shih 2661b845c5aSSam Shih - if: 2671b845c5aSSam Shih properties: 2681b845c5aSSam Shih compatible: 2695c133688SMengqi Zhang enum: 2705c133688SMengqi Zhang - mediatek,mt8186-mmc 2715c133688SMengqi Zhang - mediatek,mt8188-mmc 2725c133688SMengqi Zhang - mediatek,mt8195-mmc 2735c133688SMengqi Zhang then: 2745c133688SMengqi Zhang properties: 2755c133688SMengqi Zhang clocks: 2765c133688SMengqi Zhang items: 2775c133688SMengqi Zhang - description: source clock 2785c133688SMengqi Zhang - description: HCLK which used for host 2795c133688SMengqi Zhang - description: independent source clock gate 2805c133688SMengqi Zhang - description: crypto clock used for data encrypt/decrypt (optional) 2815c133688SMengqi Zhang clock-names: 2825c133688SMengqi Zhang items: 2835c133688SMengqi Zhang - const: source 2845c133688SMengqi Zhang - const: hclk 2855c133688SMengqi Zhang - const: source_cg 2865c133688SMengqi Zhang - const: crypto 2875c133688SMengqi Zhang 2885c133688SMengqi Zhang - if: 2895c133688SMengqi Zhang properties: 2905c133688SMengqi Zhang compatible: 2911b845c5aSSam Shih contains: 2920b36b7cdSNícolas F. R. A. Prado const: mediatek,mt8192-mmc 2930b36b7cdSNícolas F. R. A. Prado then: 2940b36b7cdSNícolas F. R. A. Prado properties: 2950b36b7cdSNícolas F. R. A. Prado clocks: 2960b36b7cdSNícolas F. R. A. Prado items: 2970b36b7cdSNícolas F. R. A. Prado - description: source clock 2980b36b7cdSNícolas F. R. A. Prado - description: HCLK which used for host 2990b36b7cdSNícolas F. R. A. Prado - description: independent source clock gate 3000b36b7cdSNícolas F. R. A. Prado - description: msdc subsys clock gate 3010b36b7cdSNícolas F. R. A. Prado - description: peripheral bus clock gate 3020b36b7cdSNícolas F. R. A. Prado - description: AXI bus clock gate 3030b36b7cdSNícolas F. R. A. Prado - description: AHB bus clock gate 3040b36b7cdSNícolas F. R. A. Prado clock-names: 3050b36b7cdSNícolas F. R. A. Prado items: 3060b36b7cdSNícolas F. R. A. Prado - const: source 3070b36b7cdSNícolas F. R. A. Prado - const: hclk 3080b36b7cdSNícolas F. R. A. Prado - const: source_cg 3090b36b7cdSNícolas F. R. A. Prado - const: sys_cg 3100b36b7cdSNícolas F. R. A. Prado - const: pclk_cg 3110b36b7cdSNícolas F. R. A. Prado - const: axi_cg 3120b36b7cdSNícolas F. R. A. Prado - const: ahb_cg 3130b36b7cdSNícolas F. R. A. Prado 314c626695eSWenbin MeiunevaluatedProperties: false 315c626695eSWenbin Mei 316c626695eSWenbin Meiexamples: 317c626695eSWenbin Mei - | 318c626695eSWenbin Mei #include <dt-bindings/interrupt-controller/irq.h> 319c626695eSWenbin Mei #include <dt-bindings/interrupt-controller/arm-gic.h> 320c626695eSWenbin Mei #include <dt-bindings/clock/mt8173-clk.h> 321c626695eSWenbin Mei mmc0: mmc@11230000 { 322c626695eSWenbin Mei compatible = "mediatek,mt8173-mmc"; 323c626695eSWenbin Mei reg = <0x11230000 0x1000>; 324c626695eSWenbin Mei interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_LOW>; 325c626695eSWenbin Mei vmmc-supply = <&mt6397_vemc_3v3_reg>; 326c626695eSWenbin Mei vqmmc-supply = <&mt6397_vio18_reg>; 327c626695eSWenbin Mei clocks = <&pericfg CLK_PERI_MSDC30_0>, 328c626695eSWenbin Mei <&topckgen CLK_TOP_MSDC50_0_H_SEL>; 329c626695eSWenbin Mei clock-names = "source", "hclk"; 330c626695eSWenbin Mei pinctrl-names = "default", "state_uhs"; 331c626695eSWenbin Mei pinctrl-0 = <&mmc0_pins_default>; 332c626695eSWenbin Mei pinctrl-1 = <&mmc0_pins_uhs>; 333c626695eSWenbin Mei assigned-clocks = <&topckgen CLK_TOP_MSDC50_0_SEL>; 334c626695eSWenbin Mei assigned-clock-parents = <&topckgen CLK_TOP_MSDCPLL_D2>; 335c626695eSWenbin Mei hs400-ds-delay = <0x14015>; 336c626695eSWenbin Mei mediatek,hs200-cmd-int-delay = <26>; 337c626695eSWenbin Mei mediatek,hs400-cmd-int-delay = <14>; 338c626695eSWenbin Mei mediatek,hs400-cmd-resp-sel-rising; 339c626695eSWenbin Mei }; 340c626695eSWenbin Mei 341035cc395SAxe Yang mmc3: mmc@11260000 { 342035cc395SAxe Yang compatible = "mediatek,mt8173-mmc"; 343035cc395SAxe Yang reg = <0x11260000 0x1000>; 344035cc395SAxe Yang clock-names = "source", "hclk"; 345035cc395SAxe Yang clocks = <&pericfg CLK_PERI_MSDC30_3>, 346035cc395SAxe Yang <&topckgen CLK_TOP_MSDC50_2_H_SEL>; 347035cc395SAxe Yang interrupt-names = "msdc", "sdio_wakeup"; 348035cc395SAxe Yang interrupts-extended = <&gic GIC_SPI 74 IRQ_TYPE_LEVEL_LOW 0>, 349035cc395SAxe Yang <&pio 23 IRQ_TYPE_LEVEL_LOW>; 350035cc395SAxe Yang pinctrl-names = "default", "state_uhs", "state_eint"; 351035cc395SAxe Yang pinctrl-0 = <&mmc2_pins_default>; 352035cc395SAxe Yang pinctrl-1 = <&mmc2_pins_uhs>; 353035cc395SAxe Yang pinctrl-2 = <&mmc2_pins_eint>; 354035cc395SAxe Yang bus-width = <4>; 355035cc395SAxe Yang max-frequency = <200000000>; 356035cc395SAxe Yang cap-sd-highspeed; 357035cc395SAxe Yang sd-uhs-sdr104; 358035cc395SAxe Yang keep-power-in-suspend; 359035cc395SAxe Yang wakeup-source; 360035cc395SAxe Yang cap-sdio-irq; 361035cc395SAxe Yang no-mmc; 362035cc395SAxe Yang no-sd; 363035cc395SAxe Yang non-removable; 364035cc395SAxe Yang vmmc-supply = <&sdio_fixed_3v3>; 365035cc395SAxe Yang vqmmc-supply = <&mt6397_vgp3_reg>; 366035cc395SAxe Yang mmc-pwrseq = <&wifi_pwrseq>; 367035cc395SAxe Yang }; 368035cc395SAxe Yang 369c626695eSWenbin Mei... 370