]>
git.ipfire.org Git - people/ms/u-boot.git/blob - arch/sparc/lib/time.c
2 * (C) Copyright 2000, 2001
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
6 * Daniel Hellstrom, Gaisler Research, daniel@gaisler.com.
8 * SPDX-License-Identifier: GPL-2.0+
13 /* Implemented by SPARC CPUs */
14 extern void cpu_wait_ticks(unsigned long ticks
);
15 extern unsigned long cpu_usec2ticks(unsigned long usec
);
16 extern unsigned long cpu_ticks2usec(unsigned long ticks
);
18 /* ------------------------------------------------------------------------- */
20 void wait_ticks(unsigned long ticks
)
22 cpu_wait_ticks(ticks
);
26 * This function is intended for SHORT delays only.
28 unsigned long usec2ticks(unsigned long usec
)
30 return cpu_usec2ticks(usec
);
33 /* ------------------------------------------------------------------------- */
36 * We implement the delay by converting the delay (the number of
37 * microseconds to wait) into a number of time base ticks; then we
38 * watch the time base until it has incremented by that amount.
40 void __udelay(unsigned long usec
)
42 ulong ticks
= usec2ticks(usec
);
47 /* ------------------------------------------------------------------------- */
49 unsigned long ticks2usec(unsigned long ticks
)
51 return cpu_ticks2usec(ticks
);
54 /* ------------------------------------------------------------------------- */
56 int init_timebase(void)
62 /* ------------------------------------------------------------------------- */