mmc: tegra: Enable MMC_CAP_CMD23
Naveen Kumar Arepalli [Tue, 5 Mar 2013 08:38:12 +0000 (13:38 +0530)]
Enable MMC_CAP_CMD23 for SDMMC

Bug 1242730

Change-Id: Idda40647870dc198ce7105e32d60406404674437
Signed-off-by: Naveen Kumar Arepalli <naveenk@nvidia.com>
Reviewed-on: http://git-master/r/206245
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Pavan Kunapuli <pkunapuli@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

drivers/mmc/host/sdhci-tegra.c

index e6be721..06cecc5 100644 (file)
@@ -154,6 +154,8 @@ static struct tegra_sdhci_hw_ops tegra_11x_sdhci_ops = {
 #define NVQUIRK_ENABLE_SDR50_TUNING            BIT(13)
 /* Enable Infinite Erase Timeout*/
 #define NVQUIRK_INFINITE_ERASE_TIMEOUT         BIT(14)
+/* Disable AUTO CMD23 */
+#define NVQUIRK_DISABLE_AUTO_CMD23             BIT(15)
 
 struct sdhci_tegra_soc_data {
        struct sdhci_pltfm_data *pdata;
@@ -483,6 +485,11 @@ static void tegra_sdhci_reset_exit(struct sdhci_host *sdhci, u8 mask)
                }
                sdhci_writew(sdhci, misc_ctrl, SDHCI_VNDR_MISC_CTRL);
 
+               /* Mask Auto CMD23 if CMD23 is enabled */
+               if ((sdhci->mmc->caps & MMC_CAP_CMD23) &&
+                       (soc_data->nvquirks & NVQUIRK_DISABLE_AUTO_CMD23))
+                       sdhci->flags &= ~SDHCI_AUTO_CMD23;
+
                /* Mask the support for any UHS modes if specified */
                if (plat->uhs_mask & MMC_UHS_MASK_SDR104)
                        sdhci->mmc->caps &= ~MMC_CAP_UHS_SDR104;
@@ -1749,6 +1756,7 @@ static struct sdhci_tegra_soc_data soc_data_tegra20 = {
                    NVQUIRK_SET_TRIM_DELAY |
                    NVQUIRK_ENABLE_DDR50 |
                    NVQUIRK_INFINITE_ERASE_TIMEOUT |
+                   NVQUIRK_DISABLE_AUTO_CMD23 |
 #endif
                    NVQUIRK_ENABLE_BLOCK_GAP_DET,
 };
@@ -2052,6 +2060,7 @@ static int __devinit sdhci_tegra_probe(struct platform_device *pdev)
        tegra_sdhost_std_freq = TEGRA3_SDHOST_STD_FREQ;
        host->mmc->caps2 |= MMC_CAP2_HS200;
        host->mmc->caps2 |= MMC_CAP2_CACHE_CTRL;
+       host->mmc->caps |= MMC_CAP_CMD23;
 #endif
 
        if (plat->nominal_vcore_uV)