#include <common.h>
#include <asm/arch/bits.h>
-#include <asm/arch/omap2420.h>
+
+#if !defined(CONFIG_INTEGRATOR) && ! defined(CONFIG_ARCH_CINTEGRATOR)
+# include <asm/arch/omap2420.h>
+#endif
+
#include <asm/proc-armv/ptrace.h>
-extern void reset_cpu(ulong addr);
#define TIMER_LOAD_VAL 0
/* macro to read the 32 bit timer */
bad_mode ();
}
+#if defined(CONFIG_INTEGRATOR) && defined(CONFIG_ARCH_CINTEGRATOR)
+/* Use the IntegratorCP function from board/integratorcp.c */
+#else
+
static ulong timestamp;
static ulong lastinc;
return(0);
}
-
/*
* timer without interrupts
*/
void udelay_masked (unsigned long usec)
{
ulong tmo;
+ ulong endtime;
+ signed long diff;
if (usec >= 1000) { /* if "big" number, spread normalization to seconds */
tmo = usec / 1000; /* start to normalize for usec to ticks per sec */
tmo = usec * CFG_HZ;
tmo /= (1000*1000);
}
- reset_timer_masked (); /* set "advancing" timestamp to 0, set lastinc vaule */
- while (get_timer_masked () < tmo) /* wait for time stamp to overtake tick number.*/
- /* NOP */;
+ endtime = get_timer_masked () + tmo;
+
+ do {
+ ulong now = get_timer_masked ();
+ diff = endtime - now;
+ } while (diff >= 0);
}
/*
{
return get_timer(0);
}
-
/*
* This function is derived from PowerPC code (timebase clock frequency).
* On ARM it returns the number of timer ticks per second.
tbclk = CFG_HZ;
return tbclk;
}
+#endif /* !Integrator/CP */