lib: time: add weak timer_init() function
Subsystems (5)
PATCH 1/1 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 <[email protected]>
Reviewed-by Tim Kryger <[email protected]>
--- arch/arm/cpu/arm1176/bcm2835/timer.c | 5 ----- arch/arm/cpu/sa1100/timer.c | 5 ----- board/armltd/vexpress/vexpress_common.c | 5 ----- board/nvidia/common/board.c | 11 ----------- board/sandbox/sandbox/sandbox.c | 5 ----- lib/time.c | 5 +++++ 6 files changed, 5 insertions(+), 31 deletions(-)
arch/arm/cpu/arm1176/bcm2835/timer.c +0 -5
@@ -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 =
arch/arm/cpu/sa1100/timer.c +0 -5
@@ -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 ();
board/armltd/vexpress/vexpress_common.c +0 -5
@@ -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
board/nvidia/common/board.c +0 -11
@@ -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 ) { }
board/sandbox/sandbox/sandbox.c +0 -5
@@ -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 ;
lib/time.c +5 -0
@@ -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;
Signature · 1 line
1.7.9.5
Quoted 7 lines · Darwin Rambo
If
timer_init()is made a weak stub function, then it allows us to remove several emptytimer_initfunctions for those boards that already have a timer initialized when u-boot starts. Architectures that use the timer framework may also remove the need fortimer.c.Signed-off-by Darwin Rambo <[email protected]>Reviewed-by Tim Kryger <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140127/d64c3899/attachment.pgp>