diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2007-07-05 18:02:08 +0200 |
---|---|---|
committer | Sascha Hauer <sha@octopus.labnet.pengutronix.de> | 2007-07-05 18:02:08 +0200 |
commit | 7241853f5761472ca7e1bcdac8cf9045efb650d6 (patch) | |
tree | ae704ede048ae73bc5abe8d0c7b18dd682d72b5c /arch/ppc | |
parent | ab85b9e9b3fc7ab565e7f500aac8e2aa72451d75 (diff) | |
download | barebox-7241853f5761472ca7e1bcdac8cf9045efb650d6.tar.gz barebox-7241853f5761472ca7e1bcdac8cf9045efb650d6.tar.xz |
svn_rev_596
remove usec2ticks and ticks2usec
Diffstat (limited to 'arch/ppc')
-rw-r--r-- | arch/ppc/lib/time.c | 41 |
1 files changed, 2 insertions, 39 deletions
diff --git a/arch/ppc/lib/time.c b/arch/ppc/lib/time.c index a66f57ba98..9e73500430 100644 --- a/arch/ppc/lib/time.c +++ b/arch/ppc/lib/time.c @@ -24,44 +24,7 @@ #include <common.h> #include <clock.h> #include <init.h> - -/* ------------------------------------------------------------------------- */ - -/* - * This function is intended for SHORT delays only. - * It will overflow at around 10 seconds @ 400MHz, - * or 20 seconds @ 200MHz. - */ -unsigned long usec2ticks(unsigned long usec) -{ - ulong ticks; - - if (usec < 1000) { - ticks = ((usec * (get_tbclk()/1000)) + 500) / 1000; - } else { - ticks = ((usec / 10) * (get_tbclk() / 100000)); - } - - return (ticks); -} - -/* ------------------------------------------------------------------------- */ - -unsigned long ticks2usec(unsigned long ticks) -{ - ulong tbclk = get_tbclk(); - - /* usec = ticks * 1000000 / tbclk - * Multiplication would overflow at ~4.2e3 ticks, - * so we break it up into - * usec = ( ( ticks * 1000) / tbclk ) * 1000; - */ - ticks *= 1000L; - ticks /= tbclk; - ticks *= 1000L; - - return ((ulong)ticks); -} +#include <asm/arch/clocks.h> /* ------------------------------------------------------------------------- */ @@ -100,7 +63,7 @@ static int clocksource_init (void) { init_timebase(); - cs.mult = clocksource_hz2mult(get_tbclk(), cs.shift); + cs.mult = clocksource_hz2mult(get_timebase_clock(), cs.shift); init_clock(&cs); |