]> git.sur5r.net Git - u-boot/blobdiff - cpu/pxa/interrupts.c
* Fix udelay() on AT91RM9200 for delays < 1 ms.
[u-boot] / cpu / pxa / interrupts.c
index 8aec0b9dd6c27443a66f8b6ee181dbbf01bdb27b..fd02154b8682481db1ecccbe20472b17f95b05bb 100644 (file)
@@ -193,9 +193,14 @@ void udelay_masked (unsigned long usec)
 {
        ulong tmo;
 
-       tmo = usec / 1000;
-       tmo *= CFG_HZ;
-       tmo /= 1000;
+       if (usec >= 1000) {
+               tmo = usec / 1000;
+               tmo *= CFG_HZ;
+               tmo /= 1000;
+       } else {
+               tmo = usec * CFG_HZ;
+               tmo /= (1000*1000);
+       }
 
        reset_timer_masked ();