]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: Move timer_reset_value to arch_global_data
authorSimon Glass <sjg@chromium.org>
Thu, 13 Dec 2012 20:48:36 +0000 (20:48 +0000)
committerTom Rini <trini@ti.com>
Fri, 1 Feb 2013 20:07:50 +0000 (15:07 -0500)
Move this field into arch_global_data and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
arch/arm/cpu/arm926ejs/davinci/timer.c
arch/arm/include/asm/global_data.h

index b620bf7eb1b86a376bb2047bfea7bd8aefea17bb..4142932d08eaa830c56434ba1161dcf43e1ef5d9 100644 (file)
@@ -61,7 +61,7 @@ int timer_init(void)
        writel(TIMER_LOAD_VAL, &timer->prd34);
        writel(2 << 22, &timer->tcr);
        gd->arch.timer_rate_hz = CONFIG_SYS_HZ_CLOCK / TIM_CLK_DIV;
-       gd->timer_reset_value = 0;
+       gd->arch.timer_reset_value = 0;
 
        return(0);
 }
@@ -85,7 +85,7 @@ ulong get_timer(ulong base)
 {
        unsigned long long timer_diff;
 
-       timer_diff = get_ticks() - gd->timer_reset_value;
+       timer_diff = get_ticks() - gd->arch.timer_reset_value;
 
        return lldiv(timer_diff,
                     (gd->arch.timer_rate_hz / CONFIG_SYS_HZ)) - base;
index d7d47430f126311c40e0a2aae042fe017fc9715a..ea27c16d1d07573d7f7a95addfb1fd6fa950887b 100644 (file)
@@ -40,6 +40,7 @@ struct arch_global_data {
        unsigned long tbu;
        unsigned long tbl;
        unsigned long lastinc;
+       unsigned long long timer_reset_value;
 };
 
 /*
@@ -64,10 +65,6 @@ typedef      struct  global_data {
 #ifdef CONFIG_FSL_ESDHC
        unsigned long   sdhc_clk;
 #endif
-#ifdef CONFIG_ARM
-       /* "static data" needed by most of timer.c on ARM platforms */
-       unsigned long long      timer_reset_value;
-#endif
 #ifdef CONFIG_IXP425
        unsigned long   timestamp;
 #endif