]> git.sur5r.net Git - u-boot/blobdiff - lib_m68k/time.c
Merge branch 'i2c'
[u-boot] / lib_m68k / time.c
index e2c1b060b48c281278bac58f1f6962bf82d9d7c1..d45e470aeb97554bdc48ee9e53c96a58f3695ef1 100644 (file)
 
 #include <asm/mcftimer.h>
 
+#ifdef CONFIG_M5271
+#include <asm/m5271.h>
+#include <asm/immap_5271.h>
+#endif
+
 #ifdef CONFIG_M5272
 #include <asm/m5272.h>
 #include <asm/immap_5272.h>
@@ -43,7 +48,7 @@
 
 
 static ulong timestamp;
-#ifdef CONFIG_M5282
+#if defined(CONFIG_M5282) || defined(CONFIG_M5271)
 static unsigned short lastinc;
 #endif
 
@@ -127,7 +132,7 @@ void set_timer (ulong t)
 }
 #endif
 
-#if defined(CONFIG_M5282)
+#if defined(CONFIG_M5282) || defined(CONFIG_M5271)
 
 void udelay(unsigned long usec)
 {
@@ -135,7 +140,7 @@ void udelay(unsigned long usec)
        uint tmp;
 
        timerp = (volatile unsigned short *) (CFG_MBAR + MCFTIMER_BASE3);
-       
+
        while (usec > 0) {
                if (usec > 65000)
                        tmp = 65000;
@@ -150,7 +155,7 @@ void udelay(unsigned long usec)
                timerp[MCFTIMER_PCSR] =
                        (5 << 8) | MCFTIMER_PCSR_EN | MCFTIMER_PCSR_OVW;
 
-                timerp[MCFTIMER_PMR] = tmp;
+               timerp[MCFTIMER_PMR] = tmp;
                while (timerp[MCFTIMER_PCNTR] > 0);
        }
 }