]> git.sur5r.net Git - u-boot/blobdiff - cpu/arm1136/interrupts.c
ppc4xx: Update AMCC Bamboo README doc/README.bamboo
[u-boot] / cpu / arm1136 / interrupts.c
index e87a628c7f3b6006f8cf808f73143a48c314ea28..1dc36d0344fa123a4a8f9a055a5b6aa71aad25b5 100644 (file)
 
 #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 */
@@ -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 */