From: Siva Durga Prasad Paladugu Date: Wed, 1 Feb 2017 19:40:52 +0000 (+0530) Subject: mmc: sdhci: Update execute tuning and set clock for HS200 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=02ecfcfdbb755763329a3cac4c3a49da4273902c;p=thirdparty%2Fu-boot.git mmc: sdhci: Update execute tuning and set clock for HS200 Update execute tuning and set clock to support for HS200 mode. Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Michal Simek --- diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index 01ef1d47457..8045c662198 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c @@ -157,7 +157,8 @@ static int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd, /* We shouldn't wait for data inihibit for stop commands, even though they might use busy signaling */ if ((cmd->cmdidx == MMC_CMD_STOP_TRANSMISSION) || - (cmd->cmdidx == MMC_CMD_SEND_TUNING_BLOCK)) + (cmd->cmdidx == MMC_CMD_SEND_TUNING_BLOCK) || + (cmd->cmdidx == MMC_CMD_SEND_TUNING_BLOCK_HS200)) mask &= ~SDHCI_DATA_INHIBIT; while (sdhci_readl(host, SDHCI_PRESENT_STATE) & mask) { @@ -179,7 +180,8 @@ static int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd, mask = SDHCI_INT_RESPONSE; /* only buffer read ready interrupt whil tuning */ - if (cmd->cmdidx == MMC_CMD_SEND_TUNING_BLOCK) + if ((cmd->cmdidx == MMC_CMD_SEND_TUNING_BLOCK) || + (cmd->cmdidx == MMC_CMD_SEND_TUNING_BLOCK_HS200)) mask = SDHCI_INT_DATA_AVAIL; if (!(cmd->resp_type & MMC_RSP_PRESENT)) @@ -197,7 +199,8 @@ static int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd, flags |= SDHCI_CMD_CRC; if (cmd->resp_type & MMC_RSP_OPCODE) flags |= SDHCI_CMD_INDEX; - if (data || (cmd->cmdidx == MMC_CMD_SEND_TUNING_BLOCK)) + if (data || (cmd->cmdidx == MMC_CMD_SEND_TUNING_BLOCK) || + (cmd->cmdidx == MMC_CMD_SEND_TUNING_BLOCK_HS200)) flags |= SDHCI_CMD_DATA; /* Set Transfer mode regarding to data flag */ @@ -407,8 +410,13 @@ static int sdhci_set_clock(struct mmc *mmc, unsigned int clock) if (clock == 0) return 0; - if (mmc->is_uhs && host->set_delay) - host->set_delay(host, mmc->uhsmode); + if (((mmc->card_caps & MMC_MODE_HS200) || mmc->is_uhs) && + host->set_delay) { + if (mmc->is_uhs) + host->set_delay(host, mmc->uhsmode); + else + host->set_delay(host, MMC_TIMING_HS200); + } if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300) { /* diff --git a/include/mmc.h b/include/mmc.h index ce8cb55e579..4d99c8b7610 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -300,6 +300,7 @@ #define MMC_TIMING_UHS_SDR50 2 #define MMC_TIMING_UHS_SDR104 3 #define MMC_TIMING_UHS_DDR50 4 +#define MMC_TIMING_HS200 5 #define MMC_TIMING_HS 1 /* Driver model support */