aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKishon Vijay Abraham I <kishon@ti.com>2017-08-21 03:41:29 -0400
committerUlf Hansson <ulf.hansson@linaro.org>2017-08-30 09:03:43 -0400
commit1284c248d145926760eab7244252f695f7a7a46a (patch)
tree09d82807025be0485a457358146861a2daf8163f
parent4a5fc11945af753f3e565db61f80976bb1fcddc7 (diff)
mmc: sdhci: Add quirk to indicate MMC_RSP_136 has CRC
TI's implementation of sdhci controller used in DRA7 SoC's has CRC in responses with length 136 bits. Add quirk to indicate the controller has CRC in MMC_RSP_136. If this quirk is set sdhci library shouldn't shift the response present in SDHCI_RESPONSE register. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r--drivers/mmc/host/sdhci.c3
-rw-r--r--drivers/mmc/host/sdhci.h2
2 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 1cea35d8bc79..0d5fcca18c9e 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1182,6 +1182,9 @@ static void sdhci_read_rsp_136(struct sdhci_host *host, struct mmc_command *cmd)
1182 cmd->resp[i] = sdhci_readl(host, reg); 1182 cmd->resp[i] = sdhci_readl(host, reg);
1183 } 1183 }
1184 1184
1185 if (host->quirks2 & SDHCI_QUIRK2_RSP_136_HAS_CRC)
1186 return;
1187
1185 /* CRC is stripped so we need to do some shifting */ 1188 /* CRC is stripped so we need to do some shifting */
1186 for (i = 0; i < 4; i++) { 1189 for (i = 0; i < 4; i++) {
1187 cmd->resp[i] <<= 8; 1190 cmd->resp[i] <<= 8;
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 399edc681623..54bc444c317f 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -435,6 +435,8 @@ struct sdhci_host {
435#define SDHCI_QUIRK2_ACMD23_BROKEN (1<<14) 435#define SDHCI_QUIRK2_ACMD23_BROKEN (1<<14)
436/* Broken Clock divider zero in controller */ 436/* Broken Clock divider zero in controller */
437#define SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN (1<<15) 437#define SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN (1<<15)
438/* Controller has CRC in 136 bit Command Response */
439#define SDHCI_QUIRK2_RSP_136_HAS_CRC (1<<16)
438 440
439 int irq; /* Device IRQ */ 441 int irq; /* Device IRQ */
440 void __iomem *ioaddr; /* Mapped address */ 442 void __iomem *ioaddr; /* Mapped address */