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>
master
Darwin Rambo 11 years ago committed by Tom Rini
parent f28bea0003
commit de351d6be6
  1. 5
      arch/arm/cpu/arm1176/bcm2835/timer.c
  2. 5
      arch/arm/cpu/sa1100/timer.c
  3. 5
      board/armltd/vexpress/vexpress_common.c
  4. 11
      board/nvidia/common/board.c
  5. 5
      board/sandbox/sandbox/sandbox.c
  6. 5
      lib/time.c

@ -18,11 +18,6 @@
#include <asm/io.h>
#include <asm/arch/timer.h>
int timer_init(void)
{
return 0;
}
ulong get_timer_us(ulong base)
{
struct bcm2835_timer_regs *regs =

@ -13,11 +13,6 @@
#include <common.h>
#include <SA-1100.h>
int timer_init (void)
{
return 0;
}
ulong get_timer (ulong base)
{
return get_timer_masked ();

@ -119,11 +119,6 @@ void dram_init_banksize(void)
get_ram_size((long *)PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE);
}
int timer_init(void)
{
return 0;
}
/*
* Start timer:
* Setup a 32 bit timer, running at 1KHz

@ -48,17 +48,6 @@ const struct tegra_sysinfo sysinfo = {
CONFIG_TEGRA_BOARD_STRING
};
#ifndef CONFIG_SPL_BUILD
/*
* Routine: timer_init
* Description: init the timestamp and lastinc value
*/
int timer_init(void)
{
return 0;
}
#endif
void __pin_mux_usb(void)
{
}

@ -23,11 +23,6 @@ unsigned long timer_read_counter(void)
return os_get_nsec() / 1000;
}
int timer_init(void)
{
return 0;
}
int dram_init(void)
{
gd->ram_size = CONFIG_SYS_SDRAM_SIZE;

@ -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;

Loading…
Cancel
Save