arm: Move tbu to arch_global_data

Move this field into arch_global_data and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2012-12-13 20:48:33 +00:00
committed by Tom Rini
parent b339051c0d
commit 8ff43b03e9
8 changed files with 29 additions and 29 deletions

View File

@@ -61,7 +61,7 @@ struct armd1tmr_registers {
#define COUNT_RD_REQ 0x1
DECLARE_GLOBAL_DATA_PTR;
/* Using gd->tbu from timestamp and gd->tbl for lastdec */
/* Using gd->arch.tbu from timestamp and gd->tbl for lastdec */
/* For preventing risk of instability in reading counter value,
* first set read request to register cvwr and then read same
@@ -84,14 +84,14 @@ ulong get_timer_masked(void)
if (now >= gd->tbl) {
/* normal mode */
gd->tbu += now - gd->tbl;
gd->arch.tbu += now - gd->tbl;
} else {
/* we have an overflow ... */
gd->tbu += now + TIMER_LOAD_VAL - gd->tbl;
gd->arch.tbu += now + TIMER_LOAD_VAL - gd->tbl;
}
gd->tbl = now;
return gd->tbu;
return gd->arch.tbu;
}
ulong get_timer(ulong base)
@@ -135,9 +135,9 @@ int timer_init(void)
/* Enable timer 0 */
writel(0x1, &armd1timers->cer);
/* init the gd->tbu and gd->tbl value */
/* init the gd->arch.tbu and gd->tbl value */
gd->tbl = read_timer();
gd->tbu = 0;
gd->arch.tbu = 0;
return 0;
}