aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSekhar Nori2017-01-31 06:26:38 -0600
committerKishon Vijay Abraham I2017-05-18 05:56:55 -0500
commit4861f721203924dae76114e8347a1a206d5d90ff (patch)
tree2ebf08b81aebe1d7f43e24e90914f4d69f05f0a2
parent00d2fcecb49abb62ade1f2e0f31c8c1e76452afd (diff)
downloadlinux-phy-4861f721203924dae76114e8347a1a206d5d90ff.tar.gz
linux-phy-4861f721203924dae76114e8347a1a206d5d90ff.tar.xz
linux-phy-4861f721203924dae76114e8347a1a206d5d90ff.zip
mmc: omap_hsmmc: Support non-1.8V IO controllers
OMAP HSMMC driver assumes that if the controller does not support dual-volt, then it supports only 1.8V IO. This assumption can be incorrect. For example, on K2G MMC0 supports 3.3V IO only. AM57x Beagle-x15 and IDK boards support only 3.3V IO on eMMC interface. Support device-tree property "no-1-8-v" to for controllers which are not dual-voltage and do not support 1.8V IO. Note that lack of support for this property has not led to any known regression in affected platforms so far. But it will be nice to be in sync with hardware configuration. Signed-off-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
-rw-r--r--drivers/mmc/host/omap_hsmmc.c15
-rw-r--r--include/linux/platform_data/hsmmc-omap.h5
2 files changed, 17 insertions, 3 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index c6e3efb0f8fb..7c555e3ecce8 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -865,6 +865,9 @@ static int omap_hsmmc_context_restore(struct omap_hsmmc_host *host)
865 else 865 else
866 hctl = SDVS30; 866 hctl = SDVS30;
867 capa = VS30 | VS18; 867 capa = VS30 | VS18;
868 } else if (host->pdata->controller_flags & OMAP_HSMMC_NO_1_8_V) {
869 hctl = SDVS30;
870 capa = VS30;
868 } else { 871 } else {
869 hctl = SDVS18; 872 hctl = SDVS18;
870 capa = VS18; 873 capa = VS18;
@@ -2121,11 +2124,14 @@ static void omap_hsmmc_set_capabilities(struct omap_hsmmc_host *host)
2121 2124
2122 val = OMAP_HSMMC_READ(host->base, CAPA); 2125 val = OMAP_HSMMC_READ(host->base, CAPA);
2123 2126
2124 /* Only MMC1 supports 3.0V */ 2127 if (host->pdata->controller_flags & OMAP_HSMMC_SUPPORTS_DUAL_VOLT) {
2125 if (host->pdata->controller_flags & OMAP_HSMMC_SUPPORTS_DUAL_VOLT)
2126 val |= (VS30 | VS18); 2128 val |= (VS30 | VS18);
2127 else 2129 } else if (host->pdata->controller_flags & OMAP_HSMMC_NO_1_8_V) {
2130 val |= VS30;
2131 val &= ~VS18;
2132 } else {
2128 val |= VS18; 2133 val |= VS18;
2134 }
2129 2135
2130 OMAP_HSMMC_WRITE(host->base, CAPA, val); 2136 OMAP_HSMMC_WRITE(host->base, CAPA, val);
2131} 2137}
@@ -2567,6 +2573,9 @@ static struct omap_hsmmc_platform_data *of_get_hsmmc_pdata(struct device *dev)
2567 if (of_find_property(np, "ti,dual-volt", NULL)) 2573 if (of_find_property(np, "ti,dual-volt", NULL))
2568 pdata->controller_flags |= OMAP_HSMMC_SUPPORTS_DUAL_VOLT; 2574 pdata->controller_flags |= OMAP_HSMMC_SUPPORTS_DUAL_VOLT;
2569 2575
2576 if (of_find_property(np, "no-1-8-v", NULL))
2577 pdata->controller_flags |= OMAP_HSMMC_NO_1_8_V;
2578
2570 pdata->gpio_cd = -EINVAL; 2579 pdata->gpio_cd = -EINVAL;
2571 pdata->gpio_cod = -EINVAL; 2580 pdata->gpio_cod = -EINVAL;
2572 pdata->gpio_wp = -EINVAL; 2581 pdata->gpio_wp = -EINVAL;
diff --git a/include/linux/platform_data/hsmmc-omap.h b/include/linux/platform_data/hsmmc-omap.h
index c3f2a34db97a..d7be21dc9ffd 100644
--- a/include/linux/platform_data/hsmmc-omap.h
+++ b/include/linux/platform_data/hsmmc-omap.h
@@ -23,12 +23,17 @@
23 * for example Advisory 2.1.1.128 "MMC: Multiple Block Read 23 * for example Advisory 2.1.1.128 "MMC: Multiple Block Read
24 * Operation Issue" in _OMAP3530/3525/3515/3503 Silicon Errata_ 24 * Operation Issue" in _OMAP3530/3525/3515/3503 Silicon Errata_
25 * Revision F (October 2010) (SPRZ278F). 25 * Revision F (October 2010) (SPRZ278F).
26 *
27 * OMAP_HSMMC_NO_1_8_V: The controller does not support 1.8V IO voltage
28 * irrespective of what the capability states.
29 *
26 */ 30 */
27#define OMAP_HSMMC_SUPPORTS_DUAL_VOLT BIT(0) 31#define OMAP_HSMMC_SUPPORTS_DUAL_VOLT BIT(0)
28#define OMAP_HSMMC_BROKEN_MULTIBLOCK_READ BIT(1) 32#define OMAP_HSMMC_BROKEN_MULTIBLOCK_READ BIT(1)
29#define OMAP_HSMMC_SWAKEUP_MISSING BIT(2) 33#define OMAP_HSMMC_SWAKEUP_MISSING BIT(2)
30#define OMAP_HSMMC_REQUIRE_IODELAY BIT(3) 34#define OMAP_HSMMC_REQUIRE_IODELAY BIT(3)
31#define OMAP_HSMMC_HAS_HWPARAM BIT(4) 35#define OMAP_HSMMC_HAS_HWPARAM BIT(4)
36#define OMAP_HSMMC_NO_1_8_V BIT(5)
32 37
33struct omap_hsmmc_dev_attr { 38struct omap_hsmmc_dev_attr {
34 u8 flags; 39 u8 flags;