summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>2018-01-16 22:44:18 +0100
committerJaehoon Chung <jh80.chung@samsung.com>2018-01-22 14:17:13 +0900
commitb9b4f146c9bbfb31c50fc1378d3ae44215003bac (patch)
tree844d6b09ad2d35d03e1ba6b17afa47df1faffd4f
parent9546eb92cb648a8bba0aa9d5930ac751e6e5b9a4 (diff)
mmc: fsl_esdhc: Fix i.MX53 eSDHCv3 clock
Commit 4f425280fa71 ("mmc: fsl_esdhc: Allow all supported prescaler values") made it possible to set SYSCTL.SDCLKFS to 0 in SDR mode on i.MX, thus bypassing the SD clock frequency prescaler, in order to be able to get higher SD clock frequencies in some contexts. However, that commit missed the fact that this value is illegal on the eSDHCv3 instance of the i.MX53. This seems to be the only exception on i.MX, this value being legal even for the eSDHCv2 instances of the i.MX53. Fix this issue by changing the minimum prescaler value for the single instance of the i.MX53 eSDHCv3 controller. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com> Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
-rw-r--r--drivers/mmc/fsl_esdhc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index 71c62f42337..8d1e2f8a01c 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -528,14 +528,19 @@ out:
static void set_sysctl(struct fsl_esdhc_priv *priv, struct mmc *mmc, uint clock)
{
+ struct fsl_esdhc *regs = priv->esdhc_regs;
int div = 1;
#ifdef ARCH_MXC
+#ifdef CONFIG_MX53
+ /* For i.MX53 eSDHCv3, SYSCTL.SDCLKFS may not be set to 0. */
+ int pre_div = (regs == (struct fsl_esdhc *)MMC_SDHC3_BASE_ADDR) ? 2 : 1;
+#else
int pre_div = 1;
+#endif
#else
int pre_div = 2;
#endif
int ddr_pre_div = mmc->ddr_mode ? 2 : 1;
- struct fsl_esdhc *regs = priv->esdhc_regs;
int sdhc_clk = priv->sdhc_clk;
uint clk;