lib: time: add weak timer_init() function

If timer_init() is made a weak stub function, then it allows us to
remove several empty timer_init functions for those boards that
already have a timer initialized when u-boot starts. Architectures
that use the timer framework may also remove the need for timer.c.

Signed-off-by: Darwin Rambo <drambo@broadcom.com>
Reviewed-by: Tim Kryger <tim.kryger@linaro.org>
This commit is contained in:
Darwin Rambo
2013-12-19 15:06:12 -08:00
committed by Tom Rini
parent f28bea0003
commit de351d6be6
6 changed files with 5 additions and 31 deletions

View File

@@ -60,6 +60,11 @@ static unsigned long long notrace tick_to_time(uint64_t tick)
return tick;
}
int __weak timer_init(void)
{
return 0;
}
ulong __weak get_timer(ulong base)
{
return tick_to_time(get_ticks()) - base;