]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
sdhci: Add quirk for controllers that need small delays for PIO
authorAnton Vorontsov <avorontsov@ru.mvista.com>
Mon, 16 Mar 2009 21:14:00 +0000 (00:14 +0300)
committerPierre Ossman <drzeus@drzeus.cx>
Tue, 24 Mar 2009 20:30:10 +0000 (21:30 +0100)
Small udelay is needed to make eSDHC work in PIO mode. Without
the delay reading causes endless interrupt storm, and writing
corrupts data. The first guess would be that we must wait for
some bit in some register, but I didn't find any reliable bits
that change before and after the delay.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
drivers/mmc/host/sdhci.c
drivers/mmc/host/sdhci.h

index 75d0ecbce10c9857bed947d154bdde16955b3334..cd6dab34ba54d21f046d21874f050092e5ce65fd 100644 (file)
@@ -336,6 +336,9 @@ static void sdhci_transfer_pio(struct sdhci_host *host)
                mask = ~0;
 
        while (sdhci_readl(host, SDHCI_PRESENT_STATE) & mask) {
+               if (host->quirks & SDHCI_QUIRK_PIO_NEEDS_DELAY)
+                       udelay(100);
+
                if (host->data->flags & MMC_DATA_READ)
                        sdhci_read_block_pio(host);
                else
index b9bc622735badafae1ff8a798c0ffab7af506244..c5ce9ee1a1bc63ceb5f72726fcfc79910f389418 100644 (file)
@@ -220,6 +220,8 @@ struct sdhci_host {
 #define SDHCI_QUIRK_INVERTED_WRITE_PROTECT             (1<<16)
 /* Controller has nonstandard clock management */
 #define SDHCI_QUIRK_NONSTANDARD_CLOCK                  (1<<17)
+/* Controller does not like fast PIO transfers */
+#define SDHCI_QUIRK_PIO_NEEDS_DELAY                    (1<<18)
 
        int                     irq;            /* Device IRQ */
        void __iomem *          ioaddr;         /* Mapped address */