From: jbrunet@baylibre.com (Jerome Brunet)
To: linus-amlogic@lists.infradead.org
Subject: [PATCH/RFT] mmc: meson-gx: include tx phase in the tuning process
Date: Mon, 18 Sep 2017 15:44:31 +0200 [thread overview]
Message-ID: <20170918134431.17520-1-jbrunet@baylibre.com> (raw)
In-Reply-To: <b31253d8-38a3-dd25-1d74-6afde6ae8362@gmail.com>
It has been reported that some platforms (odroid-c2) may require
a different tx phase setting to operate at high speed.
To improve the situation, this patch includes tx phase in the tuning
process.
Reported-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
Hi Heiner,
Would you mind trying this change with your setup and letting us know
if it helps ?
It seems like a good idea to add an initial Rx tuning before doing the
actual tuning but, honestly, I don't know if it is really necessary.
Regards
Jerome
drivers/mmc/host/meson-gx-mmc.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
index c885c2d4b904..0254d8bfd536 100644
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -717,6 +717,22 @@ 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 ret;
+
+ /*
+ * If this is the initial tuning, try to get a sane Rx starting
+ * phase before doing the actual tuning.
+ */
+ if (!mmc->doing_retune) {
+ ret = meson_mmc_clk_phase_tuning(mmc, opcode, host->rx_clk);
+
+ if (ret)
+ return ret;
+ }
+
+ ret = meson_mmc_clk_phase_tuning(mmc, opcode, host->tx_clk);
+ if (ret)
+ return ret;
return meson_mmc_clk_phase_tuning(mmc, opcode, host->rx_clk);
}
--
2.13.5
next prev parent reply other threads:[~2017-09-18 13:44 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-09 13:14 Problems after recent changes to meson-gx-mmc driver Heiner Kallweit
2017-09-09 14:05 ` Jerome Brunet
2017-09-09 19:53 ` Heiner Kallweit
2017-09-09 20:20 ` Heiner Kallweit
2017-09-10 15:08 ` Jerome Brunet
2017-09-10 16:20 ` Heiner Kallweit
2017-09-10 16:48 ` Jerome Brunet
2017-09-18 13:44 ` Jerome Brunet [this message]
2017-09-18 19:11 ` [PATCH/RFT] mmc: meson-gx: include tx phase in the tuning process Heiner Kallweit
2017-09-19 11:08 ` Jerome Brunet
2017-09-19 18:54 ` Heiner Kallweit
2017-09-27 16:24 ` Jerome Brunet
2017-10-02 12:30 ` Jerome Brunet
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=20170918134431.17520-1-jbrunet@baylibre.com \
--to=jbrunet@baylibre.com \
--cc=linus-amlogic@lists.infradead.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
all inboxes | Powered by JetHome®