MLK-14884 mmc: sdhci: make DDR50 tuning optionally
authorDong Aisheng <aisheng.dong@nxp.com>
Thu, 11 May 2017 08:08:08 +0000 (16:08 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:22:15 +0000 (15:22 -0500)
DDR50 tuning is optinally defined in sd 3.0 spec. Per IC guys
suggestion, it internally already uses a fixed optimized timing
and normally does not require tuning.

Make it optionally and platform can claim SDHCI_DDR50_NEEDS_TUNING
support if it wants tuning.

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
drivers/mmc/host/sdhci.c
drivers/mmc/host/sdhci.h

index f3fc617..594556c 100644 (file)
@@ -1998,11 +1998,12 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
                break;
 
        case MMC_TIMING_UHS_SDR104:
-       case MMC_TIMING_UHS_DDR50:
                break;
 
        case MMC_TIMING_UHS_SDR50:
-               if (host->flags & SDHCI_SDR50_NEEDS_TUNING)
+       case MMC_TIMING_UHS_DDR50:
+               if ((host->flags & SDHCI_SDR50_NEEDS_TUNING) ||
+                   (host->flags & SDHCI_DDR50_NEEDS_TUNING))
                        break;
                /* FALLTHROUGH */
 
index 02e7339..d9bddd0 100644 (file)
@@ -452,6 +452,7 @@ struct sdhci_host {
 #define SDHCI_REQ_USE_DMA      (1<<2)  /* Use DMA for this req. */
 #define SDHCI_DEVICE_DEAD      (1<<3)  /* Device unresponsive */
 #define SDHCI_SDR50_NEEDS_TUNING (1<<4)        /* SDR50 needs tuning */
+#define SDHCI_DDR50_NEEDS_TUNING (1<<5)        /* DDR50 needs tuning */
 #define SDHCI_AUTO_CMD12       (1<<6)  /* Auto CMD12 support */
 #define SDHCI_AUTO_CMD23       (1<<7)  /* Auto CMD23 support */
 #define SDHCI_PV_ENABLED       (1<<8)  /* Preset value enabled */