Browse Source

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>
pull/1698/head
Haojian Zhuang 6 years ago
parent
commit
9376864479
  1. 7
      drivers/mmc/mmc.c

7
drivers/mmc/mmc.c

@ -246,6 +246,13 @@ static int mmc_fill_device_info(void)
return ret; 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) | 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 + 1] << 8) |
(mmc_ext_csd[CMD_EXTCSD_SEC_CNT + 2] << 16) | (mmc_ext_csd[CMD_EXTCSD_SEC_CNT + 2] << 16) |

Loading…
Cancel
Save