
11 Jan
2012
11 Jan
'12
4:31 p.m.
On Wednesday, January 04, 2012 01:22:29 AM Peter Bigot <bigotp at acm.org> wrote:
I got this to work with two changes:
- s/MMC_TIMEOUT_USEC/MMC_TIMEOUT_MSEC/g and define MMC_TIMEOUT_MSEC
20, since get_timer does operate on msec in the current meta-ti BeagleBoard-xM
- The patch below, which is what I think fixes the real problem (that
PSTATE.CMDI is still lit up when the function is entered).
diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c index c38b9e6..62b659a 100644 --- a/drivers/mmc/omap_hsmmc.c +++ b/drivers/mmc/omap_hsmmc.c @@ -198,7 +198,8 @@ 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) {
+#define CMDI_MASK (0x1 << 0)
while ((readl(&mmc_base->pstate) & (DATI_MASK | CMDI_MASK))) { if (get_timer(0) - start > MAX_RETRY_MS) { printf("%s: timedout waiting for cmddis!\n",
__func__); return TIMEOUT;
Peter
I tested this with success and I think this is the correct solution. Peter: can you send a proper patch for this?
Andreas