linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: linux-mmc@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>
Subject: [PATCH/RFT 5/5] mmc: renesas_sdhi: use recent tap values for HS400
Date: Tue,  3 Dec 2019 21:05:13 +0100	[thread overview]
Message-ID: <20191203200513.1758-6-wsa+renesas@sang-engineering.com> (raw)
In-Reply-To: <20191203200513.1758-1-wsa+renesas@sang-engineering.com>

New datasheets require different and new values for HS400 with 4taps or
8taps.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

This patch needs an ack from the BSP team and/or Shimoda-san. The BSP
code uses this only for M3-W ES1.3 which is not supported yet upstream.
However, H3 ES2.0 (which we do support) needs the same fix IMO because
it is also using 4taps with HS400. But that needs confirmation as I
can't recreate the error case here.

 drivers/mmc/host/renesas_sdhi.h               | 4 ++--
 drivers/mmc/host/renesas_sdhi_core.c          | 5 ++++-
 drivers/mmc/host/renesas_sdhi_internal_dmac.c | 2 +-
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/renesas_sdhi.h b/drivers/mmc/host/renesas_sdhi.h
index 88d05a617d43..f524251d5113 100644
--- a/drivers/mmc/host/renesas_sdhi.h
+++ b/drivers/mmc/host/renesas_sdhi.h
@@ -14,8 +14,8 @@
 
 struct renesas_sdhi_scc {
 	unsigned long clk_rate;	/* clock rate for SDR104 */
-	u32 tap;		/* sampling clock position for SDR104 */
-	u32 tap_hs400;		/* sampling clock position for HS400 */
+	u32 tap;		/* sampling clock position for SDR104/HS400 (8 TAP) */
+	u32 tap_hs400_4tap;	/* sampling clock position for HS400 (4 TAP) */
 };
 
 struct renesas_sdhi_of_data {
diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index 8ee6298d5a51..282c133defd6 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -794,13 +794,16 @@ int renesas_sdhi_probe(struct platform_device *pdev,
 	     host->mmc->caps2 & (MMC_CAP2_HS200_1_8V_SDR |
 				 MMC_CAP2_HS400_1_8V))) {
 		const struct renesas_sdhi_scc *taps = of_data->taps;
+		bool use_4tap = priv->quirks && priv->quirks->hs400_4taps;
 		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) {
 				priv->scc_tappos = taps->tap;
-				priv->scc_tappos_hs400 = taps->tap_hs400;
+				priv->scc_tappos_hs400 = use_4tap ?
+							 taps->tap_hs400_4tap :
+							 taps->tap;
 				hit = true;
 				break;
 			}
diff --git a/drivers/mmc/host/renesas_sdhi_internal_dmac.c b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
index 18839a10594c..68fb39a74b8b 100644
--- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c
+++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
@@ -82,7 +82,7 @@ static struct renesas_sdhi_scc rcar_gen3_scc_taps[] = {
 	{
 		.clk_rate = 0,
 		.tap = 0x00000300,
-		.tap_hs400 = 0x00000704,
+		.tap_hs400_4tap = 0x00000100,
 	},
 };
 
-- 
2.20.1


  parent reply	other threads:[~2019-12-03 20:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-03 20:05 [PATCH 0/5] mmc: renesas_sdhi: prepare for recent HS400 updates Wolfram Sang
2019-12-03 20:05 ` [PATCH 1/5] mmc: renesas_sdhi: keep sorting for quirk entries Wolfram Sang
2019-12-04  9:26   ` Geert Uytterhoeven
2019-12-05 12:13   ` Yoshihiro Shimoda
2019-12-03 20:05 ` [PATCH 2/5] mmc: renesas_sdhi: make warning more precise Wolfram Sang
2019-12-04  9:27   ` Geert Uytterhoeven
2019-12-05 12:13   ` Yoshihiro Shimoda
2019-12-03 20:05 ` [PATCH 3/5] mmc: renesas_sdhi: make quirks info accessible outside probe() Wolfram Sang
2019-12-04  9:28   ` Geert Uytterhoeven
2019-12-05 12:14   ` Yoshihiro Shimoda
2019-12-03 20:05 ` [PATCH 4/5] mmc: renesas_sdhi: remove 4taps as a TMIO flag Wolfram Sang
2019-12-04  9:29   ` Geert Uytterhoeven
2019-12-04  9:47   ` Sergei Shtylyov
2019-12-05 12:16   ` Yoshihiro Shimoda
2019-12-03 20:05 ` Wolfram Sang [this message]
2019-12-05 12:45   ` [PATCH/RFT 5/5] mmc: renesas_sdhi: use recent tap values for HS400 Yoshihiro Shimoda
2019-12-10 13:09 ` [PATCH 0/5] mmc: renesas_sdhi: prepare for recent HS400 updates Ulf Hansson
2019-12-10 22:21   ` Wolfram Sang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191203200513.1758-6-wsa+renesas@sang-engineering.com \
    --to=wsa+renesas@sang-engineering.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).