|
@@ -367,18 +367,33 @@ sd_send_op_cond(struct mmc *mmc)
|
|
|
|
|
|
int mmc_send_op_cond(struct mmc *mmc)
|
|
int mmc_send_op_cond(struct mmc *mmc)
|
|
{
|
|
{
|
|
- int timeout = 1000;
|
|
|
|
|
|
+ int timeout = 10000;
|
|
struct mmc_cmd cmd;
|
|
struct mmc_cmd cmd;
|
|
int err;
|
|
int err;
|
|
|
|
|
|
/* Some cards seem to need this */
|
|
/* Some cards seem to need this */
|
|
mmc_go_idle(mmc);
|
|
mmc_go_idle(mmc);
|
|
|
|
|
|
|
|
+ /* Asking to the card its capabilities */
|
|
|
|
+ cmd.cmdidx = MMC_CMD_SEND_OP_COND;
|
|
|
|
+ cmd.resp_type = MMC_RSP_R3;
|
|
|
|
+ cmd.cmdarg = 0;
|
|
|
|
+ cmd.flags = 0;
|
|
|
|
+
|
|
|
|
+ err = mmc_send_cmd(mmc, &cmd, NULL);
|
|
|
|
+
|
|
|
|
+ if (err)
|
|
|
|
+ return err;
|
|
|
|
+
|
|
|
|
+ udelay(1000);
|
|
|
|
+
|
|
do {
|
|
do {
|
|
cmd.cmdidx = MMC_CMD_SEND_OP_COND;
|
|
cmd.cmdidx = MMC_CMD_SEND_OP_COND;
|
|
cmd.resp_type = MMC_RSP_R3;
|
|
cmd.resp_type = MMC_RSP_R3;
|
|
- cmd.cmdarg = OCR_HCS | (mmc_host_is_spi(mmc) ? 0 :
|
|
|
|
- mmc->voltages);
|
|
|
|
|
|
+ cmd.cmdarg = (mmc_host_is_spi(mmc) ? 0 :
|
|
|
|
+ (mmc->voltages &
|
|
|
|
+ (cmd.response[0] & OCR_VOLTAGE_MASK)) |
|
|
|
|
+ (cmd.response[0] & OCR_ACCESS_MODE));
|
|
cmd.flags = 0;
|
|
cmd.flags = 0;
|
|
|
|
|
|
err = mmc_send_cmd(mmc, &cmd, NULL);
|
|
err = mmc_send_cmd(mmc, &cmd, NULL);
|