]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
lib: time: add weak timer_init() function
authorDarwin Rambo <drambo@broadcom.com>
Thu, 19 Dec 2013 23:06:12 +0000 (15:06 -0800)
committerTom Rini <trini@ti.com>
Fri, 24 Jan 2014 21:59:06 +0000 (16:59 -0500)
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>
arch/arm/cpu/arm1176/bcm2835/timer.c
arch/arm/cpu/sa1100/timer.c
board/armltd/vexpress/vexpress_common.c
board/nvidia/common/board.c
board/sandbox/sandbox/sandbox.c
lib/time.c

index 2edd6711da5711ed88d46f6a8c7323b01e84d2d5..017907cfb8d98edf794af63c4366d3f2a93bd079 100644 (file)
 #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 =
index 4b981e46e7d95ef37866f30be577e68f74df60e0..0a0006b426323d4162ea73900137cad3541051c2 100644 (file)
 #include <common.h>
 #include <SA-1100.h>
 
-int timer_init (void)
-{
-       return 0;
-}
-
 ulong get_timer (ulong base)
 {
        return get_timer_masked ();
index da5cb0152b7e0149168ea36726dcf4cc91fd2f0f..cb2de2f4ddc954f884612430e1edeb9396046d00 100644 (file)
@@ -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
index 1972527e7d11958239d6e36f55b9a25c301ea4cc..e650feda481b924d80995739dbcfa56b78b44b14 100644 (file)
@@ -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)
 {
 }
index 65dcce804bb6adc9d41ada2548152fabf4d0fa03..95efaffcb1f87ccded807d6ee383d526d9f4553d 100644 (file)
@@ -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;
index 8085aa40d1c96de75c4af0fcf74e2a8b917458c6..73c3b6ad7ff4503c3b485dbdab091601575e3a12 100644 (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;