]> git.sur5r.net Git - u-boot/blobdiff - drivers/mmc/kona_sdhci.c
mtd: nand: mxs_nand: move structs into header file
[u-boot] / drivers / mmc / kona_sdhci.c
index e730caa2079c8db90d30ee5a5bd0609b72d36ed4..f5e1f2cbbd32fbf5af8cab6a1de2a3a5a74a4557 100644 (file)
@@ -1,7 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2013 Broadcom Corporation.
- *
- * SPDX-License-Identifier:      GPL-2.0+
  */
 
 #include <common.h>
@@ -27,7 +26,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 +38,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 +66,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,17 +120,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;
        }
 
-       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);
+       add_sdhci(host, 0, min_clk);
        return ret;
 }