X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=lib_microblaze%2Ftime.c;h=cbb43414f9cf860b0ad83bb899012e2bbb58d454;hb=40b161f6aea54104d0a5e477ff6a22338e8a7b4b;hp=12e84888bd5f3daa0285be53a34e430208d76194;hpb=8ad96012cd9e46b355ec63eb5a0155c92d8ca52c;p=karo-tx-uboot.git diff --git a/lib_microblaze/time.c b/lib_microblaze/time.c index 12e84888bd..cbb43414f9 100755 --- a/lib_microblaze/time.c +++ b/lib_microblaze/time.c @@ -1,6 +1,8 @@ /* + * (C) Copyright 2007 Michal Simek * (C) Copyright 2004 Atmark Techno, Inc. * + * Michal SIMEK * Yasushi SHOJI * * See file CREDITS for list of people who contributed to this @@ -22,6 +24,19 @@ * MA 02111-1307 USA */ -void udelay(unsigned long usec) +#include + +#ifdef CONFIG_SYS_TIMER_0 +void udelay (unsigned long usec) +{ + int i; + i = get_timer (0); + while ((get_timer (0) - i) < (usec / 1000)) ; +} +#else +void udelay (unsigned long usec) { + unsigned int i; + for (i = 0; i < (usec * CONFIG_XILINX_CLOCK_FREQ / 10000000); i++); } +#endif