]> git.sur5r.net Git - u-boot/blobdiff - arch/arm/cpu/arm926ejs/nomadik/timer.c
nhk8815: fix build errors
[u-boot] / arch / arm / cpu / arm926ejs / nomadik / timer.c
index 1d98ef3eb3d0ac30121fc6f7ebdfd8a080001ded..bc2e4d506d0dcfa5cc45e40c14d6e7b2a1b9a067 100644 (file)
 /* Configure a free-running, auto-wrap counter with no prescaler */
 int timer_init(void)
 {
+       ulong val;
+
        writel(MTU_CRn_ENA | MTU_CRn_PRESCALE_1 | MTU_CRn_32BITS,
               CONFIG_SYS_TIMERBASE + MTU_CR(0));
-       reset_timer();
-       return 0;
-}
 
-/* Restart counting from 0 */
-void reset_timer(void)
-{
-       ulong val;
+       /* Reset the timer */
        writel(0, CONFIG_SYS_TIMERBASE + MTU_LR(0));
        /*
         * The load-register isn't really immediate: it changes on clock
@@ -59,6 +55,8 @@ void reset_timer(void)
        val = READ_TIMER();
        while (READ_TIMER() == val)
                ;
+
+       return 0;
 }
 
 /* Return how many HZ passed since "base" */
@@ -77,3 +75,13 @@ void __udelay(unsigned long usec)
        while ((signed)(end - READ_TIMER()) > 0)
                ;
 }
+
+unsigned long long get_ticks(void)
+{
+       return get_timer(0);
+}
+
+ulong get_tbclk(void)
+{
+       return CONFIG_SYS_HZ;
+}