]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
[PATCH] Add support for design without interrupt controller
authorMichal Simek <monstr@monstr.eu>
Sun, 23 Sep 2007 22:21:19 +0000 (00:21 +0200)
committerMichal Simek <monstr@monstr.eu>
Sun, 23 Sep 2007 22:21:19 +0000 (00:21 +0200)
Polling timer

cpu/microblaze/timer.c
lib_microblaze/time.c

index ab1cb127492b0c18dff5eb7d3884ae0af117bf3f..b350453443e8d09fbfdaa979df50284df1f57cd7 100644 (file)
@@ -33,10 +33,17 @@ void reset_timer (void)
        timestamp = 0;
 }
 
+#ifdef CFG_TIMER_0
 ulong get_timer (ulong base)
 {
        return (timestamp - base);
 }
+#else
+ulong get_timer (ulong base)
+{
+       return (timestamp++ - base);
+}
+#endif
 
 void set_timer (ulong t)
 {
index 3fa1b112627664d9fefa13bc1d5aea13bc40796d..b5d8f19379ec6de7a7c4c6cf0ba5a9bb707ed799 100644 (file)
 
 #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