]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/mmc/omap_hsmmc.c
TX6 Release 2013-04-22
[karo-tx-uboot.git] / drivers / mmc / omap_hsmmc.c
index afd9b30b513f92b60e74c8419f239e2712ba6958..a00e507449e6bd158dd788bd3a9da5a06145b2e6 100644 (file)
@@ -155,8 +155,8 @@ void mmc_init_stream(struct hsmmc *mmc_base)
        writel(MMC_CMD0, &mmc_base->cmd);
        start = get_timer(0);
        while (!(readl(&mmc_base->stat) & CC_MASK)) {
-               if (get_timer(0) - start > MAX_RETRY_MS) {
-                       printf("%s: timedout waiting for cc!\n", __func__);
+               if (get_timer(start) > MAX_RETRY_MS) {
+                       printf("%s: timeout waiting for cc!\n", __func__);
                        return;
                }
        }
@@ -166,8 +166,8 @@ void mmc_init_stream(struct hsmmc *mmc_base)
                ;
        start = get_timer(0);
        while (!(readl(&mmc_base->stat) & CC_MASK)) {
-               if (get_timer(0) - start > MAX_RETRY_MS) {
-                       printf("%s: timedout waiting for cc2!\n", __func__);
+               if (get_timer(start) > MAX_RETRY_MS) {
+                       printf("%s: timeout waiting for cc2!\n", __func__);
                        return;
                }
        }
@@ -188,16 +188,16 @@ static int mmc_init_setup(struct mmc *mmc)
                &mmc_base->sysconfig);
        start = get_timer(0);
        while ((readl(&mmc_base->sysstatus) & RESETDONE) == 0) {
-               if (get_timer(0) - start > MAX_RETRY_MS) {
-                       printf("%s: timedout waiting for cc2!\n", __func__);
+               if (get_timer(start) > MAX_RETRY_MS) {
+                       printf("%s: timeout waiting for cc2!\n", __func__);
                        return TIMEOUT;
                }
        }
        writel(readl(&mmc_base->sysctl) | SOFTRESETALL, &mmc_base->sysctl);
        start = get_timer(0);
        while ((readl(&mmc_base->sysctl) & SOFTRESETALL) != 0x0) {
-               if (get_timer(0) - start > MAX_RETRY_MS) {
-                       printf("%s: timedout waiting for softresetall!\n",
+               if (get_timer(start) > MAX_RETRY_MS) {
+                       printf("%s: timeout waiting for softresetall!\n",
                                __func__);
                        return TIMEOUT;
                }
@@ -219,8 +219,8 @@ static int mmc_init_setup(struct mmc *mmc)
                (dsor << CLKD_OFFSET) | ICE_OSCILLATE);
        start = get_timer(0);
        while ((readl(&mmc_base->sysctl) & ICS_MASK) == ICS_NOTREADY) {
-               if (get_timer(0) - start > MAX_RETRY_MS) {
-                       printf("%s: timedout waiting for ics!\n", __func__);
+               if (get_timer(start) > MAX_RETRY_MS) {
+                       printf("%s: timeout waiting for ics!\n", __func__);
                        return TIMEOUT;
                }
        }
@@ -262,14 +262,14 @@ static void mmc_reset_controller_fsm(struct hsmmc *mmc_base, u32 bit)
 static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
                        struct mmc_data *data)
 {
-       struct hsmmc *mmc_base = (struct hsmmc *)mmc->priv;
+       struct hsmmc *mmc_base = mmc->priv;
        unsigned int flags, mmc_stat;
        ulong start;
 
        start = get_timer(0);
        while ((readl(&mmc_base->pstate) & (DATI_MASK | CMDI_MASK)) != 0) {
-               if (get_timer(0) - start > MAX_RETRY_MS) {
-                       printf("%s: timedout waiting on cmd inhibit to clear\n",
+               if (get_timer(start) > MAX_RETRY_MS) {
+                       printf("%s: timeout waiting on cmd inhibit to clear\n",
                                        __func__);
                        return TIMEOUT;
                }
@@ -277,9 +277,8 @@ static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
        writel(0xFFFFFFFF, &mmc_base->stat);
        start = get_timer(0);
        while (readl(&mmc_base->stat)) {
-               if (get_timer(0) - start > MAX_RETRY_MS) {
-                       printf("%s: timedout waiting for STAT (%x) to clear\n",
-                               __func__, readl(&mmc_base->stat));
+               if (get_timer(start) > MAX_RETRY_MS) {
+                       printf("%s: timeout waiting for stat!\n", __func__);
                        return TIMEOUT;
                }
        }
@@ -341,7 +340,7 @@ static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
        start = get_timer(0);
        do {
                mmc_stat = readl(&mmc_base->stat);
-               if (get_timer(0) - start > MAX_RETRY_MS) {
+               if (get_timer(start) > MAX_RETRY_MS) {
                        printf("%s : timeout: No status update\n", __func__);
                        return TIMEOUT;
                }
@@ -394,8 +393,8 @@ static int mmc_read_data(struct hsmmc *mmc_base, char *buf, unsigned int size)
                ulong start = get_timer(0);
                do {
                        mmc_stat = readl(&mmc_base->stat);
-                       if (get_timer(0) - start > MAX_RETRY_MS) {
-                               printf("%s: timedout waiting for status!\n",
+                       if (get_timer(start) > MAX_RETRY_MS) {
+                               printf("%s: timeout waiting for status!\n",
                                                __func__);
                                return TIMEOUT;
                        }
@@ -449,8 +448,8 @@ static int mmc_write_data(struct hsmmc *mmc_base, const char *buf,
                ulong start = get_timer(0);
                do {
                        mmc_stat = readl(&mmc_base->stat);
-                       if (get_timer(0) - start > MAX_RETRY_MS) {
-                               printf("%s: timedout waiting for status!\n",
+                       if (get_timer(start) > MAX_RETRY_MS) {
+                               printf("%s: timeout waiting for status!\n",
                                                __func__);
                                return TIMEOUT;
                        }
@@ -532,8 +531,8 @@ static void mmc_set_ios(struct mmc *mmc)
 
        start = get_timer(0);
        while ((readl(&mmc_base->sysctl) & ICS_MASK) == ICS_NOTREADY) {
-               if (get_timer(0) - start > MAX_RETRY_MS) {
-                       printf("%s: timedout waiting for ics!\n", __func__);
+               if (get_timer(start) > MAX_RETRY_MS) {
+                       printf("%s: timeout waiting for ics!\n", __func__);
                        return;
                }
        }