summaryrefslogtreecommitdiff
path: root/lib_microblaze/time.c
diff options
context:
space:
mode:
authorMichal Simek <monstr@monstr.eu>2007-07-14 00:18:48 +0200
committerMichal Simek <monstr@monstr.eu>2007-07-14 00:18:48 +0200
commit5a2f1098d81ad58b309e5e558d0492643166a799 (patch)
tree681bd9075465e789b6733a8727c1ee1bb5dbdd9d /lib_microblaze/time.c
parenta476ca2ac2217ddd05a2bf0c514075814b10a3c0 (diff)
downloadu-boot-5a2f1098d81ad58b309e5e558d0492643166a799.tar.gz
[PATCH] Support time without timer
Diffstat (limited to 'lib_microblaze/time.c')
-rw-r--r--lib_microblaze/time.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib_microblaze/time.c b/lib_microblaze/time.c
index 3fa1b11262..0fef834992 100644
--- a/lib_microblaze/time.c
+++ b/lib_microblaze/time.c
@@ -26,9 +26,17 @@
#include <common.h>
+#ifdef CFG_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 * XILINX_CLOCK_FREQ / 10000000); i++);
+}
+#endif