85xx: Cleanup L2 cache size detection
[oweals/u-boot.git] / cpu / microblaze / timer.c
index be4fd57cc49dd3b76041071ba4d3332426af7021..b350453443e8d09fbfdaa979df50284df1f57cd7 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <common.h>
 #include <asm/microblaze_timer.h>
+#include <asm/microblaze_intc.h>
 
 volatile int timestamp = 0;
 
@@ -32,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)
 {
@@ -44,9 +52,6 @@ void set_timer (ulong t)
 
 #ifdef CFG_INTC_0
 #ifdef CFG_TIMER_0
-extern void install_interrupt_handler (int irq, interrupt_handler_t * hdlr,
-                                      void *arg);
-
 microblaze_timer_t *tmr = (microblaze_timer_t *) (CFG_TIMER_0_ADDR);
 
 void timer_isr (void *arg)