Hello,
It looks like to me that the mmc driver does not implement ACMD41 correctly for SD initialization. The SD spec says that if response of ACMD41 returns busy state, the host shall re-issue ACMD41 until 1) card is ready or 2) one second is over.
Below shows the function "mmc_send_app_op" which issues ACMD41. If response of first ACMD41 command returns busy state, it will exit the outer "for" loop immediately (see my comment).
This obviously does not follow the SD spec. Right?
int mmc_send_app_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr)
{
struct mmc_command cmd = {0};
int i, err = 0;
....
....
for (i = 100; i; i--) {
err = mmc_wait_for_app_cmd(host, NULL, &cmd, MMC_CMD_RETRIES);
if (err)
break;
/* if we're just probing, do a single pass */
if (ocr == 0)
break;
/* otherwise wait until reset completes */
if (mmc_host_is_spi(host)) {
if (!(cmd.resp[0] & R1_SPI_IDLE))
break;
} else {
if (cmd.resp[0] & MMC_CARD_BUSY)
break;
}
err = -ETIMEDOUT;
mmc_delay(10);
}
/* we already reach here if cmd.resp[0]=MMC_CARD_BUSY
for the first ACMD41! */
....
....
}
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 285 |
Nodes: | 16 (2 / 14) |
Uptime: | 70:27:33 |
Calls: | 6,488 |
Calls today: | 1 |
Files: | 12,096 |
Messages: | 5,275,488 |