diff options
author | Yangbo Lu <yangbo.lu@nxp.com> | 2015-12-30 14:19:30 +0800 |
---|---|---|
committer | York Sun <york.sun@nxp.com> | 2016-01-27 08:13:12 -0800 |
commit | e978a31b631ac40d786f80b4254c323dcc4e1a82 (patch) | |
tree | 3cef5364618132a7df8700a817a71652ac53a521 /drivers/mmc/fsl_esdhc.c | |
parent | 335b1936ebf48bf1df3568a8df3766d9408a1070 (diff) | |
download | u-boot-imx-e978a31b631ac40d786f80b4254c323dcc4e1a82.zip u-boot-imx-e978a31b631ac40d786f80b4254c323dcc4e1a82.tar.gz u-boot-imx-e978a31b631ac40d786f80b4254c323dcc4e1a82.tar.bz2 |
mmc: fsl_esdhc: increase data transaction timeout to 500ms
The MMC spec says "It is strongly recommended for hosts to implement
more than 500ms timeout value even if the card indicates the 250ms
maximum busy length." Even the previous value of 300ms is known to
be insufficient for some cards. So, increase the timeout to 500ms.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
Diffstat (limited to 'drivers/mmc/fsl_esdhc.c')
-rw-r--r-- | drivers/mmc/fsl_esdhc.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index 1ccc576..6827ffb 100644 --- a/drivers/mmc/fsl_esdhc.c +++ b/drivers/mmc/fsl_esdhc.c @@ -252,8 +252,15 @@ static int esdhc_setup_data(struct mmc *mmc, struct mmc_data *data) * Rounding up to next power of 2 * => timeout + 13 = log2(mmc->clock/4) + 1 * => timeout + 13 = fls(mmc->clock/4) + * + * However, the MMC spec "It is strongly recommended for hosts to + * implement more than 500ms timeout value even if the card + * indicates the 250ms maximum busy length." Even the previous + * value of 300ms is known to be insufficient for some cards. + * So, we use + * => timeout + 13 = fls(mmc->clock/2) */ - timeout = fls(mmc->clock/4); + timeout = fls(mmc->clock/2); timeout -= 13; if (timeout > 14) |