summaryrefslogtreecommitdiff
path: root/lib_microblaze/time.c
diff options
context:
space:
mode:
authorMichal Simek <monstr@monstr.eu>2007-09-24 00:21:19 +0200
committerMichal Simek <monstr@monstr.eu>2007-09-24 00:21:19 +0200
commit1c1100d2fcf46b9d11dcf78d6e5aea75e2e8b716 (patch)
tree773dcc416d5026f97ca891b8598754e839086261 /lib_microblaze/time.c
parent0731933ec8ec45d02ba89b52df673d526873cdde (diff)
[PATCH] Add support for design without interrupt controller
Polling 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 3fa1b112627..b5d8f19379e 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 * CONFIG_XILINX_CLOCK_FREQ / 10000000); i++);
+}
+#endif