blob: 74166a0d460d9f162da02166a251a8be5122bb9c [file] [log] [blame]
Rajendra Nayak46856a62012-03-12 20:32:37 +05301* TI Highspeed MMC host controller for OMAP
2
3The Highspeed MMC Host Controller on TI OMAP family
4provides an interface for MMC, SD, and SDIO types of memory cards.
5
Chris Ball4efafee2012-06-11 21:48:16 -04006This file documents differences between the core properties described
7by mmc.txt and the properties used by the omap_hsmmc driver.
8
Rajendra Nayak46856a62012-03-12 20:32:37 +05309Required properties:
10- compatible:
11 Should be "ti,omap2-hsmmc", for OMAP2 controllers
12 Should be "ti,omap3-hsmmc", for OMAP3 controllers
Nishanth Menon59445b12014-02-13 23:45:48 -060013 Should be "ti,omap3-pre-es3-hsmmc" for OMAP3 controllers pre ES3.0
Rajendra Nayak46856a62012-03-12 20:32:37 +053014 Should be "ti,omap4-hsmmc", for OMAP4 controllers
Andreas Fenkart2cd3a2a2014-05-29 10:28:00 +020015 Should be "ti,am33xx-hsmmc", for AM335x controllers
Rajendra Nayak46856a62012-03-12 20:32:37 +053016- ti,hwmods: Must be "mmc<n>", n is controller instance starting 1
Rajendra Nayak46856a62012-03-12 20:32:37 +053017
18Optional properties:
19ti,dual-volt: boolean, supports dual voltage cards
20<supply-name>-supply: phandle to the regulator device tree node
21"supply-name" examples are "vmmc", "vmmc_aux" etc
Rajendra Nayak46856a62012-03-12 20:32:37 +053022ti,non-removable: non-removable slot (like eMMC)
23ti,needs-special-reset: Requires a special softreset sequence
Hebbar, Gururajacd587092012-11-19 21:59:58 +053024ti,needs-special-hs-handling: HSMMC IP needs special setting for handling High Speed
Matt Porter55b44522013-09-10 14:24:39 -050025dmas: List of DMA specifiers with the controller specific format
26as described in the generic DMA client binding. A tx and rx
27specifier is required.
28dma-names: List of DMA request names. These strings correspond
291:1 with the DMA specifiers listed in dmas. The string naming is
30to be "rx" and "tx" for RX and TX DMA requests, respectively.
Rajendra Nayak46856a62012-03-12 20:32:37 +053031
Matt Porter55b44522013-09-10 14:24:39 -050032Examples:
33
34[hwmod populated DMA resources]
35
Rajendra Nayak46856a62012-03-12 20:32:37 +053036 mmc1: mmc@0x4809c000 {
37 compatible = "ti,omap4-hsmmc";
38 reg = <0x4809c000 0x400>;
39 ti,hwmods = "mmc1";
40 ti,dual-volt;
Arnd Bergmann7f217792012-05-13 00:14:24 -040041 bus-width = <4>;
Rajendra Nayak46856a62012-03-12 20:32:37 +053042 vmmc-supply = <&vmmc>; /* phandle to regulator node */
43 ti,non-removable;
44 };
Matt Porter55b44522013-09-10 14:24:39 -050045
46[generic DMA request binding]
47
48 mmc1: mmc@0x4809c000 {
49 compatible = "ti,omap4-hsmmc";
50 reg = <0x4809c000 0x400>;
51 ti,hwmods = "mmc1";
52 ti,dual-volt;
53 bus-width = <4>;
54 vmmc-supply = <&vmmc>; /* phandle to regulator node */
55 ti,non-removable;
56 dmas = <&edma 24
57 &edma 25>;
58 dma-names = "tx", "rx";
59 };
Andreas Fenkart455e5cd2014-05-29 10:28:05 +020060
61[workaround for missing swakeup on am33xx]
62
63This SOC is missing the swakeup line, it will not detect SDIO irq
64while in suspend.
65
66 ------
67 | PRCM |
68 ------
69 ^ |
70 swakeup | | fclk
71 | v
72 ------ ------- -----
73 | card | -- CIRQ --> | hsmmc | -- IRQ --> | CPU |
74 ------ ------- -----
75
76In suspend the fclk is off and the module is disfunctional. Even register reads
77will fail. A small logic in the host will request fclk restore, when an
78external event is detected. Once the clock is restored, the host detects the
79event normally. Since am33xx doesn't have this line it never wakes from
80suspend.
81
82The workaround is to reconfigure the dat1 line as a GPIO upon suspend. To make
83this work, we need to set the named pinctrl states "default" and "idle".
84Prepare idle to remux dat1 as a gpio, and default to remux it back as sdio
85dat1. The MMC driver will then toggle between idle and default state during
86runtime.
87
88In summary:
891. select matching 'compatible' section, see example below.
902. specify pinctrl states "default" and "idle", "sleep" is optional.
913. specify the gpio irq used for detecting sdio irq in suspend
92
93If configuration is incomplete, a warning message is emitted "falling back to
94polling". Also check the "sdio irq mode" in /sys/kernel/debug/mmc0/regs. Mind
95not every application needs SDIO irq, e.g. MMC cards.
96
97 mmc1: mmc@48060100 {
98 compatible = "ti,am33xx-hsmmc";
99 ...
100 pinctrl-names = "default", "idle", "sleep"
101 pinctrl-0 = <&mmc1_pins>;
102 pinctrl-1 = <&mmc1_idle>;
103 pinctrl-2 = <&mmc1_sleep>;
104 ...
Andreas Fenkartc21e6782015-07-07 19:53:10 +0200105 interrupts-extended = <&intc 64 &gpio2 28 GPIO_ACTIVE_LOW>;
Andreas Fenkart455e5cd2014-05-29 10:28:05 +0200106 };
107
108 mmc1_idle : pinmux_cirq_pin {
109 pinctrl-single,pins = <
110 0x0f8 0x3f /* GPIO2_28 */
111 >;
112 };