public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/9] mmc: sh_mobile_sdhi: add HS200 support
@ 2016-12-12 19:51 Wolfram Sang
  2016-12-12 19:51 ` [PATCH 1/9] mmc: sh_mobile_sdhi: simplify accessing DT data Wolfram Sang
                   ` (9 more replies)
  0 siblings, 10 replies; 14+ messages in thread
From: Wolfram Sang @ 2016-12-12 19:51 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-renesas-soc, Simon Horman, Wolfram Sang

Here is a series adding HS200 support to the SDHI driver. Building the actual
functionality on top of SDR104 support was rather easy. However, I figured the
checks for enabling tuning were rather scattered over the driver and could be
further improved. So I did some refactoring of that to make adding HS200
support then a one-liner :)

This has been tested on Salvator-X boards with R-Car H3 and M3-W SoCs. It has
also been tested on a Lager board (R-Car H2) checking SDR50/104 for
regressions. The whole test document showing significant speed-ups reading from
the on-board eMMC can be found here:

http://elinux.org/Tests:eMMC-HS

and the branch can be found here:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/topic/sdhi-emmc-hs

Please comment, review, apply...

Thanks,

   Wolfram


Wolfram Sang (9):
  mmc: sh_mobile_sdhi: simplify accessing DT data
  mmc: sh_mobile_sdhi: improve prerequisite for hw_reset
  mmc: sh_mobile_sdhi: improve prerequisites for tuning
  mmc: sh_mobile_sdhi: remove superfluous check in hw_reset
  mmc: sh_mobile_sdhi: remove superfluous check in init_tuning
  mmc: sh_mobile_sdhi: remove superfluous check in SCC error check
  mmc: sh_mobile_sdhi: enable HS200
  arm64: dts: r8a7795: enable HS200 for eMMC
  arm64: dts: r8a7796: enable HS200 for eMMC

 arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts |  1 +
 arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts |  1 +
 drivers/mmc/host/sh_mobile_sdhi.c                  | 67 ++++++++--------------
 3 files changed, 27 insertions(+), 42 deletions(-)

-- 
2.10.2


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 1/9] mmc: sh_mobile_sdhi: simplify accessing DT data
  2016-12-12 19:51 [PATCH 0/9] mmc: sh_mobile_sdhi: add HS200 support Wolfram Sang
@ 2016-12-12 19:51 ` Wolfram Sang
  2016-12-13 10:48   ` Geert Uytterhoeven
  2016-12-12 19:51 ` [PATCH 2/9] mmc: sh_mobile_sdhi: improve prerequisite for hw_reset Wolfram Sang
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 14+ messages in thread
From: Wolfram Sang @ 2016-12-12 19:51 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-renesas-soc, Simon Horman, Wolfram Sang

By using the helper of_device_get_match_data(), we can skip some
checking and make the code simpler.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 15c77bc6e4ee72..b48e3ae4549b6b 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -548,8 +548,7 @@ static void sh_mobile_sdhi_enable_dma(struct tmio_mmc_host *host, bool enable)
 
 static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 {
-	const struct of_device_id *of_id =
-		of_match_device(sh_mobile_sdhi_of_match, &pdev->dev);
+	const struct sh_mobile_sdhi_of_data *of_data = of_device_get_match_data(&pdev->dev);
 	struct sh_mobile_sdhi *priv;
 	struct tmio_mmc_data *mmc_data;
 	struct tmio_mmc_data *mmd = pdev->dev.platform_data;
@@ -590,9 +589,7 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 		goto eprobe;
 	}
 
-	if (of_id && of_id->data) {
-		const struct sh_mobile_sdhi_of_data *of_data = of_id->data;
-
+	if (of_data) {
 		mmc_data->flags |= of_data->tmio_flags;
 		mmc_data->capabilities |= of_data->capabilities;
 		mmc_data->capabilities2 |= of_data->capabilities2;
@@ -662,14 +659,10 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	if (host->mmc->caps & MMC_CAP_UHS_SDR104) {
 		host->mmc->caps |= MMC_CAP_HW_RESET;
 
-		if (of_id && of_id->data) {
-			const struct sh_mobile_sdhi_of_data *of_data;
-			const struct sh_mobile_sdhi_scc *taps;
+		if (of_data) {
+			const struct sh_mobile_sdhi_scc *taps = of_data->taps;
 			bool hit = false;
 
-			of_data = of_id->data;
-			taps = of_data->taps;
-
 			for (i = 0; i < of_data->taps_num; i++) {
 				if (taps[i].clk_rate == 0 ||
 				    taps[i].clk_rate == host->mmc->f_max) {
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 2/9] mmc: sh_mobile_sdhi: improve prerequisite for hw_reset
  2016-12-12 19:51 [PATCH 0/9] mmc: sh_mobile_sdhi: add HS200 support Wolfram Sang
  2016-12-12 19:51 ` [PATCH 1/9] mmc: sh_mobile_sdhi: simplify accessing DT data Wolfram Sang
@ 2016-12-12 19:51 ` Wolfram Sang
  2016-12-13 10:51   ` Geert Uytterhoeven
  2016-12-12 19:51 ` [PATCH 3/9] mmc: sh_mobile_sdhi: improve prerequisites for tuning Wolfram Sang
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 14+ messages in thread
From: Wolfram Sang @ 2016-12-12 19:51 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-renesas-soc, Simon Horman, Wolfram Sang

We need a SCC unit for hw_reset. Those units can only be described in
of_data. So, of_data and a valid SCC offset are prerequisites for
enabling the hw_reset capability. Merge the two 'if' conditions into one
and add a check for an scc offset.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c | 30 ++++++++++++++----------------
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index b48e3ae4549b6b..f3ea2c8b12040c 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -656,27 +656,25 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	if (ret < 0)
 		goto efree;
 
-	if (host->mmc->caps & MMC_CAP_UHS_SDR104) {
+	if (of_data && of_data->scc_offset && host->mmc->caps & MMC_CAP_UHS_SDR104) {
+		const struct sh_mobile_sdhi_scc *taps = of_data->taps;
+		bool hit = false;
+
 		host->mmc->caps |= MMC_CAP_HW_RESET;
 
-		if (of_data) {
-			const struct sh_mobile_sdhi_scc *taps = of_data->taps;
-			bool hit = false;
-
-			for (i = 0; i < of_data->taps_num; i++) {
-				if (taps[i].clk_rate == 0 ||
-				    taps[i].clk_rate == host->mmc->f_max) {
-					host->scc_tappos = taps->tap;
-					hit = true;
-					break;
-				}
+		for (i = 0; i < of_data->taps_num; i++) {
+			if (taps[i].clk_rate == 0 ||
+			    taps[i].clk_rate == host->mmc->f_max) {
+				host->scc_tappos = taps->tap;
+				hit = true;
+				break;
 			}
+		}
 
-			if (!hit)
-				dev_warn(&host->pdev->dev, "Unknown clock rate for SDR104\n");
+		if (!hit)
+			dev_warn(&host->pdev->dev, "Unknown clock rate for SDR104\n");
 
-			priv->scc_ctl = host->ctl + of_data->scc_offset;
-		}
+		priv->scc_ctl = host->ctl + of_data->scc_offset;
 	}
 
 	i = 0;
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 3/9] mmc: sh_mobile_sdhi: improve prerequisites for tuning
  2016-12-12 19:51 [PATCH 0/9] mmc: sh_mobile_sdhi: add HS200 support Wolfram Sang
  2016-12-12 19:51 ` [PATCH 1/9] mmc: sh_mobile_sdhi: simplify accessing DT data Wolfram Sang
  2016-12-12 19:51 ` [PATCH 2/9] mmc: sh_mobile_sdhi: improve prerequisite for hw_reset Wolfram Sang
@ 2016-12-12 19:51 ` Wolfram Sang
  2016-12-12 19:51 ` [PATCH 4/9] mmc: sh_mobile_sdhi: remove superfluous check in hw_reset Wolfram Sang
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Wolfram Sang @ 2016-12-12 19:51 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-renesas-soc, Simon Horman, Wolfram Sang

Prerequisites for tuning are the same as for hw_reset. We need an SCC
and a supported mode. Populate the tuning related functions only when
those conditions are met. This also removes a tiny race window.
Previously, the functions were populated when the SCC offset was not
initialized which could have led to an OOPS.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index f3ea2c8b12040c..96ebe985d5cdc6 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -611,11 +611,6 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 		host->card_busy	= sh_mobile_sdhi_card_busy;
 		host->start_signal_voltage_switch =
 			sh_mobile_sdhi_start_signal_voltage_switch;
-		host->init_tuning	= sh_mobile_sdhi_init_tuning;
-		host->prepare_tuning	= sh_mobile_sdhi_prepare_tuning;
-		host->select_tuning	= sh_mobile_sdhi_select_tuning;
-		host->check_scc_error	= sh_mobile_sdhi_check_scc_error;
-		host->hw_reset		= sh_mobile_sdhi_hw_reset;
 	}
 
 	/* Orginally registers were 16 bit apart, could be 32 or 64 nowadays */
@@ -656,6 +651,7 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	if (ret < 0)
 		goto efree;
 
+	/* Enable tuning iff we have an SCC and a supported mode */
 	if (of_data && of_data->scc_offset && host->mmc->caps & MMC_CAP_UHS_SDR104) {
 		const struct sh_mobile_sdhi_scc *taps = of_data->taps;
 		bool hit = false;
@@ -675,6 +671,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 			dev_warn(&host->pdev->dev, "Unknown clock rate for SDR104\n");
 
 		priv->scc_ctl = host->ctl + of_data->scc_offset;
+		host->init_tuning = sh_mobile_sdhi_init_tuning;
+		host->prepare_tuning = sh_mobile_sdhi_prepare_tuning;
+		host->select_tuning = sh_mobile_sdhi_select_tuning;
+		host->check_scc_error = sh_mobile_sdhi_check_scc_error;
+		host->hw_reset = sh_mobile_sdhi_hw_reset;
 	}
 
 	i = 0;
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 4/9] mmc: sh_mobile_sdhi: remove superfluous check in hw_reset
  2016-12-12 19:51 [PATCH 0/9] mmc: sh_mobile_sdhi: add HS200 support Wolfram Sang
                   ` (2 preceding siblings ...)
  2016-12-12 19:51 ` [PATCH 3/9] mmc: sh_mobile_sdhi: improve prerequisites for tuning Wolfram Sang
@ 2016-12-12 19:51 ` Wolfram Sang
  2016-12-12 19:51 ` [PATCH 5/9] mmc: sh_mobile_sdhi: remove superfluous check in init_tuning Wolfram Sang
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Wolfram Sang @ 2016-12-12 19:51 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-renesas-soc, Simon Horman, Wolfram Sang

The capability for HW_RESET is only activated if SDR104 is present, so
no need to check for SDR104 in the function itself again.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 96ebe985d5cdc6..7964f9a87d9c20 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -460,9 +460,6 @@ static void sh_mobile_sdhi_hw_reset(struct tmio_mmc_host *host)
 {
 	struct sh_mobile_sdhi *priv;
 
-	if (!(host->mmc->caps & MMC_CAP_UHS_SDR104))
-		return;
-
 	priv = host_to_priv(host);
 
 	/* Reset SCC */
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 5/9] mmc: sh_mobile_sdhi: remove superfluous check in init_tuning
  2016-12-12 19:51 [PATCH 0/9] mmc: sh_mobile_sdhi: add HS200 support Wolfram Sang
                   ` (3 preceding siblings ...)
  2016-12-12 19:51 ` [PATCH 4/9] mmc: sh_mobile_sdhi: remove superfluous check in hw_reset Wolfram Sang
@ 2016-12-12 19:51 ` Wolfram Sang
  2016-12-12 19:51 ` [PATCH 6/9] mmc: sh_mobile_sdhi: remove superfluous check in SCC error check Wolfram Sang
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Wolfram Sang @ 2016-12-12 19:51 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-renesas-soc, Simon Horman, Wolfram Sang

The function will only be available if SDR104 was detected in probe,
so no need to check in the function itself again.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 7964f9a87d9c20..22bedbea8ec502 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -327,9 +327,6 @@ static unsigned int sh_mobile_sdhi_init_tuning(struct tmio_mmc_host *host)
 {
 	struct sh_mobile_sdhi *priv;
 
-	if (!(host->mmc->caps & MMC_CAP_UHS_SDR104))
-		return 0;
-
 	priv = host_to_priv(host);
 
 	/* set sampling clock selection range */
-- 
2.10.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 6/9] mmc: sh_mobile_sdhi: remove superfluous check in SCC error check
  2016-12-12 19:51 [PATCH 0/9] mmc: sh_mobile_sdhi: add HS200 support Wolfram Sang
                   ` (4 preceding siblings ...)
  2016-12-12 19:51 ` [PATCH 5/9] mmc: sh_mobile_sdhi: remove superfluous check in init_tuning Wolfram Sang
@ 2016-12-12 19:51 ` Wolfram Sang
  2016-12-12 19:51 ` [PATCH 7/9] mmc: sh_mobile_sdhi: enable HS200 Wolfram Sang
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Wolfram Sang @ 2016-12-12 19:51 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-renesas-soc, Simon Horman, Wolfram Sang

The function will only be available if SDR104 was detected in probe,
so no need to check in the function itself again.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 22bedbea8ec502..2bd17890ec4b77 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -433,12 +433,7 @@ static int sh_mobile_sdhi_select_tuning(struct tmio_mmc_host *host)
 
 static bool sh_mobile_sdhi_check_scc_error(struct tmio_mmc_host *host)
 {
-	struct sh_mobile_sdhi *priv;
-
-	if (!(host->mmc->caps & MMC_CAP_UHS_SDR104))
-		return 0;
-
-	priv = host_to_priv(host);
+	struct sh_mobile_sdhi *priv = host_to_priv(host);
 
 	/* Check SCC error */
 	if (sd_scc_read32(host, priv, SH_MOBILE_SDHI_SCC_RVSCNTL) &
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 7/9] mmc: sh_mobile_sdhi: enable HS200
  2016-12-12 19:51 [PATCH 0/9] mmc: sh_mobile_sdhi: add HS200 support Wolfram Sang
                   ` (5 preceding siblings ...)
  2016-12-12 19:51 ` [PATCH 6/9] mmc: sh_mobile_sdhi: remove superfluous check in SCC error check Wolfram Sang
@ 2016-12-12 19:51 ` Wolfram Sang
  2016-12-12 19:51 ` [PATCH 8/9] arm64: dts: r8a7795: enable HS200 for eMMC Wolfram Sang
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Wolfram Sang @ 2016-12-12 19:51 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-renesas-soc, Simon Horman, Wolfram Sang

Setup tuning when the board is HS200 enabled.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 2bd17890ec4b77..c79545e4f69444 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -641,7 +641,9 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 		goto efree;
 
 	/* Enable tuning iff we have an SCC and a supported mode */
-	if (of_data && of_data->scc_offset && host->mmc->caps & MMC_CAP_UHS_SDR104) {
+	if (of_data && of_data->scc_offset &&
+	    (host->mmc->caps & MMC_CAP_UHS_SDR104 ||
+	     host->mmc->caps2 & MMC_CAP2_HS200_1_8V_SDR)) {
 		const struct sh_mobile_sdhi_scc *taps = of_data->taps;
 		bool hit = false;
 
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 8/9] arm64: dts: r8a7795: enable HS200 for eMMC
  2016-12-12 19:51 [PATCH 0/9] mmc: sh_mobile_sdhi: add HS200 support Wolfram Sang
                   ` (6 preceding siblings ...)
  2016-12-12 19:51 ` [PATCH 7/9] mmc: sh_mobile_sdhi: enable HS200 Wolfram Sang
@ 2016-12-12 19:51 ` Wolfram Sang
  2016-12-12 19:51 ` [PATCH 9/9] arm64: dts: r8a7796: " Wolfram Sang
  2016-12-29 19:02 ` [PATCH 0/9] mmc: sh_mobile_sdhi: add HS200 support Ulf Hansson
  9 siblings, 0 replies; 14+ messages in thread
From: Wolfram Sang @ 2016-12-12 19:51 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-renesas-soc, Simon Horman, Wolfram Sang

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts b/arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts
index 56f3a91c72cc9b..d7758d3c0efa21 100644
--- a/arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts
+++ b/arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts
@@ -547,6 +547,7 @@
 	vmmc-supply = <&reg_3p3v>;
 	vqmmc-supply = <&reg_1p8v>;
 	bus-width = <8>;
+	mmc-hs200-1_8v;
 	non-removable;
 	status = "okay";
 };
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 9/9] arm64: dts: r8a7796: enable HS200 for eMMC
  2016-12-12 19:51 [PATCH 0/9] mmc: sh_mobile_sdhi: add HS200 support Wolfram Sang
                   ` (7 preceding siblings ...)
  2016-12-12 19:51 ` [PATCH 8/9] arm64: dts: r8a7795: enable HS200 for eMMC Wolfram Sang
@ 2016-12-12 19:51 ` Wolfram Sang
  2016-12-29 19:02 ` [PATCH 0/9] mmc: sh_mobile_sdhi: add HS200 support Ulf Hansson
  9 siblings, 0 replies; 14+ messages in thread
From: Wolfram Sang @ 2016-12-12 19:51 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-renesas-soc, Simon Horman, Wolfram Sang

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts b/arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts
index da46ac73ff2ae3..f8e1211b1d9034 100644
--- a/arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts
+++ b/arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts
@@ -262,6 +262,7 @@
 	vmmc-supply = <&reg_3p3v>;
 	vqmmc-supply = <&reg_1p8v>;
 	bus-width = <8>;
+	mmc-hs200-1_8v;
 	non-removable;
 	status = "okay";
 };
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/9] mmc: sh_mobile_sdhi: simplify accessing DT data
  2016-12-12 19:51 ` [PATCH 1/9] mmc: sh_mobile_sdhi: simplify accessing DT data Wolfram Sang
@ 2016-12-13 10:48   ` Geert Uytterhoeven
  0 siblings, 0 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2016-12-13 10:48 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: Linux MMC List, Linux-Renesas, Simon Horman

On Mon, Dec 12, 2016 at 8:51 PM, Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> By using the helper of_device_get_match_data(), we can skip some
> checking and make the code simpler.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/9] mmc: sh_mobile_sdhi: improve prerequisite for hw_reset
  2016-12-12 19:51 ` [PATCH 2/9] mmc: sh_mobile_sdhi: improve prerequisite for hw_reset Wolfram Sang
@ 2016-12-13 10:51   ` Geert Uytterhoeven
  2016-12-13 11:08     ` Wolfram Sang
  0 siblings, 1 reply; 14+ messages in thread
From: Geert Uytterhoeven @ 2016-12-13 10:51 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: Linux MMC List, Linux-Renesas, Simon Horman

On Mon, Dec 12, 2016 at 8:51 PM, Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> We need a SCC unit for hw_reset. Those units can only be described in
> of_data. So, of_data and a valid SCC offset are prerequisites for
> enabling the hw_reset capability. Merge the two 'if' conditions into one
> and add a check for an scc offset.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

> ---
>  drivers/mmc/host/sh_mobile_sdhi.c | 30 ++++++++++++++----------------
>  1 file changed, 14 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
> index b48e3ae4549b6b..f3ea2c8b12040c 100644
> --- a/drivers/mmc/host/sh_mobile_sdhi.c
> +++ b/drivers/mmc/host/sh_mobile_sdhi.c
> @@ -656,27 +656,25 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
>         if (ret < 0)
>                 goto efree;
>
> -       if (host->mmc->caps & MMC_CAP_UHS_SDR104) {
> +       if (of_data && of_data->scc_offset && host->mmc->caps & MMC_CAP_UHS_SDR104) {

For readability, you may want to add parentheses around the last check,
and break the long line before the classical punch card line limit.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/9] mmc: sh_mobile_sdhi: improve prerequisite for hw_reset
  2016-12-13 10:51   ` Geert Uytterhoeven
@ 2016-12-13 11:08     ` Wolfram Sang
  0 siblings, 0 replies; 14+ messages in thread
From: Wolfram Sang @ 2016-12-13 11:08 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Wolfram Sang, Linux MMC List, Linux-Renesas, Simon Horman

[-- Attachment #1: Type: text/plain, Size: 340 bytes --]


> > -       if (host->mmc->caps & MMC_CAP_UHS_SDR104) {
> > +       if (of_data && of_data->scc_offset && host->mmc->caps & MMC_CAP_UHS_SDR104) {
> 
> For readability, you may want to add parentheses around the last check,
> and break the long line before the classical punch card line limit.

Your wish comes true in patch 7 :)


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 0/9] mmc: sh_mobile_sdhi: add HS200 support
  2016-12-12 19:51 [PATCH 0/9] mmc: sh_mobile_sdhi: add HS200 support Wolfram Sang
                   ` (8 preceding siblings ...)
  2016-12-12 19:51 ` [PATCH 9/9] arm64: dts: r8a7796: " Wolfram Sang
@ 2016-12-29 19:02 ` Ulf Hansson
  9 siblings, 0 replies; 14+ messages in thread
From: Ulf Hansson @ 2016-12-29 19:02 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-mmc@vger.kernel.org, Linux-Renesas, Simon Horman

On 12 December 2016 at 20:51, Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> Here is a series adding HS200 support to the SDHI driver. Building the actual
> functionality on top of SDR104 support was rather easy. However, I figured the
> checks for enabling tuning were rather scattered over the driver and could be
> further improved. So I did some refactoring of that to make adding HS200
> support then a one-liner :)
>
> This has been tested on Salvator-X boards with R-Car H3 and M3-W SoCs. It has
> also been tested on a Lager board (R-Car H2) checking SDR50/104 for
> regressions. The whole test document showing significant speed-ups reading from
> the on-board eMMC can be found here:
>
> http://elinux.org/Tests:eMMC-HS
>
> and the branch can be found here:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/topic/sdhi-emmc-hs
>
> Please comment, review, apply...
>
> Thanks,
>
>    Wolfram
>
>
> Wolfram Sang (9):
>   mmc: sh_mobile_sdhi: simplify accessing DT data
>   mmc: sh_mobile_sdhi: improve prerequisite for hw_reset
>   mmc: sh_mobile_sdhi: improve prerequisites for tuning
>   mmc: sh_mobile_sdhi: remove superfluous check in hw_reset
>   mmc: sh_mobile_sdhi: remove superfluous check in init_tuning
>   mmc: sh_mobile_sdhi: remove superfluous check in SCC error check
>   mmc: sh_mobile_sdhi: enable HS200
>   arm64: dts: r8a7795: enable HS200 for eMMC
>   arm64: dts: r8a7796: enable HS200 for eMMC
>
>  arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts |  1 +
>  arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts |  1 +
>  drivers/mmc/host/sh_mobile_sdhi.c                  | 67 ++++++++--------------
>  3 files changed, 27 insertions(+), 42 deletions(-)
>

Thanks, applied patch 1 -> 7 for next. DTS changes in patch 8 and 9
are for Simon to pick up.

Kind regards
Uffe

> --
> 2.10.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2016-12-29 19:02 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-12 19:51 [PATCH 0/9] mmc: sh_mobile_sdhi: add HS200 support Wolfram Sang
2016-12-12 19:51 ` [PATCH 1/9] mmc: sh_mobile_sdhi: simplify accessing DT data Wolfram Sang
2016-12-13 10:48   ` Geert Uytterhoeven
2016-12-12 19:51 ` [PATCH 2/9] mmc: sh_mobile_sdhi: improve prerequisite for hw_reset Wolfram Sang
2016-12-13 10:51   ` Geert Uytterhoeven
2016-12-13 11:08     ` Wolfram Sang
2016-12-12 19:51 ` [PATCH 3/9] mmc: sh_mobile_sdhi: improve prerequisites for tuning Wolfram Sang
2016-12-12 19:51 ` [PATCH 4/9] mmc: sh_mobile_sdhi: remove superfluous check in hw_reset Wolfram Sang
2016-12-12 19:51 ` [PATCH 5/9] mmc: sh_mobile_sdhi: remove superfluous check in init_tuning Wolfram Sang
2016-12-12 19:51 ` [PATCH 6/9] mmc: sh_mobile_sdhi: remove superfluous check in SCC error check Wolfram Sang
2016-12-12 19:51 ` [PATCH 7/9] mmc: sh_mobile_sdhi: enable HS200 Wolfram Sang
2016-12-12 19:51 ` [PATCH 8/9] arm64: dts: r8a7795: enable HS200 for eMMC Wolfram Sang
2016-12-12 19:51 ` [PATCH 9/9] arm64: dts: r8a7796: " Wolfram Sang
2016-12-29 19:02 ` [PATCH 0/9] mmc: sh_mobile_sdhi: add HS200 support Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox