Back to home page

OSCL-LXR

 
 

    


0001 * TI Highspeed MMC host controller for OMAP and 66AK2G family.
0002 
0003 The Highspeed MMC Host Controller on TI OMAP and 66AK2G family
0004 provides an interface for MMC, SD, and SDIO types of memory cards.
0005 
0006 This file documents differences between the core properties described
0007 by mmc.txt and the properties used by the omap_hsmmc driver.
0008 
0009 Required properties:
0010 --------------------
0011 - compatible:
0012  Should be "ti,omap2-hsmmc", for OMAP2 controllers
0013  Should be "ti,omap3-hsmmc", for OMAP3 controllers
0014  Should be "ti,omap3-pre-es3-hsmmc" for OMAP3 controllers pre ES3.0
0015  Should be "ti,omap4-hsmmc", for OMAP4 controllers
0016  Should be "ti,am33xx-hsmmc", for AM335x controllers
0017  Should be "ti,k2g-hsmmc", "ti,omap4-hsmmc" for 66AK2G controllers.
0018 
0019 SoC specific required properties:
0020 ---------------------------------
0021 The following are mandatory properties for OMAPs, AM33xx and AM43xx SoCs only:
0022 - ti,hwmods: Must be "mmc<n>", n is controller instance starting 1.
0023 
0024 The following are mandatory properties for 66AK2G SoCs only:
0025 - power-domains:Should contain a phandle to a PM domain provider node
0026                 and an args specifier containing the MMC device id
0027                 value. This property is as per the binding,
0028                 Documentation/devicetree/bindings/soc/ti/sci-pm-domain.yaml
0029 - clocks:       Must contain an entry for each entry in clock-names. Should
0030                 be defined as per the he appropriate clock bindings consumer
0031                 usage in Documentation/devicetree/bindings/clock/ti,sci-clk.yaml
0032 - clock-names:  Shall be "fck" for the functional clock,
0033                 and "mmchsdb_fck" for the debounce clock.
0034 
0035 
0036 Optional properties:
0037 --------------------
0038 - ti,dual-volt:         boolean, supports dual voltage cards
0039 - <supply-name>-supply: phandle to the regulator device tree node
0040                           "supply-name" examples are "vmmc",
0041                           "vmmc_aux"(deprecated)/"vqmmc" etc
0042 - ti,non-removable:     non-removable slot (like eMMC)
0043 - ti,needs-special-reset:       Requires a special softreset sequence
0044 - ti,needs-special-hs-handling: HSMMC IP needs special setting
0045                                   for handling High Speed
0046 - dmas:                 List of DMA specifiers with the controller specific
0047                         format as described in the generic DMA client
0048                         binding. A tx and rx specifier is required.
0049 - dma-names:            List of DMA request names. These strings correspond
0050                         1:1 with the DMA specifiers listed in dmas.
0051                         The string naming is to be "rx" and "tx" for
0052                         RX and TX DMA requests, respectively.
0053 
0054 Examples:
0055 
0056 [hwmod populated DMA resources]
0057 
0058         mmc1: mmc@4809c000 {
0059                 compatible = "ti,omap4-hsmmc";
0060                 reg = <0x4809c000 0x400>;
0061                 ti,hwmods = "mmc1";
0062                 ti,dual-volt;
0063                 bus-width = <4>;
0064                 vmmc-supply = <&vmmc>; /* phandle to regulator node */
0065                 ti,non-removable;
0066         };
0067 
0068 [generic DMA request binding]
0069 
0070         mmc1: mmc@4809c000 {
0071                 compatible = "ti,omap4-hsmmc";
0072                 reg = <0x4809c000 0x400>;
0073                 ti,hwmods = "mmc1";
0074                 ti,dual-volt;
0075                 bus-width = <4>;
0076                 vmmc-supply = <&vmmc>; /* phandle to regulator node */
0077                 ti,non-removable;
0078                 dmas = <&edma 24
0079                         &edma 25>;
0080                 dma-names = "tx", "rx";
0081         };
0082 
0083 [workaround for missing swakeup on am33xx]
0084 
0085 This SOC is missing the swakeup line, it will not detect SDIO irq
0086 while in suspend.
0087 
0088                              ------
0089                              | PRCM |
0090                               ------
0091                                ^ |
0092                        swakeup | | fclk
0093                                | v
0094        ------                -------               -----
0095       | card | -- CIRQ -->  | hsmmc | -- IRQ -->  | CPU |
0096        ------                -------               -----
0097 
0098 In suspend the fclk is off and the module is disfunctional. Even register reads
0099 will fail. A small logic in the host will request fclk restore, when an
0100 external event is detected. Once the clock is restored, the host detects the
0101 event normally. Since am33xx doesn't have this line it never wakes from
0102 suspend.
0103 
0104 The workaround is to reconfigure the dat1 line as a GPIO upon suspend. To make
0105 this work, we need to set the named pinctrl states "default" and "idle".
0106 Prepare idle to remux dat1 as a gpio, and default to remux it back as sdio
0107 dat1. The MMC driver will then toggle between idle and default state during
0108 runtime.
0109 
0110 In summary:
0111 1. select matching 'compatible' section, see example below.
0112 2. specify pinctrl states "default" and "idle", "sleep" is optional.
0113 3. specify the gpio irq used for detecting sdio irq in suspend
0114 
0115 If configuration is incomplete, a warning message is emitted "falling back to
0116 polling". Also check the "sdio irq mode" in /sys/kernel/debug/mmc0/regs. Mind
0117 not every application needs SDIO irq, e.g. MMC cards.
0118 
0119         mmc1: mmc@48060100 {
0120                 compatible = "ti,am33xx-hsmmc";
0121                 ...
0122                 pinctrl-names = "default", "idle", "sleep"
0123                 pinctrl-0 = <&mmc1_pins>;
0124                 pinctrl-1 = <&mmc1_idle>;
0125                 pinctrl-2 = <&mmc1_sleep>;
0126                 ...
0127                 interrupts-extended = <&intc 64 &gpio2 28 IRQ_TYPE_LEVEL_LOW>;
0128         };
0129 
0130         mmc1_idle : pinmux_cirq_pin {
0131                 pinctrl-single,pins = <
0132                         0x0f8 0x3f      /* GPIO2_28 */
0133                 >;
0134         };