MTK MSDC Storage Host Controller

Schema identifier ($id): "http://devicetree.org/schemas/mmc/mtk-sd.yaml#"

Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"

Maintainers (maintainers): "Chaotian Jing <chaotian.jing@mediatek.com>", "Wenbin Mei <wenbin.mei@mediatek.com>"

Properties and child nodes (properties) #

compatible — required here #

Exactly one of these rules must match (oneOf) #

Rule 1

Allowed values (enum): "mediatek,mt2701-mmc", "mediatek,mt2712-mmc", "mediatek,mt6779-mmc", "mediatek,mt6795-mmc", "mediatek,mt7620-mmc", "mediatek,mt7622-mmc", "mediatek,mt7986-mmc", "mediatek,mt7988-mmc", "mediatek,mt8135-mmc", "mediatek,mt8173-mmc", "mediatek,mt8183-mmc", "mediatek,mt8196-mmc", "mediatek,mt8516-mmc"

Rule 2

Array item rules (items)

Item 1

Exact value (const): "mediatek,mt7623-mmc"

Item 2

Exact value (const): "mediatek,mt2701-mmc"

Rule 3

Array item rules (items)

Item 1

Allowed values (enum): "mediatek,mt6893-mmc", "mediatek,mt8186-mmc", "mediatek,mt8188-mmc", "mediatek,mt8192-mmc", "mediatek,mt8195-mmc", "mediatek,mt8365-mmc"

Item 2

Exact value (const): "mediatek,mt8183-mmc"

reg — required here #

Minimum number of items (minItems): 1

Array item rules (items) #

Item 1

base register (required).

Item 2

top base register (required for MT8183).

clocks — required here #

Should contain phandle for the clock feeding the MMC controller.

Minimum number of items (minItems): 2

Maximum number of items (maxItems): 7

clock-names — required here #

Minimum number of items (minItems): 2

Maximum number of items (maxItems): 7

interrupts — required here #

Should at least contain MSDC GIC interrupt. To support SDIO in-band wakeup, an extended interrupt is required and be configured as wakeup source irq.

Minimum number of items (minItems): 1

Maximum number of items (maxItems): 2

interrupt-names — not listed as required here #

Array item rules (items) #

Item 1

Exact value (const): "msdc"

Item 2

Exact value (const): "sdio_wakeup"

pinctrl-names — required here #

Should at least contain default and state_uhs. To support SDIO in-band wakeup, dat1 pin will be switched between GPIO mode and SDIO DAT1 mode, state_eint is mandatory in this scenario.

Minimum number of items (minItems): 2

Array item rules (items) #

Item 1

Exact value (const): "default"

Item 2

Exact value (const): "state_uhs"

Item 3

Exact value (const): "state_eint"

pinctrl-0 — required here #

should contain default/high speed pin ctrl.

Maximum number of items (maxItems): 1

pinctrl-1 — required here #

should contain uhs mode pin ctrl.

Maximum number of items (maxItems): 1

pinctrl-2 — not listed as required here #

should switch dat1 pin to GPIO mode.

Maximum number of items (maxItems): 1

hs400-ds-delay — not listed as required here #

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

HS400 DS delay setting.

Minimum value (minimum): 0

Maximum value (maximum): 4294967295

mediatek,hs200-cmd-int-delay — not listed as required here #

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

HS200 command internal delay setting. This field has total 32 stages. The value is an integer from 0 to 31.

Minimum value (minimum): 0

Maximum value (maximum): 31

mediatek,hs400-cmd-int-delay — not listed as required here #

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

HS400 command internal delay setting. This field has total 32 stages. The value is an integer from 0 to 31.

Minimum value (minimum): 0

Maximum value (maximum): 31

mediatek,hs400-cmd-resp-sel-rising — not listed as required here #

Shared schema rule ($ref): /schemas/types.yaml#/definitions/flag

HS400 command response sample selection. If present, HS400 command responses are sampled on rising edges. If not present, HS400 command responses are sampled on falling edges.

mediatek,hs400-ds-dly3 — not listed as required here #

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

Gear of the third delay line for DS for input data latch in data pad macro, there are 32 stages from 0 to 31. For different corner IC, the time is different about one step, it is about 100ps. The value is confirmed by doing scan and calibration to find a best value with corner IC and it is valid only for HS400 mode.

Minimum value (minimum): 0

Maximum value (maximum): 31

mediatek,latch-ck — not listed as required here #

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

Some SoCs do not support enhance_rx, need set correct latch-ck to avoid data crc error caused by stop clock(fifo full) Valid range = [0:0x7]. if not present, default value is 0. applied to compatible "mediatek,mt2701-mmc".

Minimum value (minimum): 0

Maximum value (maximum): 7

mediatek,tuning-step — not listed as required here #

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

Some SoCs need extend tuning step for better delay value to avoid CRC issue. If not present, default tuning step is 32. For eMMC and SD, this can yield satisfactory calibration results in most cases.

Allowed values (enum): 32, 64

Default value (default): 32

resets — not listed as required here #

Maximum number of items (maxItems): 1

reset-names — not listed as required here #

Exact value (const): "hrst"

Required in this object (required): "compatible", "reg", "interrupts", "clocks", "clock-names", "pinctrl-names", "pinctrl-0", "pinctrl-1", "vmmc-supply", "vqmmc-supply"

All of these rules must match (allOf) #

Rule 1 #

Shared schema rule ($ref): mmc-controller.yaml#

Rule 2 #

Condition (if) #

Properties and child nodes (properties)

compatible — not listed as required here

Allowed values (enum): "mediatek,mt2701-mmc", "mediatek,mt6779-mmc", "mediatek,mt6795-mmc", "mediatek,mt7620-mmc", "mediatek,mt7622-mmc", "mediatek,mt7623-mmc", "mediatek,mt8135-mmc", "mediatek,mt8173-mmc", "mediatek,mt8183-mmc", "mediatek,mt8186-mmc", "mediatek,mt8188-mmc", "mediatek,mt8195-mmc", "mediatek,mt8196-mmc", "mediatek,mt8516-mmc"

When the condition matches (then) #

Properties and child nodes (properties)

clocks — not listed as required here

Minimum number of items (minItems): 2

Array item rules (items)

Item 1

source clock

Item 2

HCLK which used for host

Item 3

independent source clock gate

clock-names — not listed as required here

Minimum number of items (minItems): 2

Array item rules (items)

Item 1

Exact value (const): "source"

Item 2

Exact value (const): "hclk"

Item 3

Exact value (const): "source_cg"

Rule 3 #

Condition (if) #

Properties and child nodes (properties)

compatible — not listed as required here

Rule for matching array elements (contains)

Exact value (const): "mediatek,mt2712-mmc"

When the condition matches (then) #

Properties and child nodes (properties)

clocks — not listed as required here

Minimum number of items (minItems): 3

Array item rules (items)

Item 1

source clock

Item 2

HCLK which used for host

Item 3

independent source clock gate

Item 4

bus clock used for internal register access (required for MSDC0/3).

clock-names — not listed as required here

Minimum number of items (minItems): 3

Array item rules (items)

Item 1

Exact value (const): "source"

Item 2

Exact value (const): "hclk"

Item 3

Exact value (const): "source_cg"

Item 4

Exact value (const): "bus_clk"

Rule 4 #

Condition (if) #

Properties and child nodes (properties)

compatible — not listed as required here

Rule for matching array elements (contains)

Allowed values (enum): "mediatek,mt7986-mmc", "mediatek,mt7988-mmc", "mediatek,mt8183-mmc", "mediatek,mt8196-mmc"

When the condition matches (then) #

Properties and child nodes (properties)

reg — not listed as required here

Minimum number of items (minItems): 2

When the condition does not match (else) #

Properties and child nodes (properties)

reg — not listed as required here

Maximum number of items (maxItems): 1

Rule 5 #

Condition (if) #

Properties and child nodes (properties)

compatible — not listed as required here

Rule for matching array elements (contains)

Allowed values (enum): "mediatek,mt7986-mmc"

When the condition matches (then) #

Properties and child nodes (properties)

clocks — not listed as required here

Minimum number of items (minItems): 3

Array item rules (items)

Item 1

source clock

Item 2

HCLK which used for host

Item 3

independent source clock gate

Item 4

bus clock used for internal register access (required for MSDC0/3).

Item 5

msdc subsys clock gate

clock-names — not listed as required here

Minimum number of items (minItems): 3

Array item rules (items)

Item 1

Exact value (const): "source"

Item 2

Exact value (const): "hclk"

Item 3

Exact value (const): "source_cg"

Item 4

Exact value (const): "bus_clk"

Item 5

Exact value (const): "sys_cg"

Rule 6 #

Condition (if) #

Properties and child nodes (properties)

compatible — not listed as required here

Rule for matching array elements (contains)

Allowed values (enum): "mediatek,mt7988-mmc"

When the condition matches (then) #

Properties and child nodes (properties)

clocks — not listed as required here

Array item rules (items)

Item 1

source clock

Item 2

HCLK which used for host

Item 3

Advanced eXtensible Interface

Item 4

Advanced High-performance Bus clock

clock-names — not listed as required here

Array item rules (items)

Item 1

Exact value (const): "source"

Item 2

Exact value (const): "hclk"

Item 3

Exact value (const): "axi_cg"

Item 4

Exact value (const): "ahb_cg"

Rule 7 #

Condition (if) #

Properties and child nodes (properties)

compatible — not listed as required here

Allowed values (enum): "mediatek,mt6893-mmc", "mediatek,mt8186-mmc", "mediatek,mt8188-mmc", "mediatek,mt8195-mmc"

When the condition matches (then) #

Properties and child nodes (properties)

clocks — not listed as required here

Array item rules (items)

Item 1

source clock

Item 2

HCLK which used for host

Item 3

independent source clock gate

Item 4

crypto clock used for data encrypt/decrypt (optional)

clock-names — not listed as required here

Array item rules (items)

Item 1

Exact value (const): "source"

Item 2

Exact value (const): "hclk"

Item 3

Exact value (const): "source_cg"

Item 4

Exact value (const): "crypto"

Rule 8 #

Condition (if) #

Properties and child nodes (properties)

compatible — not listed as required here

Rule for matching array elements (contains)

Exact value (const): "mediatek,mt8192-mmc"

When the condition matches (then) #

Properties and child nodes (properties)

clocks — not listed as required here

Array item rules (items)

Item 1

source clock

Item 2

HCLK which used for host

Item 3

independent source clock gate

Item 4

msdc subsys clock gate

Item 5

peripheral bus clock gate

Item 6

AXI bus clock gate

Item 7

AHB bus clock gate

clock-names — not listed as required here

Array item rules (items)

Item 1

Exact value (const): "source"

Item 2

Exact value (const): "hclk"

Item 3

Exact value (const): "source_cg"

Item 4

Exact value (const): "sys_cg"

Item 5

Exact value (const): "pclk_cg"

Item 6

Exact value (const): "axi_cg"

Item 7

Exact value (const): "ahb_cg"

Properties not evaluated by applicable rules (unevaluatedProperties) #

false

Not allowed by this rule.

Examples (examples) #

#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/mt8173-clk.h>
mmc0: mmc@11230000 {
    compatible = "mediatek,mt8173-mmc";
    reg = <0x11230000 0x1000>;
    interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_LOW>;
    vmmc-supply = <&mt6397_vemc_3v3_reg>;
    vqmmc-supply = <&mt6397_vio18_reg>;
    clocks = <&pericfg CLK_PERI_MSDC30_0>,
             <&topckgen CLK_TOP_MSDC50_0_H_SEL>;
    clock-names = "source", "hclk";
    pinctrl-names = "default", "state_uhs";
    pinctrl-0 = <&mmc0_pins_default>;
    pinctrl-1 = <&mmc0_pins_uhs>;
    assigned-clocks = <&topckgen CLK_TOP_MSDC50_0_SEL>;
    assigned-clock-parents = <&topckgen CLK_TOP_MSDCPLL_D2>;
    hs400-ds-delay = <0x14015>;
    mediatek,hs200-cmd-int-delay = <26>;
    mediatek,hs400-cmd-int-delay = <14>;
    mediatek,hs400-cmd-resp-sel-rising;
};

mmc3: mmc@11260000 {
    compatible = "mediatek,mt8173-mmc";
    reg = <0x11260000 0x1000>;
    clock-names = "source", "hclk";
    clocks = <&pericfg CLK_PERI_MSDC30_3>,
             <&topckgen CLK_TOP_MSDC50_2_H_SEL>;
    interrupt-names = "msdc", "sdio_wakeup";
    interrupts-extended = <&gic GIC_SPI 74 IRQ_TYPE_LEVEL_LOW 0>,
                 <&pio 23 IRQ_TYPE_LEVEL_LOW>;
    pinctrl-names = "default", "state_uhs", "state_eint";
    pinctrl-0 = <&mmc2_pins_default>;
    pinctrl-1 = <&mmc2_pins_uhs>;
    pinctrl-2 = <&mmc2_pins_eint>;
    bus-width = <4>;
    max-frequency = <200000000>;
    cap-sd-highspeed;
    sd-uhs-sdr104;
    keep-power-in-suspend;
    wakeup-source;
    cap-sdio-irq;
    no-mmc;
    no-sd;
    non-removable;
    vmmc-supply = <&sdio_fixed_3v3>;
    vqmmc-supply = <&mt6397_vgp3_reg>;
    mmc-pwrseq = <&wifi_pwrseq>;
};

Source notes #

Annotations retained from the schema source

Line 1: SPDX-License-Identifier: GPL-2.0

Edit this page