mmc: check correctness of the voltage mask in ocr

Most cards do not answer if some reserved bits
in the ocr are set. However, some controllers
can set bit 7 (reserved for low voltages), but
how to manage low voltages SD card is not yet
specified.

Signed-off-by: Stefano Babic <sbabic@denx.de>
This commit is contained in:
Stefano Babic 2010-01-20 18:20:39 +01:00 committed by Tom Rix
parent 71d64c0e4f
commit 250de12bc2

View File

@ -273,7 +273,15 @@ sd_send_op_cond(struct mmc *mmc)
cmd.cmdidx = SD_CMD_APP_SEND_OP_COND;
cmd.resp_type = MMC_RSP_R3;
cmd.cmdarg = mmc->voltages;
/*
* Most cards do not answer if some reserved bits
* in the ocr are set. However, Some controller
* can set bit 7 (reserved for low voltages), but
* how to manage low voltages SD card is not yet
* specified.
*/
cmd.cmdarg = mmc->voltages & 0xff8000;
if (mmc->version == SD_VERSION_2)
cmd.cmdarg |= OCR_HCS;