]> git.sur5r.net Git - u-boot/blobdiff - arch/arm/cpu/arm926ejs/mx25/timer.c
Timer: Remove reset_timer() for non-Nios2 arches
[u-boot] / arch / arm / cpu / arm926ejs / mx25 / timer.c
index 11d41a8bf9f5b44ec098c18e4b62911f66cc1115..0e479ac17fed049299013146671deaeaba4c49c8 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,
@@ -128,11 +130,6 @@ void reset_timer_masked(void)
        timestamp = 0; /* start "advancing" time stamp from 0 */
 }
 
-void reset_timer(void)
-{
-       reset_timer_masked();
-}
-
 unsigned long long get_ticks (void)
 {
        struct gpt_regs *gpt = (struct gpt_regs *)IMX_GPT1_BASE;
@@ -168,11 +165,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 +177,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;
+}