summaryrefslogtreecommitdiffstats
path: root/arch/arm/cpu/arm920t
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2012-12-13 20:48:33 +0000
committerTom Rini <trini@ti.com>2013-02-01 15:07:50 -0500
commit8ff43b03e9f38a6e136e2e20eec4e8b2eb4a1d3d (patch)
tree15e1efcbbead4e7612e8b084f9fcee4f0d5e2bd1 /arch/arm/cpu/arm920t
parentb339051c0d45599c3c874141c52d912d78991dd4 (diff)
downloadtalos-obmc-uboot-8ff43b03e9f38a6e136e2e20eec4e8b2eb4a1d3d.tar.gz
talos-obmc-uboot-8ff43b03e9f38a6e136e2e20eec4e8b2eb4a1d3d.zip
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>
Diffstat (limited to 'arch/arm/cpu/arm920t')
-rw-r--r--arch/arm/cpu/arm920t/a320/timer.c6
-rw-r--r--arch/arm/cpu/arm920t/s3c24x0/timer.c14
2 files changed, 10 insertions, 10 deletions
diff --git a/arch/arm/cpu/arm920t/a320/timer.c b/arch/arm/cpu/arm920t/a320/timer.c
index 287364399c..781533be1e 100644
--- a/arch/arm/cpu/arm920t/a320/timer.c
+++ b/arch/arm/cpu/arm920t/a320/timer.c
@@ -75,7 +75,7 @@ int timer_init(void)
writel(cr, &tmr->cr);
gd->arch.timer_rate_hz = TIMER_CLOCK;
- gd->tbu = gd->tbl = 0;
+ gd->arch.tbu = gd->tbl = 0;
return 0;
}
@@ -90,9 +90,9 @@ unsigned long long get_ticks(void)
/* increment tbu if tbl has rolled over */
if (now < gd->tbl)
- gd->tbu++;
+ gd->arch.tbu++;
gd->tbl = now;
- return (((unsigned long long)gd->tbu) << 32) | gd->tbl;
+ return (((unsigned long long)gd->arch.tbu) << 32) | gd->tbl;
}
void __udelay(unsigned long usec)
diff --git a/arch/arm/cpu/arm920t/s3c24x0/timer.c b/arch/arm/cpu/arm920t/s3c24x0/timer.c
index 7694feac67..e59e614268 100644
--- a/arch/arm/cpu/arm920t/s3c24x0/timer.c
+++ b/arch/arm/cpu/arm920t/s3c24x0/timer.c
@@ -45,17 +45,17 @@ int timer_init(void)
/* use PWM Timer 4 because it has no output */
/* prescaler for Timer 4 is 16 */
writel(0x0f00, &timers->tcfg0);
- if (gd->tbu == 0) {
+ if (gd->arch.tbu == 0) {
/*
* for 10 ms clock period @ PCLK with 4 bit divider = 1/2
* (default) and prescaler = 16. Should be 10390
* @33.25MHz and 15625 @ 50 MHz
*/
- gd->tbu = get_PCLK() / (2 * 16 * 100);
+ gd->arch.tbu = get_PCLK() / (2 * 16 * 100);
gd->arch.timer_rate_hz = get_PCLK() / (2 * 16);
}
/* load value for 10 ms timeout */
- writel(gd->tbu, &timers->tcntb4);
+ writel(gd->arch.tbu, &timers->tcntb4);
/* auto load, manual update of timer 4 */
tmr = (readl(&timers->tcon) & ~0x0700000) | 0x0600000;
writel(tmr, &timers->tcon);
@@ -82,7 +82,7 @@ void __udelay (unsigned long usec)
ulong start = get_ticks();
tmo = usec / 1000;
- tmo *= (gd->tbu * 100);
+ tmo *= (gd->arch.tbu * 100);
tmo /= 1000;
while ((ulong) (get_ticks() - start) < tmo)
@@ -104,10 +104,10 @@ void udelay_masked(unsigned long usec)
if (usec >= 1000) {
tmo = usec / 1000;
- tmo *= (gd->tbu * 100);
+ tmo *= (gd->arch.tbu * 100);
tmo /= 1000;
} else {
- tmo = usec * (gd->tbu * 100);
+ tmo = usec * (gd->arch.tbu * 100);
tmo /= (1000 * 1000);
}
@@ -133,7 +133,7 @@ unsigned long long get_ticks(void)
gd->tbl += gd->lastinc - now;
} else {
/* we have an overflow ... */
- gd->tbl += gd->lastinc + gd->tbu - now;
+ gd->tbl += gd->lastinc + gd->arch.tbu - now;
}
gd->lastinc = now;
OpenPOWER on IntegriCloud