linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V1] mmc: tegra: support SDHCI SPEC 300
@ 2012-04-18 13:18 Pavan Kunapuli
  2012-04-18 16:52 ` Stephen Warren
  0 siblings, 1 reply; 3+ messages in thread
From: Pavan Kunapuli @ 2012-04-18 13:18 UTC (permalink / raw)
  To: cjb, swarren, paul.gortmaker, olof, rmk+kernel, linux-mmc, linux-kernel
  Cc: Pavan Kunapuli

Tegra3 SDHOST controller doesn't advertise
v3.00 support by default. This support has to
be enabled by configuring a vendor register in
the tegra3 sd host address space.

Signed-off-by: Pavan Kunapuli <pkunapuli@nvidia.com>
---
 drivers/mmc/host/sdhci-tegra.c |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index 53b2650..cff0c52 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -32,8 +32,13 @@
 
 #include "sdhci-pltfm.h"
 
+/* Tegra SDHOST controller vendor register definitions */
+#define SDHCI_TEGRA_VENDOR_MISC_CTRL		0x120
+#define SDHCI_MISC_CTRL_ENABLE_SDHCI_SPEC_300	0x20
+
 #define NVQUIRK_FORCE_SDHCI_SPEC_200	BIT(0)
 #define NVQUIRK_ENABLE_BLOCK_GAP_DET	BIT(1)
+#define NVQUIRK_ENABLE_SDHCI_SPEC_300	BIT(2)
 
 struct sdhci_tegra_soc_data {
 	struct sdhci_pltfm_data *pdata;
@@ -120,6 +125,25 @@ static irqreturn_t carddetect_irq(int irq, void *data)
 	return IRQ_HANDLED;
 };
 
+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;
+
+	if (!(mask & SDHCI_RESET_ALL))
+		return;
+
+	/* 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);
+		misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDHCI_SPEC_300;
+		sdhci_writeb(host, misc_ctrl, SDHCI_TEGRA_VENDOR_MISC_CTRL);
+	}
+}
+
 static int tegra_sdhci_8bit(struct sdhci_host *host, int bus_width)
 {
 	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
@@ -148,6 +172,7 @@ static struct sdhci_ops tegra_sdhci_ops = {
 	.read_w     = tegra_sdhci_readw,
 	.write_l    = tegra_sdhci_writel,
 	.platform_8bit_width = tegra_sdhci_8bit,
+	.platform_reset_exit = tegra_sdhci_reset_exit,
 };
 
 #ifdef CONFIG_ARCH_TEGRA_2x_SOC
@@ -178,6 +203,7 @@ static 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,
 };
 #endif
 
-- 
1.7.1.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH V1] mmc: tegra: support SDHCI SPEC 300
  2012-04-18 13:18 [PATCH V1] mmc: tegra: support SDHCI SPEC 300 Pavan Kunapuli
@ 2012-04-18 16:52 ` Stephen Warren
  2012-04-19  0:07   ` Chris Ball
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Warren @ 2012-04-18 16:52 UTC (permalink / raw)
  To: Pavan Kunapuli
  Cc: cjb, swarren, paul.gortmaker, olof, rmk+kernel, linux-mmc, linux-kernel

On 04/18/2012 07:18 AM, Pavan Kunapuli wrote:
> Tegra3 SDHOST controller doesn't advertise
> v3.00 support by default. This support has to
> be enabled by configuring a vendor register in
> the tegra3 sd host address space.
> 
> Signed-off-by: Pavan Kunapuli <pkunapuli@nvidia.com>

FWIW,

Acked-by: Stephen Warren <swarren@wwwdotorg.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH V1] mmc: tegra: support SDHCI SPEC 300
  2012-04-18 16:52 ` Stephen Warren
@ 2012-04-19  0:07   ` Chris Ball
  0 siblings, 0 replies; 3+ messages in thread
From: Chris Ball @ 2012-04-19  0:07 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Pavan Kunapuli, swarren, paul.gortmaker, olof, rmk+kernel,
	linux-mmc, linux-kernel

Hi,

On Wed, Apr 18 2012, Stephen Warren wrote:
> On 04/18/2012 07:18 AM, Pavan Kunapuli wrote:
>> Tegra3 SDHOST controller doesn't advertise
>> v3.00 support by default. This support has to
>> be enabled by configuring a vendor register in
>> the tegra3 sd host address space.
>> 
>> Signed-off-by: Pavan Kunapuli <pkunapuli@nvidia.com>
>
> FWIW,
>
> Acked-by: Stephen Warren <swarren@wwwdotorg.org>

Thanks, pushed to mmc-next for 3.5.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-04-19  0:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-18 13:18 [PATCH V1] mmc: tegra: support SDHCI SPEC 300 Pavan Kunapuli
2012-04-18 16:52 ` Stephen Warren
2012-04-19  0:07   ` Chris Ball

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).