lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 29 Apr 2015 09:23:43 +0800
From:	<micky_ching@...lsil.com.cn>
To:	<chris@...ntf.net>, <ulf.hansson@...aro.org>,
	<sameo@...ux.intel.com>
CC:	<gregkh@...uxfoundation.org>, <dan.carpenter@...cle.com>,
	<devel@...uxdriverproject.org>, <linux-kernel@...r.kernel.org>,
	<linux-mmc@...r.kernel.org>, <rogerable@...ltek.com>,
	<wei_wang@...lsil.com.cn>, Micky Ching <micky_ching@...lsil.com.cn>
Subject: [PATCH 11/12] mmc: sdhci: set DMA configure for SD4.0 mode

From: Micky Ching <micky_ching@...lsil.com.cn>

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@...lsil.com.cn>
Signed-off-by: Wei Wang <wei_wang@...lsil.com.cn>
---
 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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ