}
/* delay usec useconds */
-void udelay (unsigned long usec)
+void __udelay (unsigned long usec)
{
ulong tmo, tmp;
* Erratum DDR3 requires a 50ms delay after clearing DDRCDR[DDR_cfg],
* or the DDR2 controller may fail to initialize correctly.
*/
- udelay(50000);
+ __udelay(50000);
im->ddr.csbnds[0].csbnds = (msize - 1) >> 24;
im->ddr.cs_config[0] = CONFIG_SYS_DDR_CONFIG;
}
/* delay x useconds AND perserve advance timstamp value */
-void udelay (unsigned long usec)
+void __udelay (unsigned long usec)
{
unsigned long long tmp;
ulong tmo;
}
/* delay x useconds AND perserve advance timstamp value */
-void udelay (unsigned long usec)
+void __udelay (unsigned long usec)
{
ulong tmo, tmp;
timestamp = t * (timer_load_val / (100 * CONFIG_SYS_HZ));
}
-void udelay(unsigned long usec)
+void __udelay(unsigned long usec)
{
unsigned long long tmp;
ulong tmo;
timestamp = t;
}
-void udelay (unsigned long usec)
+void __udelay (unsigned long usec)
{
ulong tmo;
return timestamp - base;
}
-void udelay (unsigned long usec)
+void __udelay (unsigned long usec)
{
u32 ticks;
timestamp = t;
}
-void udelay (unsigned long usec)
+void __udelay (unsigned long usec)
{
udelay_masked(usec);
}
} while (diff >= 0);
}
-void udelay (unsigned long usec)
+void __udelay (unsigned long usec)
{
udelay_masked(usec);
}
timer_ticks = t;
}
-void udelay(ulong usec)
+void __udelay(ulong usec)
{
ulong start = get_timer_masked();
ulong end;
timestamp = t;
}
-void udelay(unsigned long usec)
+void __udelay (unsigned long usec)
{
ulong tmo;
ulong start = get_ticks();
}
/* delay x useconds AND preserve advance timestamp value */
-void udelay (unsigned long usec)
+void __udelay (unsigned long usec)
{
int32_t tmo = usec * (TIMER_CLOCK / 1000) / 1000;
uint32_t now, last = __raw_readl(CONFIG_SYS_TIMERBASE + READ_TIM);
return tick_to_time(get_ticks());
}
-void udelay(unsigned long usec)
+void __udelay(unsigned long usec)
{
unsigned long long tmp;
ulong tmo;
timestamp = t;
}
-void udelay(unsigned long usec)
+void __udelay(unsigned long usec)
{
ulong tmo;
ulong endtime;
timestamp = t;
}
-void udelay(unsigned long usec)
+void __udelay(unsigned long usec)
{
uint current;
ulong delayticks;
}
/* delay x useconds AND preserve advance timstamp value */
-void udelay (unsigned long usec)
+void __udelay (unsigned long usec)
{
unsigned long long tmp;
ulong tmo;
}
/* Delay x useconds */
-void udelay(unsigned long usec)
+void __udelay(unsigned long usec)
{
ulong ini, end;
}
/* delay x useconds AND perserve advance timstamp value */
-void udelay (unsigned long usec)
+void __udelay (unsigned long usec)
{
ulong tmo, tmp;
}
/* delay x useconds AND perserve advance timstamp value */
-void udelay (unsigned long usec)
+void __udelay (unsigned long usec)
{
ulong tmo, tmp;
}
/* delay x useconds */
-void udelay(unsigned long usec)
+void __udelay(unsigned long usec)
{
long tmo = usec * (TIMER_CLOCK / 1000) / 1000;
unsigned long now, last = readl(&timer_base->tcrr);
}
/* delay x useconds */
-void udelay(unsigned long usec)
+void __udelay(unsigned long usec)
{
unsigned long tmo, tmp;
/*
* For short delays only. It will overflow after a few seconds.
*/
-void udelay(unsigned long usec)
+void __udelay(unsigned long usec)
{
unsigned long cycles;
unsigned long base;
return 1;
}
-void udelay(unsigned long usec)
+void __udelay(unsigned long usec)
{
unsigned long delay, start, stop;
unsigned long cclk;
return 0;
}
-void udelay(unsigned long usec)
+void __udelay(unsigned long usec)
{
int m = 0;
long u;
/*
* 0 <= r0 <= 2000
*/
-.globl udelay
-udelay:
+.globl __udelay
+__udelay:
mov r2, #0x6800
orr r2, r2, #0x00db
mul r0, r2, r0
while (!(*IXP425_OSST & IXP425_OSST_TIMER_1_PEND));
}
-void udelay (unsigned long usec)
+void __udelay (unsigned long usec)
{
while (usec--) ixp425_udelay(1);
}
timestamp = t;
}
-void udelay (unsigned long usec)
+void __udelay (unsigned long usec)
{
ulong tmo,tmp;
#endif
extern void dtimer_intr_setup(void);
-void udelay(unsigned long usec)
+void __udelay(unsigned long usec)
{
volatile slt_t *timerp = (slt_t *) (CONFIG_SYS_UDELAY_BASE);
u32 now, freq;
/* nop */
}
-void udelay (unsigned long usec)
+void __udelay (unsigned long usec)
{
udelay_masked (usec);
}
timestamp = t;
}
-void udelay (unsigned long usec)
+void __udelay (unsigned long usec)
{
ulong tmo;
/* nop */
}
-void udelay (unsigned long usec)
+void __udelay (unsigned long usec)
{
udelay_masked (usec);
}
EXT_COBJ_FILES-$(CONFIG_API) += lib_generic/ctype.o
EXT_COBJ_FILES-$(CONFIG_API) += lib_generic/div64.o
EXT_COBJ_FILES-$(CONFIG_API) += lib_generic/string.o
+EXT_COBJ_FILES-$(CONFIG_API) += lib_generic/time.o
EXT_COBJ_FILES-$(CONFIG_API) += lib_generic/vsprintf.o
ifeq ($(ARCH),ppc)
EXT_SOBJ_FILES-$(CONFIG_API) += lib_ppc/ppcstring.o
ub_putc(c);
}
-void udelay(unsigned long usec)
+void __udelay(unsigned long usec)
{
ub_udelay(usec);
}
* first constant multiplications gets optimized away if the delay is
* a constant)
*/
-extern __inline__ void udelay(unsigned long usecs)
+extern __inline__ void __udelay(unsigned long usecs)
{
__delay(usecs);
}
void wait_ticks (unsigned long);
/* lib_$(ARCH)/time.c */
-void udelay (unsigned long);
+void __udelay (unsigned long);
ulong usec2ticks (unsigned long usec);
ulong ticks2usec (unsigned long ticks);
int init_timebase (void);
+/* lib_generic/time.c */
+void udelay (unsigned long);
+
/* lib_generic/vsprintf.c */
ulong simple_strtoul(const char *cp,char **endp,unsigned int base);
#ifdef CONFIG_SYS_64BIT_VSPRINTF
void free_hdlr(int);
void *malloc(size_t);
void free(void*);
-void udelay(unsigned long);
+void __udelay(unsigned long);
unsigned long get_timer(unsigned long);
void vprintf(const char *, va_list);
void do_reset (void);
COBJS-$(CONFIG_SHA256) += sha256.o
COBJS-y += string.o
COBJS-y += strmhz.o
+COBJS-y += time.o
COBJS-y += vsprintf.o
COBJS-y += zlib.o
COBJS-$(CONFIG_RBTREE) += rbtree.o
--- /dev/null
+/*
+ * (C) Copyright 2000-2009
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <watchdog.h>
+
+#ifndef CONFIG_WD_PERIOD
+# define CONFIG_WD_PERIOD (10 * 1000 * 1000) /* 10 seconds default*/
+#endif
+
+/* ------------------------------------------------------------------------- */
+
+void udelay(unsigned long usec)
+{
+ ulong kv;
+
+ do {
+ WATCHDOG_RESET();
+ kv = usec > CONFIG_WD_PERIOD ? CONFIG_WD_PERIOD : usec;
+ __udelay (kv);
+ usec -= kv;
+ } while(usec);
+}
}
/* this is not very exact */
-void udelay (unsigned long usec)
+void __udelay (unsigned long usec)
{
int counter;
int wraps;
#endif
extern void dtimer_intr_setup(void);
-void udelay(unsigned long usec)
+void __udelay(unsigned long usec)
{
volatile dtmr_t *timerp = (dtmr_t *) (CONFIG_SYS_UDELAY_BASE);
uint start, now, tmp;
static unsigned short lastinc;
-void udelay(unsigned long usec)
+void __udelay(unsigned long usec)
{
volatile pit_t *timerp = (pit_t *) (CONFIG_SYS_UDELAY_BASE);
uint tmp;
#include <common.h>
#ifdef CONFIG_SYS_TIMER_0
-void udelay (unsigned long usec)
+void __udelay (unsigned long usec)
{
int i;
i = get_timer (0);
while ((get_timer (0) - i) < (usec / 1000)) ;
}
#else
-void udelay (unsigned long usec)
+void __udelay (unsigned long usec)
{
unsigned int i;
for (i = 0; i < (usec * CONFIG_XILINX_CLOCK_FREQ / 10000000); i++);
write_c0_compare(read_c0_count() + CYCLES_PER_JIFFY);
}
-void udelay(unsigned long usec)
+void __udelay(unsigned long usec)
{
unsigned int tmo;
extern void dly_clks( unsigned long ticks );
-void udelay(unsigned long usec)
+void __udelay(unsigned long usec)
{
/* The Nios core doesn't have a timebase, so we do our
* best for now and call a low-level loop that counts
* cpu clocks.
*/
unsigned long cnt = (CONFIG_SYS_CLK_FREQ/1000000) * usec;
- WATCHDOG_RESET (); /* trigger watchdog if needed */
dly_clks (cnt);
}
extern void dly_clks( unsigned long ticks );
-void udelay(unsigned long usec)
+void __udelay(unsigned long usec)
{
/* The Nios core doesn't have a timebase, so we do our
* best for now and call a low-level loop that counts
* cpu clocks.
*/
unsigned long cnt = (CONFIG_SYS_CLK_FREQ/1000000) * usec;
- WATCHDOG_RESET (); /* trigger watchdog if needed */
dly_clks (cnt);
}
#include <common.h>
-#ifndef CONFIG_WD_PERIOD
-# define CONFIG_WD_PERIOD (10 * 1000 * 1000) /* 10 seconds default*/
-#endif
-
/* ------------------------------------------------------------------------- */
/*
* 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, kv;
-
- do {
- kv = usec > CONFIG_WD_PERIOD ? CONFIG_WD_PERIOD : usec;
- ticks = usec2ticks (kv);
- wait_ticks (ticks);
- usec -= kv;
- } while(usec);
+ ulong ticks = usec2ticks (usec);
+ wait_ticks (ticks);
}
/* ------------------------------------------------------------------------- */
return 0 - readl(TCNT0);
}
-void udelay (unsigned long usec)
+void __udelay (unsigned long usec)
{
unsigned long long tmp;
ulong tmo;
cmt_timer_start(0);
}
-void udelay(unsigned long usec)
+void __udelay(unsigned long usec)
{
unsigned long end = get_usec() + 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);