]> git.sur5r.net Git - u-boot/blobdiff - lib_ppc/time.c
Merge branch 'master' of ../work into next
[u-boot] / lib_ppc / time.c
index 5165abbe35ed2b401fa6f9f516e52b3651bb16b4..29099612db4f4d46d243eed2546a98d997c6597f 100644 (file)
@@ -23,7 +23,6 @@
 
 #include <common.h>
 
-
 /* ------------------------------------------------------------------------- */
 
 /*
@@ -51,15 +50,14 @@ unsigned long usec2ticks(unsigned long usec)
  * microseconds to wait) into a number of time base ticks; then we
  * watch the time base until it has incremented by that amount.
  */
-void udelay(unsigned long usec)
+void __udelay(unsigned long usec)
 {
        ulong ticks = usec2ticks (usec);
-
        wait_ticks (ticks);
 }
 
 /* ------------------------------------------------------------------------- */
-
+#ifndef CONFIG_NAND_SPL
 unsigned long ticks2usec(unsigned long ticks)
 {
        ulong tbclk = get_tbclk();
@@ -75,13 +73,13 @@ unsigned long ticks2usec(unsigned long ticks)
 
        return ((ulong)ticks);
 }
-
+#endif
 /* ------------------------------------------------------------------------- */
 
 int init_timebase (void)
 {
-#ifdef CONFIG_8xx
-       volatile immap_t *immap = (immap_t *) CFG_IMMR;
+#if defined(CONFIG_5xx) || defined(CONFIG_8xx)
+       volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
 
        /* unlock */
        immap->im_sitk.sitk_tbk = KAPWR_KEY;
@@ -90,11 +88,10 @@ int init_timebase (void)
        /* reset */
        asm ("li 3,0 ; mttbu 3 ; mttbl 3 ;");
 
-#ifdef CONFIG_8xx
+#if defined(CONFIG_5xx) || defined(CONFIG_8xx)
        /* enable */
        immap->im_sit.sit_tbscr |= TBSCR_TBE;
 #endif
        return (0);
 }
 /* ------------------------------------------------------------------------- */
-