aboutsummaryrefslogtreecommitdiff
path: root/drivers/mmc/fsl_esdhc_imx.c
diff options
context:
space:
mode:
authorPeng Fan2019-07-10 09:35:26 +0000
committerPeng Fan2019-07-15 10:30:09 +0800
commite9c22552675ec90258da1b60819baf5bea36f1c1 (patch)
tree546facde251a5ce6354a66b9332a590cb63f5ceb /drivers/mmc/fsl_esdhc_imx.c
parentb0155ac63ce97a73183a6deae1559fb3baa3f61f (diff)
mmc: fsl_esdhc_imx: add HS400 Enhanced strobe support
Implement set_enhanced_strobe hook for fsl_esdhc_imx, ,in esdhc_set_timing and esdhc_change_pinstate, also handle HS400_ES. Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'drivers/mmc/fsl_esdhc_imx.c')
-rw-r--r--drivers/mmc/fsl_esdhc_imx.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/mmc/fsl_esdhc_imx.c b/drivers/mmc/fsl_esdhc_imx.c
index 0d2587982cd..51d22256522 100644
--- a/drivers/mmc/fsl_esdhc_imx.c
+++ b/drivers/mmc/fsl_esdhc_imx.c
@@ -703,6 +703,7 @@ static int esdhc_change_pinstate(struct udevice *dev)
case UHS_SDR104:
case MMC_HS_200:
case MMC_HS_400:
+ case MMC_HS_400_ES:
ret = pinctrl_select_state(dev, "state_200mhz");
break;
default:
@@ -773,6 +774,7 @@ static int esdhc_set_timing(struct mmc *mmc)
writel(mixctrl, &regs->mixctrl);
break;
case MMC_HS_400:
+ case MMC_HS_400_ES:
mixctrl |= MIX_CTRL_DDREN | MIX_CTRL_HS400_EN;
writel(mixctrl, &regs->mixctrl);
esdhc_set_strobe_dll(mmc);
@@ -1594,6 +1596,21 @@ static int fsl_esdhc_set_ios(struct udevice *dev)
return esdhc_set_ios_common(priv, &plat->mmc);
}
+#if CONFIG_IS_ENABLED(MMC_HS400_ES_SUPPORT)
+static int fsl_esdhc_set_enhanced_strobe(struct udevice *dev)
+{
+ struct fsl_esdhc_priv *priv = dev_get_priv(dev);
+ struct fsl_esdhc *regs = priv->esdhc_regs;
+ u32 m;
+
+ m = readl(&regs->mixctrl);
+ m |= MIX_CTRL_HS400_ES;
+ writel(m, &regs->mixctrl);
+
+ return 0;
+}
+#endif
+
static const struct dm_mmc_ops fsl_esdhc_ops = {
.get_cd = fsl_esdhc_get_cd,
.send_cmd = fsl_esdhc_send_cmd,
@@ -1601,6 +1618,9 @@ static const struct dm_mmc_ops fsl_esdhc_ops = {
#ifdef MMC_SUPPORTS_TUNING
.execute_tuning = fsl_esdhc_execute_tuning,
#endif
+#if CONFIG_IS_ENABLED(MMC_HS400_ES_SUPPORT)
+ .set_enhanced_strobe = fsl_esdhc_set_enhanced_strobe,
+#endif
};
#endif