summaryrefslogtreecommitdiff
path: root/drivers/mmc/host/sdhci-pci.c
diff options
context:
space:
mode:
authorPierre Ossman <drzeus@drzeus.cx>2008-06-28 18:28:51 +0200
committerPierre Ossman <drzeus@drzeus.cx>2008-07-15 14:14:44 +0200
commit2134a922c6e75c779983cad5d8aae832275f5a0d (patch)
treefb77a7a82cc62c9e788044cc7117b2cd72368c15 /drivers/mmc/host/sdhci-pci.c
parent93fc48c785f6266e67663b3cbbf24579b53fe5cf (diff)
sdhci: scatter-gather (ADMA) support
Add support for the scatter-gather DMA mode present on newer controllers. As the mode requires 32-bit alignment, non-aligned chunks are handled by using a bounce buffer. Also add some new quirks to handle controllers that have bugs in the ADMA engine. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/mmc/host/sdhci-pci.c')
-rw-r--r--drivers/mmc/host/sdhci-pci.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c
index 0716dcffd511..deb607c52c0d 100644
--- a/drivers/mmc/host/sdhci-pci.c
+++ b/drivers/mmc/host/sdhci-pci.c
@@ -142,6 +142,7 @@ static int jmicron_probe(struct sdhci_pci_chip *chip)
if (chip->pdev->revision == 0) {
chip->quirks |= SDHCI_QUIRK_32BIT_DMA_ADDR |
SDHCI_QUIRK_32BIT_DMA_SIZE |
+ SDHCI_QUIRK_32BIT_ADMA_SIZE |
SDHCI_QUIRK_RESET_AFTER_REQUEST;
}
@@ -206,6 +207,22 @@ static void jmicron_enable_mmc(struct sdhci_host *host, int on)
static int jmicron_probe_slot(struct sdhci_pci_slot *slot)
{
+ if (slot->chip->pdev->revision == 0) {
+ u16 version;
+
+ version = readl(slot->host->ioaddr + SDHCI_HOST_VERSION);
+ version = (version & SDHCI_VENDOR_VER_MASK) >>
+ SDHCI_VENDOR_VER_SHIFT;
+
+ /*
+ * Older versions of the chip have lots of nasty glitches
+ * in the ADMA engine. It's best just to avoid it
+ * completely.
+ */
+ if (version < 0xAC)
+ slot->host->quirks |= SDHCI_QUIRK_BROKEN_ADMA;
+ }
+
/*
* The secondary interface requires a bit set to get the
* interrupts.