linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: abrestic@chromium.org (Andrew Bresticker)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/3] mmc: tegra: disable UHS modes
Date: Wed, 16 Apr 2014 16:08:37 -0700	[thread overview]
Message-ID: <1397689719-28882-2-git-send-email-abrestic@chromium.org> (raw)
In-Reply-To: <1397689719-28882-1-git-send-email-abrestic@chromium.org>

Program TEGRA_SDHCI_VENDOR_MISC_CTRL so that UHS modes aren't advertised
in SDHCI_CAPABILITIES_1.  While the Tegra SDHCI controller does support
these modes, they require Tegra-specific tuning and calibration routines
which the driver does not support yet.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
No changes from v1
---
 drivers/mmc/host/sdhci-tegra.c | 30 +++++++++++++++++++++++-------
 1 file changed, 23 insertions(+), 7 deletions(-)

diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index a835898..3cadd9c 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -32,11 +32,17 @@
 
 /* Tegra SDHOST controller vendor register definitions */
 #define SDHCI_TEGRA_VENDOR_MISC_CTRL		0x120
+#define SDHCI_MISC_CTRL_ENABLE_SDR104		0x8
+#define SDHCI_MISC_CTRL_ENABLE_SDR50		0x10
 #define SDHCI_MISC_CTRL_ENABLE_SDHCI_SPEC_300	0x20
+#define SDHCI_MISC_CTRL_ENABLE_DDR50		0x200
 
 #define NVQUIRK_FORCE_SDHCI_SPEC_200	BIT(0)
 #define NVQUIRK_ENABLE_BLOCK_GAP_DET	BIT(1)
 #define NVQUIRK_ENABLE_SDHCI_SPEC_300	BIT(2)
+#define NVQUIRK_DISABLE_SDR50		BIT(3)
+#define NVQUIRK_DISABLE_SDR104		BIT(4)
+#define NVQUIRK_DISABLE_DDR50		BIT(5)
 
 struct sdhci_tegra_soc_data {
 	const struct sdhci_pltfm_data *pdata;
@@ -113,18 +119,23 @@ static void tegra_sdhci_reset_exit(struct sdhci_host *host, u8 mask)
 	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
 	struct sdhci_tegra *tegra_host = pltfm_host->priv;
 	const struct sdhci_tegra_soc_data *soc_data = tegra_host->soc_data;
+	u32 misc_ctrl;
 
 	if (!(mask & SDHCI_RESET_ALL))
 		return;
 
+	misc_ctrl = sdhci_readw(host, SDHCI_TEGRA_VENDOR_MISC_CTRL);
 	/* Erratum: Enable SDHCI spec v3.00 support */
-	if (soc_data->nvquirks & NVQUIRK_ENABLE_SDHCI_SPEC_300) {
-		u32 misc_ctrl;
-
-		misc_ctrl = sdhci_readb(host, SDHCI_TEGRA_VENDOR_MISC_CTRL);
+	if (soc_data->nvquirks & NVQUIRK_ENABLE_SDHCI_SPEC_300)
 		misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDHCI_SPEC_300;
-		sdhci_writeb(host, misc_ctrl, SDHCI_TEGRA_VENDOR_MISC_CTRL);
-	}
+	/* Don't advertise UHS modes which aren't supported yet */
+	if (soc_data->nvquirks & NVQUIRK_DISABLE_SDR50)
+		misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_SDR50;
+	if (soc_data->nvquirks & NVQUIRK_DISABLE_DDR50)
+		misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_DDR50;
+	if (soc_data->nvquirks & NVQUIRK_DISABLE_SDR104)
+		misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_SDR104;
+	sdhci_writew(host, misc_ctrl, SDHCI_TEGRA_VENDOR_MISC_CTRL);
 }
 
 static int tegra_sdhci_buswidth(struct sdhci_host *host, int bus_width)
@@ -181,7 +192,9 @@ static const struct sdhci_pltfm_data sdhci_tegra30_pdata = {
 
 static struct sdhci_tegra_soc_data soc_data_tegra30 = {
 	.pdata = &sdhci_tegra30_pdata,
-	.nvquirks = NVQUIRK_ENABLE_SDHCI_SPEC_300,
+	.nvquirks = NVQUIRK_ENABLE_SDHCI_SPEC_300 |
+		    NVQUIRK_DISABLE_SDR50 |
+		    NVQUIRK_DISABLE_SDR104,
 };
 
 static const struct sdhci_pltfm_data sdhci_tegra114_pdata = {
@@ -195,6 +208,9 @@ static const struct sdhci_pltfm_data sdhci_tegra114_pdata = {
 
 static struct sdhci_tegra_soc_data soc_data_tegra114 = {
 	.pdata = &sdhci_tegra114_pdata,
+	.nvquirks = NVQUIRK_DISABLE_SDR50 |
+		    NVQUIRK_DISABLE_DDR50 |
+		    NVQUIRK_DISABLE_SDR104,
 };
 
 static const struct of_device_id sdhci_tegra_dt_match[] = {
-- 
1.9.1.423.g4596e3a

  reply	other threads:[~2014-04-16 23:08 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-15  1:42 [PATCH 0/4] Tegra SD/MMC fixes Andrew Bresticker
2014-04-15  1:42 ` [PATCH 1/4] mmc: tegra: disable UHS modes Andrew Bresticker
2014-04-15  1:42 ` [PATCH 2/4] mmc: tegra: fix reporting of base clock frequency Andrew Bresticker
2014-04-15 18:25   ` Stephen Warren
2014-04-15 19:36     ` Andrew Bresticker
2014-04-15  1:42 ` [PATCH 3/4] mmc: sdhci: defer probing on regulator_get_optional() failures Andrew Bresticker
2014-04-15  6:06   ` Alexandre Courbot
2014-04-15 22:56     ` Andrew Bresticker
2014-04-15 18:28   ` Stephen Warren
2014-04-15 19:59     ` Andrew Bresticker
2014-04-15 20:42       ` Russell King - ARM Linux
2014-04-15 19:03   ` Tim Kryger
2014-04-15 19:44     ` Andrew Bresticker
2014-04-15  1:42 ` [PATCH 4/4] ARM: tegra: fix Venice2 VQMMC regulators Andrew Bresticker
2014-04-15 18:31   ` Stephen Warren
2014-04-15 19:12     ` Chris Ball
2014-04-16  0:29   ` Andrew Bresticker
2014-04-16 16:19     ` Stephen Warren
2014-04-16 20:24       ` Andrew Bresticker
2014-04-16 23:08 ` [PATCH v2 0/3] Tegra SD/MMC fixes Andrew Bresticker
2014-04-16 23:08   ` Andrew Bresticker [this message]
2014-05-20 17:25     ` [PATCH v2 1/3] mmc: tegra: disable UHS modes Stephen Warren
2014-05-21  0:43       ` Chris Ball
2014-05-22 11:00         ` Ulf Hansson
2014-05-22 15:25           ` Andrew Bresticker
2014-04-16 23:08   ` [PATCH v2 2/3] mmc: tegra: fix reporting of base clock frequency Andrew Bresticker
2014-04-16 23:08   ` [PATCH v2 3/3] ARM: tegra: fix Venice2 SD card VQMMC supply Andrew Bresticker
2014-04-16 23:16     ` Stephen Warren

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=1397689719-28882-2-git-send-email-abrestic@chromium.org \
    --to=abrestic@chromium.org \
    --cc=linux-arm-kernel@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;
as well as URLs for NNTP newsgroup(s).