public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] powerpc/esdhc: disable CMD23 for some Freescale SoCs
@ 2012-09-11  7:12 Chang-Ming.Huang
  2012-09-11  7:12 ` [PATCH 2/3] powerpc/esdhc: add property to disable the CMD23 Chang-Ming.Huang
  2012-09-11  7:57 ` [PATCH 1/3] powerpc/esdhc: disable CMD23 for some Freescale SoCs Anton Vorontsov
  0 siblings, 2 replies; 29+ messages in thread
From: Chang-Ming.Huang @ 2012-09-11  7:12 UTC (permalink / raw)
  To: linux-mmc; +Cc: Jerry Huang, Shaohui Xie, Anton Vorontsov

From: Jerry Huang <Chang-Ming.Huang@freescale.com>

CMD23 causes lots of errors in kernel on some freescale SoCs
when mmc card used, which is because these controllers does
not support CMD23, but even on SoCs which declare CMD23 is supported,
so we'll not use CMD23.

Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
CC: Anton Vorontsov <cbouatmailru@gmail.com>
---
 drivers/mmc/host/sdhci-pltfm.c |    3 +++
 drivers/mmc/host/sdhci.c       |    3 +++
 include/linux/mmc/sdhci.h      |    1 +
 3 files changed, 7 insertions(+)

diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
index d9a4ef4..1e532dd 100644
--- a/drivers/mmc/host/sdhci-pltfm.c
+++ b/drivers/mmc/host/sdhci-pltfm.c
@@ -83,6 +83,9 @@ void sdhci_get_of_property(struct platform_device *pdev)
 		    of_device_is_compatible(np, "fsl,mpc8536-esdhc"))
 			host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
 
+		if (of_get_property(np, "sdhci,no-cmd23", NULL))
+			host->quirks2 |= SDHCI_QUIRK2_HOST_NO_CMD23;
+
 		clk = of_get_property(np, "clock-frequency", &size);
 		if (clk && size == sizeof(*clk) && *clk)
 			pltfm_host->clock = be32_to_cpup(clk);
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index d98b199..a7ec2a0 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2829,6 +2829,9 @@ int sdhci_add_host(struct sdhci_host *host)
 	if (!(host->quirks & SDHCI_QUIRK_FORCE_1_BIT_DATA))
 		mmc->caps |= MMC_CAP_4_BIT_DATA;
 
+	if (host->quirks2 & SDHCI_QUIRK2_HOST_NO_CMD23)
+		mmc->caps &= ~MMC_CAP_CMD23;
+
 	if (caps[0] & SDHCI_CAN_DO_HISPD)
 		mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED;
 
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index fa8529a..1edcb4d 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -91,6 +91,7 @@ struct sdhci_host {
 	unsigned int quirks2;	/* More deviations from spec. */
 
 #define SDHCI_QUIRK2_HOST_OFF_CARD_ON			(1<<0)
+#define SDHCI_QUIRK2_HOST_NO_CMD23			(1<<1)
 
 	int irq;		/* Device IRQ */
 	void __iomem *ioaddr;	/* Mapped address */
-- 
1.7.9.5



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

end of thread, other threads:[~2012-09-18  5:07 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-11  7:12 [PATCH 1/3] powerpc/esdhc: disable CMD23 for some Freescale SoCs Chang-Ming.Huang
2012-09-11  7:12 ` [PATCH 2/3] powerpc/esdhc: add property to disable the CMD23 Chang-Ming.Huang
2012-09-11  7:12   ` [PATCH 3/3] MMC/esdhc: introduce the 'sdhci,no-cmd23' Chang-Ming.Huang
2012-09-11  7:55     ` Anton Vorontsov
2012-09-11  7:54   ` [PATCH 2/3] powerpc/esdhc: add property to disable the CMD23 Anton Vorontsov
2012-09-11  8:04     ` Anton Vorontsov
2012-09-11  9:36       ` Huang Changming-R66093
2012-09-11 12:43         ` Kumar Gala
2012-09-11 12:49           ` Kumar Gala
2012-09-11 14:44             ` Chris Ball
2012-09-11 20:26               ` Kumar Gala
2012-09-11 20:59                 ` Chris Ball
2012-09-12  6:18                   ` Huang Changming-R66093
2012-09-12 12:13                     ` Kumar Gala
2012-09-13  2:02                       ` Huang Changming-R66093
2012-09-13 12:47                         ` Kumar Gala
2012-09-14  2:02                           ` Huang Changming-R66093
2012-09-14 12:40                             ` Kumar Gala
2012-09-17 12:36                           ` Chris Ball
2012-09-17 13:12                             ` Kumar Gala
2012-09-17 13:45                               ` Chris Ball
2012-09-18  1:09                               ` Huang Changming-R66093
2012-09-18  5:00                                 ` Kumar Gala
2012-09-18  5:07                                   ` Chris Ball
2012-09-11 18:28       ` Scott Wood
2012-09-12  3:19         ` Huang Changming-R66093
2012-09-12  3:38           ` Anton Vorontsov
2012-09-13  7:57             ` Huang Changming-R66093
2012-09-11  7:57 ` [PATCH 1/3] powerpc/esdhc: disable CMD23 for some Freescale SoCs Anton Vorontsov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox