#include <common.h>
-
/* ------------------------------------------------------------------------- */
/*
* 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();
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;
/* 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);
}
/* ------------------------------------------------------------------------- */
-