X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=cpu%2Farm1136%2Finterrupts.c;h=1dc36d0344fa123a4a8f9a055a5b6aa71aad25b5;hb=537223afa61f64480df31ce440a9cb386df4a814;hp=e87a628c7f3b6006f8cf808f73143a48c314ea28;hpb=082acfd4849d2f0471b0709fe7f5ce1de387437d;p=u-boot diff --git a/cpu/arm1136/interrupts.c b/cpu/arm1136/interrupts.c index e87a628c7f..1dc36d0344 100644 --- a/cpu/arm1136/interrupts.c +++ b/cpu/arm1136/interrupts.c @@ -32,10 +32,13 @@ #include #include -#include + +#if !defined(CONFIG_INTEGRATOR) && ! defined(CONFIG_ARCH_CINTEGRATOR) +# include +#endif + #include -extern void reset_cpu(ulong addr); #define TIMER_LOAD_VAL 0 /* macro to read the 32 bit timer */ @@ -173,6 +176,10 @@ void do_irq (struct pt_regs *pt_regs) 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; @@ -190,7 +197,6 @@ int interrupt_init (void) return(0); } - /* * timer without interrupts */ @@ -255,6 +261,8 @@ ulong get_timer_masked (void) 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 */ @@ -264,9 +272,12 @@ void udelay_masked (unsigned long usec) 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); } /* @@ -277,7 +288,6 @@ unsigned long long get_ticks(void) { 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. @@ -288,3 +298,4 @@ ulong get_tbclk (void) tbclk = CFG_HZ; return tbclk; } +#endif /* !Integrator/CP */