13f465cfaSLokesh Vutla* TI Highspeed MMC host controller for OMAP and 66AK2G family. 246856a68SRajendra Nayak 33f465cfaSLokesh VutlaThe Highspeed MMC Host Controller on TI OMAP and 66AK2G family 446856a68SRajendra Nayakprovides an interface for MMC, SD, and SDIO types of memory cards. 546856a68SRajendra Nayak 64efafee0SChris BallThis file documents differences between the core properties described 74efafee0SChris Ballby mmc.txt and the properties used by the omap_hsmmc driver. 84efafee0SChris Ball 946856a68SRajendra NayakRequired properties: 103f465cfaSLokesh Vutla-------------------- 1146856a68SRajendra Nayak- compatible: 1246856a68SRajendra Nayak Should be "ti,omap2-hsmmc", for OMAP2 controllers 1346856a68SRajendra Nayak Should be "ti,omap3-hsmmc", for OMAP3 controllers 1459445b10SNishanth Menon Should be "ti,omap3-pre-es3-hsmmc" for OMAP3 controllers pre ES3.0 1546856a68SRajendra Nayak Should be "ti,omap4-hsmmc", for OMAP4 controllers 162cd3a2a5SAndreas Fenkart Should be "ti,am33xx-hsmmc", for AM335x controllers 173f465cfaSLokesh Vutla Should be "ti,k2g-hsmmc", "ti,omap4-hsmmc" for 66AK2G controllers. 183f465cfaSLokesh Vutla 193f465cfaSLokesh VutlaSoC specific required properties: 203f465cfaSLokesh Vutla--------------------------------- 213f465cfaSLokesh VutlaThe following are mandatory properties for OMAPs, AM33xx and AM43xx SoCs only: 223f465cfaSLokesh Vutla- ti,hwmods: Must be "mmc<n>", n is controller instance starting 1. 233f465cfaSLokesh Vutla 243f465cfaSLokesh VutlaThe following are mandatory properties for 66AK2G SoCs only: 253f465cfaSLokesh Vutla- power-domains:Should contain a phandle to a PM domain provider node 263f465cfaSLokesh Vutla and an args specifier containing the MMC device id 273f465cfaSLokesh Vutla value. This property is as per the binding, 28f22145f1SMauro Carvalho Chehab Documentation/devicetree/bindings/soc/ti/sci-pm-domain.yaml 293f465cfaSLokesh Vutla- clocks: Must contain an entry for each entry in clock-names. Should 303f465cfaSLokesh Vutla be defined as per the he appropriate clock bindings consumer 31c601eef1SMauro Carvalho Chehab usage in Documentation/devicetree/bindings/clock/ti,sci-clk.yaml 323f465cfaSLokesh Vutla- clock-names: Shall be "fck" for the functional clock, 333f465cfaSLokesh Vutla and "mmchsdb_fck" for the debounce clock. 343f465cfaSLokesh Vutla 3546856a68SRajendra Nayak 3646856a68SRajendra NayakOptional properties: 373f465cfaSLokesh Vutla-------------------- 383f465cfaSLokesh Vutla- ti,dual-volt: boolean, supports dual voltage cards 393f465cfaSLokesh Vutla- <supply-name>-supply: phandle to the regulator device tree node 403f465cfaSLokesh Vutla "supply-name" examples are "vmmc", 413f465cfaSLokesh Vutla "vmmc_aux"(deprecated)/"vqmmc" etc 423f465cfaSLokesh Vutla- ti,non-removable: non-removable slot (like eMMC) 433f465cfaSLokesh Vutla- ti,needs-special-reset: Requires a special softreset sequence 443f465cfaSLokesh Vutla- ti,needs-special-hs-handling: HSMMC IP needs special setting 453f465cfaSLokesh Vutla for handling High Speed 463f465cfaSLokesh Vutla- dmas: List of DMA specifiers with the controller specific 473f465cfaSLokesh Vutla format as described in the generic DMA client 483f465cfaSLokesh Vutla binding. A tx and rx specifier is required. 493f465cfaSLokesh Vutla- dma-names: List of DMA request names. These strings correspond 503f465cfaSLokesh Vutla 1:1 with the DMA specifiers listed in dmas. 513f465cfaSLokesh Vutla The string naming is to be "rx" and "tx" for 523f465cfaSLokesh Vutla RX and TX DMA requests, respectively. 5346856a68SRajendra Nayak 5455b4452bSMatt PorterExamples: 5555b4452bSMatt Porter 5655b4452bSMatt Porter[hwmod populated DMA resources] 5755b4452bSMatt Porter 584c9847b7SMathieu Malaterre mmc1: mmc@4809c000 { 5946856a68SRajendra Nayak compatible = "ti,omap4-hsmmc"; 6046856a68SRajendra Nayak reg = <0x4809c000 0x400>; 6146856a68SRajendra Nayak ti,hwmods = "mmc1"; 6246856a68SRajendra Nayak ti,dual-volt; 637f217794SArnd Bergmann bus-width = <4>; 6446856a68SRajendra Nayak vmmc-supply = <&vmmc>; /* phandle to regulator node */ 6546856a68SRajendra Nayak ti,non-removable; 6646856a68SRajendra Nayak }; 6755b4452bSMatt Porter 6855b4452bSMatt Porter[generic DMA request binding] 6955b4452bSMatt Porter 704c9847b7SMathieu Malaterre mmc1: mmc@4809c000 { 7155b4452bSMatt Porter compatible = "ti,omap4-hsmmc"; 7255b4452bSMatt Porter reg = <0x4809c000 0x400>; 7355b4452bSMatt Porter ti,hwmods = "mmc1"; 7455b4452bSMatt Porter ti,dual-volt; 7555b4452bSMatt Porter bus-width = <4>; 7655b4452bSMatt Porter vmmc-supply = <&vmmc>; /* phandle to regulator node */ 7755b4452bSMatt Porter ti,non-removable; 7855b4452bSMatt Porter dmas = <&edma 24 7955b4452bSMatt Porter &edma 25>; 8055b4452bSMatt Porter dma-names = "tx", "rx"; 8155b4452bSMatt Porter }; 82455e5cd6SAndreas Fenkart 83455e5cd6SAndreas Fenkart[workaround for missing swakeup on am33xx] 84455e5cd6SAndreas Fenkart 85455e5cd6SAndreas FenkartThis SOC is missing the swakeup line, it will not detect SDIO irq 86455e5cd6SAndreas Fenkartwhile in suspend. 87455e5cd6SAndreas Fenkart 88455e5cd6SAndreas Fenkart ------ 89455e5cd6SAndreas Fenkart | PRCM | 90455e5cd6SAndreas Fenkart ------ 91455e5cd6SAndreas Fenkart ^ | 92455e5cd6SAndreas Fenkart swakeup | | fclk 93455e5cd6SAndreas Fenkart | v 94455e5cd6SAndreas Fenkart ------ ------- ----- 95455e5cd6SAndreas Fenkart | card | -- CIRQ --> | hsmmc | -- IRQ --> | CPU | 96455e5cd6SAndreas Fenkart ------ ------- ----- 97455e5cd6SAndreas Fenkart 98*47aab533SBjorn HelgaasIn suspend the fclk is off and the module is dysfunctional. Even register reads 99455e5cd6SAndreas Fenkartwill fail. A small logic in the host will request fclk restore, when an 100455e5cd6SAndreas Fenkartexternal event is detected. Once the clock is restored, the host detects the 101455e5cd6SAndreas Fenkartevent normally. Since am33xx doesn't have this line it never wakes from 102455e5cd6SAndreas Fenkartsuspend. 103455e5cd6SAndreas Fenkart 104455e5cd6SAndreas FenkartThe workaround is to reconfigure the dat1 line as a GPIO upon suspend. To make 105455e5cd6SAndreas Fenkartthis work, we need to set the named pinctrl states "default" and "idle". 106455e5cd6SAndreas FenkartPrepare idle to remux dat1 as a gpio, and default to remux it back as sdio 107455e5cd6SAndreas Fenkartdat1. The MMC driver will then toggle between idle and default state during 108455e5cd6SAndreas Fenkartruntime. 109455e5cd6SAndreas Fenkart 110455e5cd6SAndreas FenkartIn summary: 111455e5cd6SAndreas Fenkart1. select matching 'compatible' section, see example below. 112455e5cd6SAndreas Fenkart2. specify pinctrl states "default" and "idle", "sleep" is optional. 113455e5cd6SAndreas Fenkart3. specify the gpio irq used for detecting sdio irq in suspend 114455e5cd6SAndreas Fenkart 115455e5cd6SAndreas FenkartIf configuration is incomplete, a warning message is emitted "falling back to 116455e5cd6SAndreas Fenkartpolling". Also check the "sdio irq mode" in /sys/kernel/debug/mmc0/regs. Mind 117455e5cd6SAndreas Fenkartnot every application needs SDIO irq, e.g. MMC cards. 118455e5cd6SAndreas Fenkart 119455e5cd6SAndreas Fenkart mmc1: mmc@48060100 { 120455e5cd6SAndreas Fenkart compatible = "ti,am33xx-hsmmc"; 121455e5cd6SAndreas Fenkart ... 122455e5cd6SAndreas Fenkart pinctrl-names = "default", "idle", "sleep" 123455e5cd6SAndreas Fenkart pinctrl-0 = <&mmc1_pins>; 124455e5cd6SAndreas Fenkart pinctrl-1 = <&mmc1_idle>; 125455e5cd6SAndreas Fenkart pinctrl-2 = <&mmc1_sleep>; 126455e5cd6SAndreas Fenkart ... 12788d5271cSTomas Paukrt interrupts-extended = <&intc 64 &gpio2 28 IRQ_TYPE_LEVEL_LOW>; 128455e5cd6SAndreas Fenkart }; 129455e5cd6SAndreas Fenkart 130455e5cd6SAndreas Fenkart mmc1_idle : pinmux_cirq_pin { 131455e5cd6SAndreas Fenkart pinctrl-single,pins = < 132455e5cd6SAndreas Fenkart 0x0f8 0x3f /* GPIO2_28 */ 133455e5cd6SAndreas Fenkart >; 134455e5cd6SAndreas Fenkart }; 135