return sys_ticks;
}
-unsigned long get_timer_masked(void)
-{
- return get_ticks();
-}
-
unsigned long get_timer(unsigned long base)
{
- return get_timer_masked() - base;
+ return get_ticks() - base;
}
void __udelay(unsigned long usec)
/*
* timer without interrupts
*/
-ulong get_timer (ulong base)
+static ulong get_timer_masked (void)
{
- return get_timer_masked() - base;
+ return TCN1;
}
-ulong get_timer_masked (void)
+ulong get_timer (ulong base)
{
- return TCN1;
+ return get_timer_masked() - base;
}
void __udelay (unsigned long usec)
return(readl(&armd1timers->cvwr));
}
-ulong get_timer_masked(void)
+static ulong get_timer_masked(void)
{
ulong now = read_timer();
return timestamp;
}
-ulong get_timer_masked(void)
+static ulong get_timer_masked(void)
{
/*
* get_ticks() returns a long long (64 bit), it wraps in
return timestamp;
}
-ulong get_timer_masked(void)
-{
- return tick_to_time(get_ticks());
-}
-
ulong get_timer(ulong base)
{
- return get_timer_masked() - base;
+ return tick_to_time(get_ticks()) - base;
}
/* We use the HW_DIGCTL_MICROSECONDS register for sub-millisecond timer. */
DECLARE_GLOBAL_DATA_PTR;
+static ulong get_timer_masked(void);
+
#define timestamp gd->arch.tbl
#define lastdec gd->arch.lastinc
;
}
-ulong get_timer_masked(void)
+static ulong get_timer_masked(void)
{
ulong now = READ_TIMER();
return now;
}
-unsigned long get_timer_masked(void)
-{
- return tick_to_time(get_ticks());
-}
-
unsigned long get_timer(ulong base)
{
- return get_timer_masked() - base;
+ return tick_to_time(get_ticks()) - base;
}
/* delay x useconds and preserve advance timstamp value */
#define timestamp gd->arch.tbl
#define lastdec gd->arch.lastinc
+static ulong get_timer_masked(void);
+
int timer_init(void)
{
/* Timer1 clock configuration */
;
}
-ulong get_timer_masked(void)
+static ulong get_timer_masked(void)
{
ulong now = READ_TIMER();
}
/* timer without interrupts */
-ulong get_timer(ulong base)
-{
- return get_timer_masked() - base;
-}
-
-ulong get_timer_masked(void)
+static ulong get_timer_masked(void)
{
/* current tick value */
ulong now = TICKS_TO_HZ(read_timer());
return gd->arch.tbl;
}
+ulong get_timer(ulong base)
+{
+ return get_timer_masked() - base;
+}
+
/* delay x useconds */
void __udelay(unsigned long usec)
{
return (((unsigned long long)gd->arch.tbu) << 32) | gd->arch.tbl;
}
-ulong get_timer_masked(void)
-{
- return tick_to_time(get_ticks());
-}
-
ulong get_timer(ulong base)
{
- return get_timer_masked() - base;
+ return tick_to_time(get_ticks()) - base;
}
/* delay x useconds AND preserve advance timstamp value */
#include <common.h>
#include <SA-1100.h>
-ulong get_timer (ulong base)
+static ulong get_timer_masked (void)
{
- return get_timer_masked ();
+ return OSCR;
}
-ulong get_timer_masked (void)
+ulong get_timer (ulong base)
{
- return OSCR;
+ return get_timer_masked ();
}
void __udelay (unsigned long usec)
/* board/.../... */
int board_init(void);
-/* cpu/.../interrupt.c */
-ulong get_timer_masked (void);
-
/* calls to c from vectors.S */
struct pt_regs;
/*
* timer without interrupts
*/
-ulong get_timer(ulong base)
-{
- return get_timer_masked() - base;
-}
-
ulong get_timer_raw(void)
{
at91_tc_t *tc = (at91_tc_t *) ATMEL_BASE_TC;
return gd->arch.tbl;
}
-ulong get_timer_masked(void)
+static ulong get_timer_masked(void)
{
return get_timer_raw()/TIMER_LOAD_VAL;
}
+ulong get_timer(ulong base)
+{
+ return get_timer_masked() - base;
+}
+
void __udelay(unsigned long usec)
{
u32 tmo;
return now;
}
-ulong get_timer_masked(void)
-{
- return tick_to_time(get_ticks());
-}
-
ulong get_timer(ulong base)
{
- return get_timer_masked() - base;
+ return tick_to_time(get_ticks()) - base;
}
void __udelay(unsigned long usec)
DECLARE_GLOBAL_DATA_PTR;
static struct gptimer *timer_base = (struct gptimer *)CONFIG_SYS_TIMERBASE;
+static ulong get_timer_masked(void);
/*
* Nothing really to do with interrupts, just starts up a counter.
}
}
-ulong get_timer_masked(void)
+static ulong get_timer_masked(void)
{
/* current tick value */
ulong now = readl(&timer_base->tcrr) / (TIMER_CLOCK / CONFIG_SYS_HZ);
#define timestamp gd->arch.tbl
#define lastdec gd->arch.lastinc
-ulong get_timer_masked(void)
+static ulong get_timer_masked(void)
{
ulong now = read_timer();
/*
* timer without interrupts
*/
-ulong get_timer (ulong base_ticks)
-{
- return get_timer_masked () - base_ticks;
-}
-
-/* delay usec useconds */
-void __udelay (unsigned long usec)
-{
- ulong tmo, tmp;
-
- /* Convert to U-Boot ticks */
- tmo = usec * CONFIG_SYS_HZ;
- tmo /= (1000000L);
-
- tmp = get_timer_masked(); /* get current timestamp */
- tmo += tmp; /* form target timestamp */
-
- while (get_timer_masked () < tmo) {/* loop till event */
- /*NOP*/;
- }
-}
/* converts the timer reading to U-Boot ticks */
/* the timestamp is the number of ticks since reset */
-ulong get_timer_masked (void)
+static ulong get_timer_masked (void)
{
/* get current count */
unsigned long long now = READ_TIMER;
return timestamp;
}
+ulong get_timer (ulong base_ticks)
+{
+ return get_timer_masked () - base_ticks;
+}
+
+/* delay usec useconds */
+void __udelay (unsigned long usec)
+{
+ ulong tmo, tmp;
+
+ /* Convert to U-Boot ticks */
+ tmo = usec * CONFIG_SYS_HZ;
+ tmo /= (1000000L);
+
+ tmp = get_timer_masked(); /* get current timestamp */
+ tmo += tmp; /* form target timestamp */
+
+ while (get_timer_masked () < tmo) {/* loop till event */
+ /*NOP*/;
+ }
+}
+
/*
* This function is derived from PowerPC code (read timebase as long long).
* On ARM it just returns the timer value.