The back-to-back-writes workaround in the BCM2835 MMC driver assumed
that get_timer() returned uS. Now that it returns mS, the delay is far
too long. Use udelay() directly to avoid this. Dispense with the
"last_write" code since we now have no way of recording an absolute
time in uS. The difference between two un-averaged tests loading a
zImage is 445 mS vs the original 412 mS, so the difference doesn't
appear too relevant.

Signed-off-by: Stephen Warren <[email protected]>
---
 drivers/mmc/bcm2835_sdhci.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/mmc/bcm2835_sdhci.c b/drivers/mmc/bcm2835_sdhci.c
index b0afc3c..240b5ec 100644
--- a/drivers/mmc/bcm2835_sdhci.c
+++ b/drivers/mmc/bcm2835_sdhci.c
@@ -46,7 +46,6 @@
 struct bcm2835_sdhci_host {
        struct sdhci_host host;
        uint twoticks_delay;
-       ulong last_write;
 };
 
 static inline struct bcm2835_sdhci_host *to_bcm(struct sdhci_host *host)
@@ -67,11 +66,9 @@ static inline void bcm2835_sdhci_raw_writel(struct 
sdhci_host *host, u32 val,
         * (Which is just as well - otherwise we'd have to nobble the DMA engine
         * too)
         */
-       while (get_timer(bcm_host->last_write) < bcm_host->twoticks_delay)
-               ;
+       udelay(bcm_host->twoticks_delay);
 
        writel(val, host->ioaddr + reg);
-       bcm_host->last_write = get_timer(0);
 }
 
 static inline u32 bcm2835_sdhci_raw_readl(struct sdhci_host *host, int reg)
@@ -172,7 +169,6 @@ int bcm2835_sdhci_init(u32 regbase, u32 emmc_freq)
         * +1 for hack rounding.
         */
        bcm_host->twoticks_delay = ((2 * 1000000) / MIN_FREQ) + 1;
-       bcm_host->last_write = 0;
 
        host = &bcm_host->host;
        host->name = "bcm2835_sdhci";
-- 
1.7.10.4

_______________________________________________
U-Boot mailing list
[email protected]
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to