aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorJerry Huang <Chang-Ming.Huang@freescale.com>2010-08-10 21:01:59 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-11 11:59:05 -0400
commitc4512f79dcb236c8dc2afae176a0dc520096f0bc (patch)
tree4aced8cb26bae4256e538c6a35679d31c60d7dc2 /drivers/mmc
parent9bea3c850dbff2296892298614388bdc71ad2170 (diff)
sdhci: add auto CMD12 support for eSDHC driver
Add auto CMD12 command support for eSDHC driver. This is needed by P4080 and P1022 for block read/write. Manual asynchronous CMD12 abort operation causes protocol violations on these silicons. Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com> Signed-off-by: Roy Zang <tie-fei.zang@freescale.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Kumar Gala <galak@gate.crashing.org> Cc: Grant Likely <grant.likely@secretlab.ca> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/sdhci-of-core.c4
-rw-r--r--drivers/mmc/host/sdhci.c14
-rw-r--r--drivers/mmc/host/sdhci.h2
3 files changed, 18 insertions, 2 deletions
diff --git a/drivers/mmc/host/sdhci-of-core.c b/drivers/mmc/host/sdhci-of-core.c
index a2e9820cd42f..dd1bdd168e66 100644
--- a/drivers/mmc/host/sdhci-of-core.c
+++ b/drivers/mmc/host/sdhci-of-core.c
@@ -154,6 +154,10 @@ static int __devinit sdhci_of_probe(struct of_device *ofdev,
154 host->ops = &sdhci_of_data->ops; 154 host->ops = &sdhci_of_data->ops;
155 } 155 }
156 156
157 if (of_get_property(np, "sdhci,auto-cmd12", NULL))
158 host->quirks |= SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12;
159
160
157 if (of_get_property(np, "sdhci,1-bit-only", NULL)) 161 if (of_get_property(np, "sdhci,1-bit-only", NULL))
158 host->quirks |= SDHCI_QUIRK_FORCE_1_BIT_DATA; 162 host->quirks |= SDHCI_QUIRK_FORCE_1_BIT_DATA;
159 163
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index c86c14af479f..785512133b50 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -818,8 +818,12 @@ static void sdhci_set_transfer_mode(struct sdhci_host *host,
818 WARN_ON(!host->data); 818 WARN_ON(!host->data);
819 819
820 mode = SDHCI_TRNS_BLK_CNT_EN; 820 mode = SDHCI_TRNS_BLK_CNT_EN;
821 if (data->blocks > 1) 821 if (data->blocks > 1) {
822 mode |= SDHCI_TRNS_MULTI; 822 if (host->quirks & SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12)
823 mode |= SDHCI_TRNS_MULTI | SDHCI_TRNS_ACMD12;
824 else
825 mode |= SDHCI_TRNS_MULTI;
826 }
823 if (data->flags & MMC_DATA_READ) 827 if (data->flags & MMC_DATA_READ)
824 mode |= SDHCI_TRNS_READ; 828 mode |= SDHCI_TRNS_READ;
825 if (host->flags & SDHCI_REQ_USE_DMA) 829 if (host->flags & SDHCI_REQ_USE_DMA)
@@ -1109,6 +1113,12 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
1109#ifndef SDHCI_USE_LEDS_CLASS 1113#ifndef SDHCI_USE_LEDS_CLASS
1110 sdhci_activate_led(host); 1114 sdhci_activate_led(host);
1111#endif 1115#endif
1116 if (host->quirks & SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12) {
1117 if (mrq->stop) {
1118 mrq->data->stop = NULL;
1119 mrq->stop = NULL;
1120 }
1121 }
1112 1122
1113 host->mrq = mrq; 1123 host->mrq = mrq;
1114 1124
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index ff070a309f8d..036cfae76368 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -243,6 +243,8 @@ struct sdhci_host {
243#define SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC (1<<26) 243#define SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC (1<<26)
244/* Controller is missing device caps. Use caps provided by host */ 244/* Controller is missing device caps. Use caps provided by host */
245#define SDHCI_QUIRK_MISSING_CAPS (1<<27) 245#define SDHCI_QUIRK_MISSING_CAPS (1<<27)
246/* Controller uses Auto CMD12 command to stop the transfer */
247#define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 (1<<28)
246 248
247 int irq; /* Device IRQ */ 249 int irq; /* Device IRQ */
248 void __iomem * ioaddr; /* Mapped address */ 250 void __iomem * ioaddr; /* Mapped address */