]> git.sur5r.net Git - u-boot/blobdiff - drivers/mmc/kona_sdhci.c
Merge git://git.denx.de/u-boot-spi
[u-boot] / drivers / mmc / kona_sdhci.c
index c67a262c7ae8272b92b5b2fc72540a85982a4ebb..ddd821bfc3317efafb2f262de0c864bcb75b8a9e 100644 (file)
@@ -27,7 +27,7 @@ static int init_kona_mmc_core(struct sdhci_host *host)
 
        if (sdhci_readb(host, SDHCI_SOFTWARE_RESET) & SDHCI_RESET_ALL) {
                printf("%s: sd host controller reset error\n", __func__);
-               return 1;
+               return -EBUSY;
        }
 
        /* For kona a hardware reset before anything else. */
@@ -39,7 +39,7 @@ static int init_kona_mmc_core(struct sdhci_host *host)
        do {
                if (timeout == 0) {
                        printf("%s: reset timeout error\n", __func__);
-                       return 1;
+                       return -ETIMEDOUT;
                }
                timeout--;
                udelay(100);
@@ -67,7 +67,7 @@ static int init_kona_mmc_core(struct sdhci_host *host)
        while (!(sdhci_readl(host, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT)) {
                if (timeout == 0) {
                        printf("%s: CARD DETECT timeout error\n", __func__);
-                       return 1;
+                       return -ETIMEDOUT;
                }
                timeout--;
                udelay(100);
@@ -121,12 +121,13 @@ int kona_sdhci_init(int dev_index, u32 min_clk, u32 quirks)
        host->name = "kona-sdhci";
        host->ioaddr = reg_base;
        host->quirks = quirks;
+       host->max_clk = max_clk;
 
        if (init_kona_mmc_core(host)) {
                free(host);
                return -EINVAL;
        }
 
-       add_sdhci(host, max_clk, min_clk);
+       add_sdhci(host, 0, min_clk);
        return ret;
 }