summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSahitya Tummala <stummala@codeaurora.org>2016-04-05 15:27:36 +0530
committerKyle Yan <kyan@codeaurora.org>2016-06-13 19:06:24 -0700
commitf8fb46ff55ba1d99f7debfc33ce69ecbf936e586 (patch)
treebfd20d9d47aeddcbcbf6b17969ed314ba974e602
parent7b9f9abcdafb8a1a454208f7070f205873b3e541 (diff)
mmc: sdhci: Add new quirk to use PIO for eMMC tuning commands
Some controllers have an issue using ADMA for tuning commands. Add a quirk - SDHCI_QUIRK2_USE_PIO_FOR_EMMC_TUNING to use PIO mode for tuning commands on those host controllers. Change-Id: Id9625167d7e235fb3a20a6193889c1654b5c0cd8 Signed-off-by: Sahitya Tummala <stummala@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
-rw-r--r--drivers/mmc/host/sdhci.c4
-rw-r--r--drivers/mmc/host/sdhci.h6
2 files changed, 10 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 189f5969c69e..58a06528c051 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -858,6 +858,10 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd)
if (host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA))
host->flags |= SDHCI_REQ_USE_DMA;
+ if ((host->quirks2 & SDHCI_QUIRK2_USE_PIO_FOR_EMMC_TUNING) &&
+ cmd->opcode == MMC_SEND_TUNING_BLOCK_HS200)
+ host->flags &= ~SDHCI_REQ_USE_DMA;
+
/*
* FIXME: This doesn't account for merging when mapping the
* scatterlist.
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 7dcf6fe4d30d..da963972b9a4 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -507,6 +507,12 @@ struct sdhci_host {
* phase.
*/
#define SDHCI_QUIRK2_NON_STANDARD_TUNING (1 << 28)
+/*
+ * Some controllers may use PIO mode to workaround HW issues in ADMA for
+ * eMMC tuning commands.
+ */
+#define SDHCI_QUIRK2_USE_PIO_FOR_EMMC_TUNING (1 << 23)
+
int irq; /* Device IRQ */
void __iomem *ioaddr; /* Mapped address */