[PATCH 11/12] mmc: sdhci: set DMA configure for SD4.0 mode

From: micky_ching
Date: Tue Apr 28 2015 - 21:35:06 EST


From: Micky Ching <micky_ching@xxxxxxxxxxxxxx>

SD4.0 mode not using SDMA any more, and UHSII mode using different register
to specify block size/count.

Signed-off-by: Micky Ching <micky_ching@xxxxxxxxxxxxxx>
Signed-off-by: Wei Wang <wei_wang@xxxxxxxxxxxxxx>
---
drivers/mmc/host/sdhci.c | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 03df58c..15bd7c8 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -883,8 +883,14 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd)
host->flags &= ~SDHCI_REQ_USE_DMA;
} else {
WARN_ON(sg_cnt != 1);
- sdhci_writel(host, sg_dma_address(data->sg),
- SDHCI_DMA_ADDRESS);
+ if (host->uhsii_if_enabled)
+ sdhci_writel(host,
+ sg_dma_address(data->sg),
+ SDHCI_ADMA_ADDRESS);
+ else
+ sdhci_writel(host,
+ sg_dma_address(data->sg),
+ SDHCI_DMA_ADDRESS);
}
}
}
@@ -924,9 +930,15 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd)
sdhci_set_transfer_irqs(host);

/* Set the DMA boundary value and block size */
- sdhci_writew(host, SDHCI_MAKE_BLKSZ(SDHCI_DEFAULT_BOUNDARY_ARG,
- data->blksz), SDHCI_BLOCK_SIZE);
- sdhci_writew(host, data->blocks, SDHCI_BLOCK_COUNT);
+ if (host->uhsii_if_enabled) {
+ sdhci_writew(host, SDHCI_MAKE_BLKSZ(SDHCI_DEFAULT_BOUNDARY_ARG,
+ data->blksz), SDHCI_UHSII_BLOCK_SIZE);
+ sdhci_writew(host, data->blocks, SDHCI_UHSII_BLOCK_COUNT);
+ } else {
+ sdhci_writew(host, SDHCI_MAKE_BLKSZ(SDHCI_DEFAULT_BOUNDARY_ARG,
+ data->blksz), SDHCI_BLOCK_SIZE);
+ sdhci_writew(host, data->blocks, SDHCI_BLOCK_COUNT);
+ }
}

static void sdhci_set_transfer_mode(struct sdhci_host *host,
--
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/