summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorAdam Ford <aford173@gmail.com>2022-01-12 16:53:56 +0300
committerStefano Babic <sbabic@denx.de>2022-02-19 16:46:54 +0300
commit1a7904fdfa7d1974410e9dc9b9bfe8aad7fb1311 (patch)
treed683b5f3ac29cdb925f9333258e4f8b6936be84f /drivers/mmc
parente72cb770d4bbef6927153d07aa46cbd81a9fcc1a (diff)
downloadu-boot-1a7904fdfa7d1974410e9dc9b9bfe8aad7fb1311.tar.xz
mmc: fsl_esdhc_imx: Use esdhc_soc_data flags to set host caps
The Linux driver automatically can detect and enable UHS, HS200, HS400 and HS400_ES automatically without extra flags being placed into the device tree. Right now, for U-Boot to use UHS, HS200 or HS400, the extra flags are needed in the device tree. Instead, go through the esdhc_soc_data flags and enable the host caps where applicable to automatically enable higher speeds. Suggested-by: Fabio Estevam <festevam@gmail.com> Signed-off-by: Adam Ford <aford173@gmail.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/fsl_esdhc_imx.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/mmc/fsl_esdhc_imx.c b/drivers/mmc/fsl_esdhc_imx.c
index 32b42c3fd5..fcfbaa7d40 100644
--- a/drivers/mmc/fsl_esdhc_imx.c
+++ b/drivers/mmc/fsl_esdhc_imx.c
@@ -1224,8 +1224,29 @@ static int fsl_esdhc_init(struct fsl_esdhc_priv *priv,
val |= ESDHC_TUNING_CMD_CRC_CHECK_DISABLE;
esdhc_write32(&regs->tuning_ctrl, val);
}
- }
+ /*
+ * UHS doesn't have explicit ESDHC flags, so if it's
+ * not supported, disable it in config.
+ */
+ if (CONFIG_IS_ENABLED(MMC_UHS_SUPPORT))
+ cfg->host_caps |= UHS_CAPS;
+
+ if (CONFIG_IS_ENABLED(MMC_HS200_SUPPORT)) {
+ if (priv->flags & ESDHC_FLAG_HS200)
+ cfg->host_caps |= MMC_CAP(MMC_HS_200);
+ }
+
+ if (CONFIG_IS_ENABLED(MMC_HS400_SUPPORT)) {
+ if (priv->flags & ESDHC_FLAG_HS400)
+ cfg->host_caps |= MMC_CAP(MMC_HS_400);
+ }
+
+ if (CONFIG_IS_ENABLED(MMC_HS400_ES_SUPPORT)) {
+ if (priv->flags & ESDHC_FLAG_HS400_ES)
+ cfg->host_caps |= MMC_CAP(MMC_HS_400_ES);
+ }
+ }
return 0;
}