]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/mmc/sdhci.c
serial_sh: Add support Renesas SH7752
[karo-tx-uboot.git] / drivers / mmc / sdhci.c
index 2e3c408bc55ab2a0d50b07a88d676fe1d70f135c..b9cbe34f1f12f728471514ceac568576fe696b9c 100644 (file)
@@ -82,8 +82,15 @@ static int sdhci_transfer_data(struct sdhci_host *host, struct mmc_data *data,
                                unsigned int start_addr)
 {
        unsigned int stat, rdy, mask, timeout, block = 0;
+#ifdef CONFIG_MMC_SDMA
+       unsigned char ctrl;
+       ctrl = sdhci_readl(host, SDHCI_HOST_CONTROL);
+       ctrl &= ~SDHCI_CTRL_DMA_MASK;
+       ctrl |= SDHCI_CTRL_SDMA;
+       sdhci_writel(host, ctrl, SDHCI_HOST_CONTROL);
+#endif
 
-       timeout = 10000;
+       timeout = 1000000;
        rdy = SDHCI_INT_SPACE_AVAIL | SDHCI_INT_DATA_AVAIL;
        mask = SDHCI_DATA_AVAILABLE | SDHCI_SPACE_AVAILABLE;
        do {
@@ -233,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) {
@@ -330,6 +340,9 @@ static void sdhci_set_power(struct sdhci_host *host, unsigned short power)
                return;
        }
 
+       if (host->quirks & SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER)
+               sdhci_writeb(host, pwr, SDHCI_POWER_CONTROL);
+
        pwr |= SDHCI_POWER_ON;
 
        sdhci_writeb(host, pwr, SDHCI_POWER_CONTROL);