]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
edb93xx: change calculation un early_udelay.h
authorAlessandro Rubini <rubini-list@gnudd.com>
Sat, 6 Feb 2010 19:53:54 +0000 (20:53 +0100)
committerTom Rix <Tom.Rix@windriver.com>
Fri, 12 Feb 2010 18:31:54 +0000 (12:31 -0600)
Previous code compiled with gcc-4.2.2 makes a call to
__aeabi_uidiv to divide by 20. As a side effect it was
not inline any more, and so sdram_cfg used the stack
as well, but this is early code that has no stack yet.
The patch explicitly removes the division, so no stack is used.

The calculation of the counter calls a division by 20

Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
board/edb93xx/early_udelay.h

index 3b26b3f16cd7c60358c5cbfc0fc825e33ecb500a..185283d98dca4e3cfa0114036adde2cc8785ec0c 100644 (file)
@@ -26,7 +26,7 @@
 static inline void early_udelay(uint32_t usecs)
 {
        /* loop takes 4 cycles at 5.0ns (fastest case, running at 200MHz) */
-       register uint32_t loops = (usecs * 1000) / 20;
+       register uint32_t loops = usecs * (1000 / 20);
 
        __asm__ volatile ("1:\n"
                        "subs %0, %1, #1\n"