]> git.sur5r.net Git - u-boot/commitdiff
mmc: check correctness of the voltage mask in ocr
authorStefano Babic <sbabic@denx.de>
Wed, 20 Jan 2010 17:20:39 +0000 (18:20 +0100)
committerTom Rix <Tom.Rix@windriver.com>
Sun, 7 Mar 2010 18:36:36 +0000 (12:36 -0600)
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>
drivers/mmc/mmc.c

index b69ce152a83b5e1ef6848af754b63d7707eca83c..d91b9b7f3a3d9d659027c45c2f2e1825d59286af 100644 (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;