]> git.sur5r.net Git - u-boot/blobdiff - cpu/arm920t/imx/interrupts.c
Merge with /home/tur/proj/051_uboot_linux_v38b/u-boot
[u-boot] / cpu / arm920t / imx / interrupts.c
index 12ae2faf28d6d34fb2c93d83305bcfb8a931eb01..03ce06d35abd037ea61b4ab866a002ec082af73e 100644 (file)
@@ -81,10 +81,13 @@ ulong get_timer_masked (void)
 
 void udelay_masked (unsigned long usec)
 {
-       ulong start = get_timer_masked();
+       ulong endtime = get_timer_masked() + usec;
+       signed long diff;
 
-       while (get_timer_masked () - start < usec )
-               /*NOP*/;
+       do {
+               ulong now = get_timer_masked ();
+               diff = endtime - now;
+       } while (diff >= 0);
 }
 
 void udelay (unsigned long usec)
@@ -114,4 +117,23 @@ ulong get_tbclk (void)
        return tbclk;
 }
 
+/*
+ * Reset the cpu by setting up the watchdog timer and let him time out
+ */
+void reset_cpu (ulong ignored)
+{
+       /* Disable watchdog and set Time-Out field to 0 */
+       WCR = 0x00000000;
+
+       /* Write Service Sequence */
+       WSR = 0x00005555;
+       WSR = 0x0000AAAA;
+
+       /* Enable watchdog */
+       WCR = 0x00000001;
+
+       while (1);
+       /*NOTREACHED*/
+}
+
 #endif /* defined (CONFIG_IMX) */