X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=drivers%2Fmmc%2Fkona_sdhci.c;h=ddd821bfc3317efafb2f262de0c864bcb75b8a9e;hb=92962b3caf17f5e64075601a466b3ac00dbd0a88;hp=f804f4c0dbfc1f9af79b9289bc88790ef8143cac;hpb=304f936aeaab0c3cc9d5af438fd3498ac7682991;p=u-boot diff --git a/drivers/mmc/kona_sdhci.c b/drivers/mmc/kona_sdhci.c index f804f4c0db..ddd821bfc3 100644 --- a/drivers/mmc/kona_sdhci.c +++ b/drivers/mmc/kona_sdhci.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #define SDHCI_CORECTRL_OFFSET 0x00008000 @@ -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,18 +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->host_caps = MMC_MODE_HC; + 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; }