]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/arm/cpu/arm926ejs/omap/timer.c
Merge branch 'master' of /home/wd/git/u-boot/custodians
[karo-tx-uboot.git] / arch / arm / cpu / arm926ejs / omap / timer.c
index 2ac38c40b774e9f22a5b69c823873a9439cd4603..88a0ee677eacec1776f29955092a839e7693ac7a 100644 (file)
 /* macro to read the 32 bit timer */
 #define READ_TIMER (*(volatile ulong *)(CONFIG_SYS_TIMERBASE+8))
 
-static ulong timestamp;
-static ulong lastdec;
+DECLARE_GLOBAL_DATA_PTR;
+
+#define timestamp gd->tbl
+#define lastdec gd->lastinc
 
 int timer_init (void)
 {
@@ -79,14 +81,14 @@ void set_timer (ulong t)
        timestamp = t;
 }
 
-/* delay x useconds AND perserve advance timstamp value */
+/* delay x useconds AND preserve advance timestamp value */
 void __udelay (unsigned long usec)
 {
        ulong tmo, tmp;
 
        if(usec >= 1000){               /* if "big" number, spread normalization to seconds */
                tmo = usec / 1000;      /* start to normalize for usec to ticks per sec */
-               tmo *= CONFIG_SYS_HZ;           /* find number of "ticks" to wait to achieve target */
+               tmo *= CONFIG_SYS_HZ;   /* find number of "ticks" to wait to achieve target */
                tmo /= 1000;            /* finish normalize. */
        }else{                          /* else small number, don't kill it prior to HZ multiply */
                tmo = usec * CONFIG_SYS_HZ;