SHA256
1
0
forked from pool/u-boot
u-boot/sdhc-3.patch
Ismail Dönmez f41db49412 Accepting request 146560 from Base:System
- add sdhc-1.patch, sdhc-2.patch, sdhc-3.patch:
  * backport upstream sdhc fixes

- update to 2012.10:
  - refresh patches 0006-ARMV7-hardfp-build-fix.patch, mlo-ext2.patch,
    loadaddr-defaults.patch, mx53loco-bootscr.patch

- add sdhc-1.patch, sdhc-2.patch, sdhc-3.patch:
  * backport upstream sdhc fixes

- update to 2012.10:
  - refresh patches 0006-ARMV7-hardfp-build-fix.patch, mlo-ext2.patch,
    loadaddr-defaults.patch, mx53loco-bootscr.patch

- add sdhc-1.patch, sdhc-2.patch, sdhc-3.patch:
  * backport upstream sdhc fixes

- update to 2012.10:
  - refresh patches 0006-ARMV7-hardfp-build-fix.patch, mlo-ext2.patch,
    loadaddr-defaults.patch, mx53loco-bootscr.patch

- add sdhc-1.patch, sdhc-2.patch, sdhc-3.patch:
  * backport upstream sdhc fixes

- update to 2012.10:
  - refresh patches 0006-ARMV7-hardfp-build-fix.patch, mlo-ext2.patch,
    loadaddr-defaults.patch, mx53loco-bootscr.patch

- add sdhc-1.patch, sdhc-2.patch, sdhc-3.patch:
  * backport upstream sdhc fixes

OBS-URL: https://build.opensuse.org/request/show/146560
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/u-boot?expand=0&rev=8
2012-12-28 21:50:19 +00:00

64 lines
2.4 KiB
Diff

From: Tushar Behera <tushar.behera@linaro.org>
Date: Thu, 20 Sep 2012 20:31:57 +0000 (+0000)
Subject: mmc: sdhci: Add a quirk to add delay during completion of sdhci_send_cmd
X-Git-Url: http://git.denx.de/?p=u-boot.git;a=commitdiff_plain;h=13243f2eafc4292917178051fe1bb5aab2774dca;hp=804c7f422169212e92530e1ddaf74bf1ca9ebfa1
mmc: sdhci: Add a quirk to add delay during completion of sdhci_send_cmd
MMC host controller requires a delay between every sdhci_send_cmd()
execution. In s5p_mmc driver (s5p_sdhci replaces this driver), a delay
of 1000us was provided after every mmc_send_cmd() call. Adding a quirk
in current sdhci driver to replicate the behaviour.
Without this delay, MMC initialization on Origen board fails with
following error messages.
Timeout for status update!
mmc fail to send stop cmd
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
---
diff --git a/drivers/mmc/s5p_sdhci.c b/drivers/mmc/s5p_sdhci.c
index b978236..dc49d37 100644
--- a/drivers/mmc/s5p_sdhci.c
+++ b/drivers/mmc/s5p_sdhci.c
@@ -83,7 +83,8 @@ int s5p_sdhci_init(u32 regbase, int index, int bus_width)
host->ioaddr = (void *)regbase;
host->quirks = SDHCI_QUIRK_NO_HISPD_BIT | SDHCI_QUIRK_BROKEN_VOLTAGE |
- SDHCI_QUIRK_BROKEN_R1B | SDHCI_QUIRK_32BIT_DMA_ADDR;
+ SDHCI_QUIRK_BROKEN_R1B | SDHCI_QUIRK_32BIT_DMA_ADDR |
+ SDHCI_QUIRK_WAIT_SEND_CMD;
host->voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195;
host->version = sdhci_readw(host, SDHCI_HOST_VERSION);
diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 15b4686..7845f87 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -240,6 +240,9 @@ int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
if (!ret && data)
ret = sdhci_transfer_data(host, data, start_addr);
+ if (host->quirks & SDHCI_QUIRK_WAIT_SEND_CMD)
+ udelay(1000);
+
stat = sdhci_readl(host, SDHCI_INT_STATUS);
sdhci_writel(host, SDHCI_INT_ALL_MASK, SDHCI_INT_STATUS);
if (!ret) {
diff --git a/include/sdhci.h b/include/sdhci.h
index c0345ed..c44793d 100644
--- a/include/sdhci.h
+++ b/include/sdhci.h
@@ -224,6 +224,7 @@
#define SDHCI_QUIRK_NO_HISPD_BIT (1 << 3)
#define SDHCI_QUIRK_BROKEN_VOLTAGE (1 << 4)
#define SDHCI_QUIRK_NO_CD (1 << 5)
+#define SDHCI_QUIRK_WAIT_SEND_CMD (1 << 6)
/* to make gcc happy */
struct sdhci_host;