From: Yangbo Lu <yangbo.lu@nxp.com>
To: linux-mmc@vger.kernel.org, ulf.hansson@linaro.org,
Adrian Hunter <adrian.hunter@intel.com>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will.deacon@arm.com>
Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
Xiaobo Xie <xiaobo.xie@nxp.com>, Yangbo Lu <yangbo.lu@nxp.com>
Subject: [PATCH 6/9] mmc: sdhci: add a quirk to restore delay in tuning
Date: Thu, 2 Mar 2017 17:47:27 +0800 [thread overview]
Message-ID: <1488448050-7574-7-git-send-email-yangbo.lu@nxp.com> (raw)
In-Reply-To: <1488448050-7574-1-git-send-email-yangbo.lu@nxp.com>
There was a mdelay between tuning cycles which is removed since
eMMC spec didn't require that. However it's observed that eSDHC
needed this delay for HS200 successful tuning. Maybe it's also
needed for some other controllers. This patch is to add a quirk
to fix it.
Fixes: 197160d52e85 ("mmc: sdhci: remove mdelay in eMMC tuning")
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
drivers/mmc/host/sdhci.c | 3 ++-
drivers/mmc/host/sdhci.h | 2 ++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 051b192..b1b6fd3 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2100,7 +2100,8 @@ static void __sdhci_execute_tuning(struct sdhci_host *host, u32 opcode,
}
/* eMMC spec does not require a delay between tuning cycles */
- if (opcode == MMC_SEND_TUNING_BLOCK)
+ if ((opcode == MMC_SEND_TUNING_BLOCK) ||
+ (host->quirks2 & SDHCI_QUIRK2_DELAY_BETWEEN_TUNING_CYCLES))
mdelay(1);
}
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index d43519b..b6643bc 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -427,6 +427,8 @@ struct sdhci_host {
#define SDHCI_QUIRK2_ACMD23_BROKEN (1<<14)
/* Broken Clock divider zero in controller */
#define SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN (1<<15)
+/* Delay is needed between tuning cycles */
+#define SDHCI_QUIRK2_DELAY_BETWEEN_TUNING_CYCLES (1<<16)
int irq; /* Device IRQ */
void __iomem *ioaddr; /* Mapped address */
--
2.1.0.27.g96db324
next prev parent reply other threads:[~2017-03-02 9:47 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-02 9:47 [PATCH 0/9] Add SD UHS-I and eMMC HS200 support for eSDHC Yangbo Lu
2017-03-02 9:47 ` [PATCH 1/9] mmc: sdhci-of-esdhc: add peripheral clock support Yangbo Lu
2017-03-02 9:47 ` [PATCH 2/9] mmc: sdhci: add a callback for signal voltage switching Yangbo Lu
2017-03-02 14:19 ` Adrian Hunter
2017-03-03 7:38 ` Y.B. Lu
2017-03-02 9:47 ` [PATCH 3/9] mmc: sdhci-of-esdhc: add support for signal voltage switch Yangbo Lu
2017-03-02 9:47 ` [PATCH 4/9] mmc: sdhci: add a callback for using tuning block Yangbo Lu
2017-03-02 14:25 ` Adrian Hunter
2017-03-03 7:39 ` Y.B. Lu
2017-03-02 9:47 ` [PATCH 5/9] mmc: sdhci-of-esdhc: add tuning block support Yangbo Lu
2017-03-02 9:47 ` Yangbo Lu [this message]
2017-03-02 9:47 ` [PATCH 7/9] mmc: sdhci-of-esdhc: add delay between tuning cycles Yangbo Lu
2017-03-02 9:47 ` [PATCH 8/9] arm64: dts: ls1046a: add clocks property and compatible for eSDHC node Yangbo Lu
2017-03-02 9:47 ` [PATCH 9/9] arm64: dts: ls1046ardb: add MMC HS200/UHS-1 modes support Yangbo Lu
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=1488448050-7574-7-git-send-email-yangbo.lu@nxp.com \
--to=yangbo.lu@nxp.com \
--cc=adrian.hunter@intel.com \
--cc=catalin.marinas@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=robh+dt@kernel.org \
--cc=ulf.hansson@linaro.org \
--cc=will.deacon@arm.com \
--cc=xiaobo.xie@nxp.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).