diff options
author | Tom Rini <trini@ti.com> | 2012-01-30 11:22:25 +0000 |
---|---|---|
committer | Andy Fleming <afleming@freescale.com> | 2012-02-15 17:42:22 -0600 |
commit | a7778f8fbee098c78b1fa1e1331313a7e217fb30 (patch) | |
tree | 67e8af7f8cf6b53b27c5b5af416540c141015b3b /drivers/mmc/omap_hsmmc.c | |
parent | 9a3aae22edf1eda6326cc51c28631ca5c23b7706 (diff) | |
download | u-boot-imx-a7778f8fbee098c78b1fa1e1331313a7e217fb30.zip u-boot-imx-a7778f8fbee098c78b1fa1e1331313a7e217fb30.tar.gz u-boot-imx-a7778f8fbee098c78b1fa1e1331313a7e217fb30.tar.bz2 |
omap_hsmmc: Wait for CMDI to be clear
Before we can send a command we need both the DATI (command inhibit on
mmc_dat line) bit and CMDI (command inhibit on mmc_cmd line) are clear.
The previous behavior of only checking on DATI was insufficient on some
cards and incorrect behavior in any case. This makes the code check
for both bits being clear and makes the error print more clear as
to what happened. DATI_CMDDIS is removed as it was unused elsewhere
in the code and stood for 'DATI is set, cmds are disabled still'.
Fix originally spotted by Peter Bigot.
Tested-by: Peter A. Bigot <bigotp@acm.org>
Tested-by: Robert Nelson <robertcnelson@gmail.com>
Signed-off-by: Tom Rini <trini@ti.com>
Tested-by: Andreas Müller <schnitzeltony@googlemail.com>
Diffstat (limited to 'drivers/mmc/omap_hsmmc.c')
-rw-r--r-- | drivers/mmc/omap_hsmmc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c index ef64e37..2400db2 100644 --- a/drivers/mmc/omap_hsmmc.c +++ b/drivers/mmc/omap_hsmmc.c @@ -198,9 +198,10 @@ static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, ulong start; start = get_timer(0); - while ((readl(&mmc_base->pstate) & DATI_MASK) == DATI_CMDDIS) { + while ((readl(&mmc_base->pstate) & (DATI_MASK | CMDI_MASK)) != 0) { if (get_timer(0) - start > MAX_RETRY_MS) { - printf("%s: timedout waiting for cmddis!\n", __func__); + printf("%s: timedout waiting on cmd inhibit to clear\n", + __func__); return TIMEOUT; } } |