]> git.sur5r.net Git - u-boot/blobdiff - arch/arm/cpu/arm926ejs/mx25/timer.c
Timer: Remove set_timer completely
[u-boot] / arch / arm / cpu / arm926ejs / mx25 / timer.c
index 11d41a8bf9f5b44ec098c18e4b62911f66cc1115..16159ea46e66c8f6e10a6ff114a619ba262fa5c5 100644 (file)
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
 
-static ulong timestamp;
-static ulong lastinc;
+DECLARE_GLOBAL_DATA_PTR;
+
+#define timestamp gd->tbl
+#define lastinc gd->lastinc
 
 /*
  * "time" is measured in 1 / CONFIG_SYS_HZ seconds,
@@ -168,11 +170,6 @@ ulong get_timer (ulong base)
        return get_timer_masked () - base;
 }
 
-void set_timer (ulong t)
-{
-       timestamp = time_to_tick(t);
-}
-
 /* delay x useconds AND preserve advance timstamp value */
 void __udelay (unsigned long usec)
 {
@@ -185,3 +182,15 @@ void __udelay (unsigned long usec)
        while (get_ticks() < tmp)       /* loop till event */
                 /*NOP*/;
 }
+
+/*
+ * This function is derived from PowerPC code (timebase clock frequency).
+ * On ARM it returns the number of timer ticks per second.
+ */
+ulong get_tbclk(void)
+{
+       ulong tbclk;
+
+       tbclk = CONFIG_MX25_CLK32;
+       return tbclk;
+}