linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Fenkart <afenkart@gmail.com>
To: Jerome Brunet <jbrunet@baylibre.com>
Cc: "open list : ARM/Amlogic Meson . . ."
	<linux-amlogic@lists.infradead.org>,
	Andreas Fenkart <afenkart@gmail.com>,
	linux-mmc <linux-mmc@vger.kernel.org>,
	krzysztof.michonski@digitalstrom.com
Subject: [PATCH v2] mmc: meson-gx: enable signal re-sampling together with tuning
Date: Fri, 18 Jan 2019 14:32:23 +0100	[thread overview]
Message-ID: <20190118133223.16650-1-afenkart@gmail.com> (raw)
In-Reply-To: <3d03d45f18e8b3e10edc7dd7dd03c5b7167abcbc.camel@baylibre.com>

card detection fails on "BeeLink Mini M8 SII" if enabled too early
mmc1: error -110 whilst initialising MMC card

Fixes: 71645e65729f ("mmc: meson-gx: add signal resampling")
Signed-off-by: Andreas Fenkart <afenkart@gmail.com>
---
 drivers/mmc/host/meson-gx-mmc.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
index c2690c1a50ff..dba499009d0c 100644
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -738,6 +738,11 @@ static int meson_mmc_clk_phase_tuning(struct mmc_host *mmc, u32 opcode,
 static int meson_mmc_execute_tuning(struct mmc_host *mmc, u32 opcode)
 {
 	struct meson_host *host = mmc_priv(mmc);
+	int adj = 0;
+
+	/* enable signal resampling w/o delay */
+	adj = ADJUST_ADJ_EN;
+	writel(adj, host->regs + host->data->adjust);
 
 	return meson_mmc_clk_phase_tuning(mmc, opcode, host->rx_clk);
 }
@@ -768,6 +773,9 @@ static void meson_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 		if (!IS_ERR(mmc->supply.vmmc))
 			mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd);
 
+		/* disable signal resampling */
+		writel(0, host->regs + host->data->adjust);
+
 		/* Reset rx phase */
 		clk_set_phase(host->rx_clk, 0);
 
@@ -1166,7 +1174,7 @@ static int meson_mmc_get_cd(struct mmc_host *mmc)
 
 static void meson_mmc_cfg_init(struct meson_host *host)
 {
-	u32 cfg = 0, adj = 0;
+	u32 cfg = 0;
 
 	cfg |= FIELD_PREP(CFG_RESP_TIMEOUT_MASK,
 			  ilog2(SD_EMMC_CFG_RESP_TIMEOUT));
@@ -1177,10 +1185,6 @@ static void meson_mmc_cfg_init(struct meson_host *host)
 	cfg |= CFG_ERR_ABORT;
 
 	writel(cfg, host->regs + SD_EMMC_CFG);
-
-	/* enable signal resampling w/o delay */
-	adj = ADJUST_ADJ_EN;
-	writel(adj, host->regs + host->data->adjust);
 }
 
 static int meson_mmc_card_busy(struct mmc_host *mmc)
-- 
2.20.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply	other threads:[~2019-01-18 13:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-16 10:13 regression caused by: "amlogic: mmc: meson-gx: add signal resampling" Andreas Fenkart
2019-01-16 11:14 ` Ulf Hansson
2019-01-16 13:12   ` Jerome Brunet
2019-01-17 12:35     ` Andreas Fenkart
2019-01-17 12:42       ` Neil Armstrong
2019-01-17 13:56       ` Andreas Fenkart
2019-01-17 14:11         ` Jerome Brunet
2019-01-17 14:47           ` Andreas Fenkart
2019-01-17 15:08             ` Jerome Brunet
2019-01-18 10:05               ` Andreas Fenkart
2019-01-18 10:26                 ` Jerome Brunet
2019-01-18 13:32                   ` Andreas Fenkart [this message]
2019-01-18 14:37                     ` [PATCH v2] mmc: meson-gx: enable signal re-sampling together with tuning Jerome Brunet
2019-01-22  7:48                     ` Ulf Hansson

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=20190118133223.16650-1-afenkart@gmail.com \
    --to=afenkart@gmail.com \
    --cc=jbrunet@baylibre.com \
    --cc=krzysztof.michonski@digitalstrom.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-mmc@vger.kernel.org \
    /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).