summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSubhash Jadavani <subhashj@codeaurora.org>2016-05-11 16:47:20 -0700
committerSubhash Jadavani <subhashj@codeaurora.org>2016-05-31 15:28:18 -0700
commit330d3d586e0297385607aaddc192953c5e09321b (patch)
tree0a3277a1a8774b35ebdb78df52c922c5ecd0ae45
parenta037c5f8a54879af3c9e39bc8f6620219257511c (diff)
mmc: sdhci: enable 64-bit DMA support only if chipset supports 64-bit
This patch adds check to enable the 64-bit DMA only if the chipset supports the same. Change-Id: I5dbe6f91d5e530b289f4cf395ae7b673acd85fcf Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
-rw-r--r--drivers/mmc/host/sdhci.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index a25575f87b7e..bb4165ae16a1 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -3629,6 +3629,25 @@ static const struct cmdq_host_ops sdhci_cmdq_ops = {
.post_cqe_halt = sdhci_cmdq_post_cqe_halt,
};
+#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
+static int sdhci_is_adma2_64bit(struct sdhci_host *host)
+{
+ u32 caps;
+
+ caps = (host->quirks & SDHCI_QUIRK_MISSING_CAPS) ? host->caps :
+ sdhci_readl(host, SDHCI_CAPABILITIES);
+
+ if (caps & SDHCI_CAN_64BIT)
+ return 1;
+ return 0;
+}
+#else
+static int sdhci_is_adma2_64bit(struct sdhci_host *host)
+{
+ return 0;
+}
+#endif
+
int sdhci_add_host(struct sdhci_host *host)
{
struct mmc_host *mmc;
@@ -3701,7 +3720,7 @@ int sdhci_add_host(struct sdhci_host *host)
* SDHCI_QUIRK2_BROKEN_64_BIT_DMA must be left to the drivers to
* implement.
*/
- if (sdhci_readl(host, SDHCI_CAPABILITIES) & SDHCI_CAN_64BIT)
+ if (sdhci_is_adma2_64bit(host))
host->flags |= SDHCI_USE_64_BIT_DMA;
if (host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA)) {