]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mmc: mv_sdhci: Fix host version read for Armada100
authorAjay Bhargav <ajay.bhargav@einfochips.com>
Sun, 13 Nov 2011 23:43:12 +0000 (23:43 +0000)
committerAndy Fleming <afleming@freescale.com>
Fri, 25 Nov 2011 23:43:05 +0000 (17:43 -0600)
sdhci_readw does not work for host version read in Armada100 series
SoCs. This patch fix this issue by making a sdhci_readl call to get host
version.

Signed-off-by: Ajay Bhargav <ajay.bhargav@einfochips.com>
drivers/mmc/mv_sdhci.c
include/sdhci.h

index f92caeb8fd5f43884e720f311fc9e3f58b03f6d2..1501974e2f575eb2784dec176335e4b84db2c2bc 100644 (file)
@@ -48,7 +48,10 @@ int mv_sdh_init(u32 regbase, u32 max_clk, u32 min_clk, u32 quirks)
                mv_ops.write_b = mv_sdhci_writeb;
        host->ops = &mv_ops;
 #endif
-       host->version = sdhci_readw(host, SDHCI_HOST_VERSION);
+       if (quirks & SDHCI_QUIRK_REG32_RW)
+               host->version = sdhci_readl(host, SDHCI_HOST_VERSION - 2) >> 16;
+       else
+               host->version = sdhci_readw(host, SDHCI_HOST_VERSION);
        add_sdhci(host, max_clk, min_clk);
        return 0;
 }
index 0690938046844a769ee340ad4e175b8a9d08c2ed..800f9d9c0733b9af0deaf45c3bd03c7ffbc8dac4 100644 (file)
  * quirks
  */
 #define SDHCI_QUIRK_32BIT_DMA_ADDR     (1 << 0)
+#define SDHCI_QUIRK_REG32_RW           (1 << 1)
 
 /* to make gcc happy */
 struct sdhci_host;