linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Haijun Zhang <Haijun.Zhang@freescale.com>
To: <linux-mmc@vger.kernel.org>, <linuxppc-dev@lists.ozlabs.org>
Cc: r39252@freescale.com, AFLEMING@freescale.com,
	cbouatmailru@gmail.com, scottwood@freescale.com, cjb@laptop.org,
	Haijun Zhang <haijun.zhang@freescale.com>
Subject: [PATCH 3/4 V2] mmc: esdhc: Add quirks to support T4240QDS board
Date: Mon, 8 Jul 2013 15:16:04 +0800	[thread overview]
Message-ID: <1373267764-6364-2-git-send-email-Haijun.Zhang@freescale.com> (raw)
In-Reply-To: <1373267764-6364-1-git-send-email-Haijun.Zhang@freescale.com>

On T4240QDS board controllers has an unusable ADMA engine, so use SDMA instead.
Also 3.0v is support on T4240QDS board even if the capacity detailed only 1.8v
support. Without this quirk SD card will declare voltage not support and

Signed-off-by: Haijun Zhang <haijun.zhang@freescale.com>
---
changes for v2:
	- Change the compatible for t4240qds board

 drivers/mmc/host/sdhci-pltfm.c | 7 ++++++-
 drivers/mmc/host/sdhci.c       | 3 +++
 include/linux/mmc/sdhci.h      | 2 ++
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
index e2065a4..800e82f 100644
--- a/drivers/mmc/host/sdhci-pltfm.c
+++ b/drivers/mmc/host/sdhci-pltfm.c
@@ -92,9 +92,14 @@ void sdhci_get_of_property(struct platform_device *pdev)
 		if (of_device_is_compatible(np, "fsl,p2020-rev1-esdhc"))
 			host->quirks |= SDHCI_QUIRK_BROKEN_DMA;
 
+		if (of_device_is_compatible(np, "fsl,t4240qds-esdhc")) {
+			host->quirks |= SDHCI_QUIRK_BROKEN_ADMA;
+			host->quirks2 |= SDHCI_QUIRK2_CIRCUIT_SUPPORT_VS30;
+		}
+
 		if (of_device_is_compatible(np, "fsl,p2020-esdhc") ||
 		    of_device_is_compatible(np, "fsl,p1010-esdhc") ||
-		    of_device_is_compatible(np, "fsl,t4240-esdhc") ||
+		    of_device_is_compatible(np, "fsl,t4240qds-esdhc") ||
 		    of_device_is_compatible(np, "fsl,mpc8536-esdhc"))
 			host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
 
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index a78bd4f..de7fa81 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2797,6 +2797,9 @@ int sdhci_add_host(struct sdhci_host *host)
 			host->caps1 :
 			sdhci_readl(host, SDHCI_CAPABILITIES_1);
 
+	if (host->quirks2 & SDHCI_QUIRK2_CIRCUIT_SUPPORT_VS30)
+		caps[0] = caps[0] | SDHCI_CAN_VDD_300;
+
 	if (host->quirks & SDHCI_QUIRK_FORCE_DMA)
 		host->flags |= SDHCI_USE_SDMA;
 	else if (!(caps[0] & SDHCI_CAN_DO_SDMA))
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index e3c6a74..dc608d7 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -98,6 +98,8 @@ struct sdhci_host {
 #define SDHCI_QUIRK2_CARD_ON_NEEDS_BUS_ON		(1<<4)
 /* Controller has a non-standard host control register */
 #define SDHCI_QUIRK2_BROKEN_HOST_CONTROL		(1<<5)
+/* The host support VS300 even if the capacity detailed not */
+#define SDHCI_QUIRK2_CIRCUIT_SUPPORT_VS30		(1<<6)
 
 	int irq;		/* Device IRQ */
 	void __iomem *ioaddr;	/* Mapped address */
-- 
1.8.0

  reply	other threads:[~2013-07-08  8:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-08  7:16 [PATCH] Powerpc/t4240: change the compatible flags for t4240qds board Haijun Zhang
2013-07-08  7:16 ` Haijun Zhang [this message]
2013-07-08 17:18   ` [PATCH 3/4 V2] mmc: esdhc: Add quirks to support T4240QDS board Scott Wood
2013-07-12 18:35     ` Anton Vorontsov
2013-07-16  3:11       ` Zhang Haijun-B42677
2013-07-16  5:04         ` Anton Vorontsov
2013-07-08 17:14 ` [PATCH] Powerpc/t4240: change the compatible flags for t4240qds board Scott Wood
2013-07-09  6:04   ` 答复: " Zhang Haijun-B42677
2013-07-09 20:04     ` Scott Wood
2013-07-10  3:41       ` Zhang Haijun-B42677
2013-07-10 20:30         ` Scott Wood
2013-07-11  1:02           ` Zhang Haijun-B42677
2013-07-11 14:35             ` Scott Wood

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=1373267764-6364-2-git-send-email-Haijun.Zhang@freescale.com \
    --to=haijun.zhang@freescale.com \
    --cc=AFLEMING@freescale.com \
    --cc=cbouatmailru@gmail.com \
    --cc=cjb@laptop.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=r39252@freescale.com \
    --cc=scottwood@freescale.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).