]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
mmc: sdhci: Update execute tuning and set clock for HS200
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Wed, 1 Feb 2017 19:40:52 +0000 (01:10 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 2 Feb 2017 09:29:49 +0000 (10:29 +0100)
Update execute tuning and set clock to support for
HS200 mode.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/mmc/sdhci.c
include/mmc.h

index 01ef1d4745743c82d05b1dd62313424eea913026..8045c662198d740f92a529b201de5ab4bf0de2c4 100644 (file)
@@ -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) {
                /*
index ce8cb55e5796dc20935e0ba5ed7d069286936189..4d99c8b7610614dfa65647a2461b00537bf21888 100644 (file)
 #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 */