mmc: poll eMMC status after EXT_CSD command

EXT_CSD command needs to access data from eMMC device. Add the
operation of polling eMMC device status. Make sure the command is
finished.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
This commit is contained in:
Haojian Zhuang 2018-11-21 09:19:49 +08:00
parent 98aab97484
commit 9376864479
1 changed files with 7 additions and 0 deletions

View File

@ -246,6 +246,13 @@ static int mmc_fill_device_info(void)
return ret;
}
do {
ret = mmc_device_state();
if (ret < 0) {
return ret;
}
} while (ret != MMC_STATE_TRAN);
nb_blocks = (mmc_ext_csd[CMD_EXTCSD_SEC_CNT] << 0) |
(mmc_ext_csd[CMD_EXTCSD_SEC_CNT + 1] << 8) |
(mmc_ext_csd[CMD_EXTCSD_SEC_CNT + 2] << 16) |