diff options
author | Simon Glass <sjg@chromium.org> | 2012-12-13 20:48:35 +0000 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2013-02-01 15:07:50 -0500 |
commit | 582601da2f90b1850aa19f7820b1623c79b3dac6 (patch) | |
tree | 9ed77bb4cd2a7a9fcd12d6edc18ed71e06ffe1a9 /arch/arm/cpu/arm1136 | |
parent | 66ee69234795c0596f84b25f06b7fbc2e8ed214c (diff) | |
download | u-boot-imx-582601da2f90b1850aa19f7820b1623c79b3dac6.zip u-boot-imx-582601da2f90b1850aa19f7820b1623c79b3dac6.tar.gz u-boot-imx-582601da2f90b1850aa19f7820b1623c79b3dac6.tar.bz2 |
arm: Move lastinc to arch_global_data
Move this field into arch_global_data and tidy up.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/arm/cpu/arm1136')
-rw-r--r-- | arch/arm/cpu/arm1136/mx31/timer.c | 8 | ||||
-rw-r--r-- | arch/arm/cpu/arm1136/mx35/timer.c | 2 | ||||
-rw-r--r-- | arch/arm/cpu/arm1136/omap24xx/timer.c | 12 |
3 files changed, 11 insertions, 11 deletions
diff --git a/arch/arm/cpu/arm1136/mx31/timer.c b/arch/arm/cpu/arm1136/mx31/timer.c index 790bab4..b006b60 100644 --- a/arch/arm/cpu/arm1136/mx31/timer.c +++ b/arch/arm/cpu/arm1136/mx31/timer.c @@ -115,12 +115,12 @@ unsigned long long get_ticks(void) { ulong now = GPTCNT; /* current tick value */ - if (now >= gd->lastinc) /* normal mode (non roll) */ + if (now >= gd->arch.lastinc) /* normal mode (non roll) */ /* move stamp forward with absolut diff ticks */ - gd->arch.tbl += (now - gd->lastinc); + gd->arch.tbl += (now - gd->arch.lastinc); else /* we have rollover of incrementer */ - gd->arch.tbl += (0xFFFFFFFF - gd->lastinc) + now; - gd->lastinc = now; + gd->arch.tbl += (0xFFFFFFFF - gd->arch.lastinc) + now; + gd->arch.lastinc = now; return gd->arch.tbl; } diff --git a/arch/arm/cpu/arm1136/mx35/timer.c b/arch/arm/cpu/arm1136/mx35/timer.c index c21ca3f..584ad15 100644 --- a/arch/arm/cpu/arm1136/mx35/timer.c +++ b/arch/arm/cpu/arm1136/mx35/timer.c @@ -33,7 +33,7 @@ DECLARE_GLOBAL_DATA_PTR; #define timestamp (gd->arch.tbl) -#define lastinc (gd->lastinc) +#define lastinc (gd->arch.lastinc) /* General purpose timers bitfields */ #define GPTCR_SWR (1<<15) /* Software reset */ diff --git a/arch/arm/cpu/arm1136/omap24xx/timer.c b/arch/arm/cpu/arm1136/omap24xx/timer.c index e179bb5..53015cb 100644 --- a/arch/arm/cpu/arm1136/omap24xx/timer.c +++ b/arch/arm/cpu/arm1136/omap24xx/timer.c @@ -51,7 +51,7 @@ int timer_init (void) *((int32_t *) (CONFIG_SYS_TIMERBASE + TCLR)) = val; /* start timer */ /* reset time */ - gd->lastinc = READ_TIMER; /* capture current incrementer value */ + gd->arch.lastinc = READ_TIMER; /* capture current incrementer value */ gd->arch.tbl = 0; /* start "advancing" time stamp */ return(0); @@ -81,7 +81,7 @@ void __udelay (unsigned long usec) tmp = get_timer (0); /* get current timestamp */ if ((tmo + tmp + 1) < tmp) { /* if setting this forward will roll */ /* time stamp, then reset time */ - gd->lastinc = READ_TIMER; /* capture incrementer value */ + gd->arch.lastinc = READ_TIMER; /* capture incrementer value */ gd->arch.tbl = 0; /* start time stamp */ } else { tmo += tmp; /* else, set advancing stamp wake up time */ @@ -94,14 +94,14 @@ ulong get_timer_masked (void) { ulong now = READ_TIMER; /* current tick value */ - if (now >= gd->lastinc) { /* normal mode (non roll) */ + if (now >= gd->arch.lastinc) { /* normal mode (non roll) */ /* move stamp fordward with absoulte diff ticks */ - gd->arch.tbl += (now - gd->lastinc); + gd->arch.tbl += (now - gd->arch.lastinc); } else { /* we have rollover of incrementer */ - gd->arch.tbl += (0xFFFFFFFF - gd->lastinc) + now; + gd->arch.tbl += (0xFFFFFFFF - gd->arch.lastinc) + now; } - gd->lastinc = now; + gd->arch.lastinc = now; return gd->arch.tbl; } |