diff options
Diffstat (limited to 'drivers/mmc/mmc.c')
-rw-r--r-- | drivers/mmc/mmc.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index da528390acf8..eb41391e06e9 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c | |||
@@ -679,7 +679,15 @@ static void mmc_idle_cards(struct mmc_host *host) | |||
679 | } | 679 | } |
680 | 680 | ||
681 | /* | 681 | /* |
682 | * Apply power to the MMC stack. | 682 | * Apply power to the MMC stack. This is a two-stage process. |
683 | * First, we enable power to the card without the clock running. | ||
684 | * We then wait a bit for the power to stabilise. Finally, | ||
685 | * enable the bus drivers and clock to the card. | ||
686 | * | ||
687 | * We must _NOT_ enable the clock prior to power stablising. | ||
688 | * | ||
689 | * If a host does all the power sequencing itself, ignore the | ||
690 | * initial MMC_POWER_UP stage. | ||
683 | */ | 691 | */ |
684 | static void mmc_power_up(struct mmc_host *host) | 692 | static void mmc_power_up(struct mmc_host *host) |
685 | { | 693 | { |
@@ -816,7 +824,7 @@ static void mmc_discover_cards(struct mmc_host *host) | |||
816 | 824 | ||
817 | cmd.opcode = SD_SEND_RELATIVE_ADDR; | 825 | cmd.opcode = SD_SEND_RELATIVE_ADDR; |
818 | cmd.arg = 0; | 826 | cmd.arg = 0; |
819 | cmd.flags = MMC_RSP_R1; | 827 | cmd.flags = MMC_RSP_R6; |
820 | 828 | ||
821 | err = mmc_wait_for_cmd(host, &cmd, CMD_RETRIES); | 829 | err = mmc_wait_for_cmd(host, &cmd, CMD_RETRIES); |
822 | if (err != MMC_ERR_NONE) | 830 | if (err != MMC_ERR_NONE) |
@@ -932,8 +940,9 @@ static void mmc_read_scrs(struct mmc_host *host) | |||
932 | 940 | ||
933 | sg_init_one(&sg, (u8*)card->raw_scr, 8); | 941 | sg_init_one(&sg, (u8*)card->raw_scr, 8); |
934 | 942 | ||
935 | err = mmc_wait_for_req(host, &mrq); | 943 | mmc_wait_for_req(host, &mrq); |
936 | if (err != MMC_ERR_NONE) { | 944 | |
945 | if (cmd.error != MMC_ERR_NONE || data.error != MMC_ERR_NONE) { | ||
937 | mmc_card_set_dead(card); | 946 | mmc_card_set_dead(card); |
938 | continue; | 947 | continue; |
939 | } | 948 | } |