diff options
author | Stefano Babic <sbabic@denx.de> | 2013-02-23 10:13:40 +0100 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2013-02-23 10:13:40 +0100 |
commit | 9cd9b34dc7f247fd0fce08ab688bf8197f1bfdbc (patch) | |
tree | 89561497322fff78d3d2e4a8e736f18ab4e0ddfb /arch/arm/cpu/arm926ejs/at91/timer.c | |
parent | bec0160e9f5adab1d451ded3a95b0114b14e1970 (diff) | |
parent | a5627914daad144727655a72bd3c8a8958fbcdcf (diff) |
Merge branch 'master' of git://git.denx.de/u-boot-arm
Diffstat (limited to 'arch/arm/cpu/arm926ejs/at91/timer.c')
-rw-r--r-- | arch/arm/cpu/arm926ejs/at91/timer.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/arm/cpu/arm926ejs/at91/timer.c b/arch/arm/cpu/arm926ejs/at91/timer.c index f70ce83f08..4443fefb64 100644 --- a/arch/arm/cpu/arm926ejs/at91/timer.c +++ b/arch/arm/cpu/arm926ejs/at91/timer.c @@ -52,14 +52,14 @@ DECLARE_GLOBAL_DATA_PTR; static inline unsigned long long tick_to_time(unsigned long long tick) { tick *= CONFIG_SYS_HZ; - do_div(tick, gd->timer_rate_hz); + do_div(tick, gd->arch.timer_rate_hz); return tick; } static inline unsigned long long usec_to_tick(unsigned long long usec) { - usec *= gd->timer_rate_hz; + usec *= gd->arch.timer_rate_hz; do_div(usec, 1000000); return usec; @@ -79,8 +79,8 @@ int timer_init(void) /* Enable PITC */ writel(TIMER_LOAD_VAL | AT91_PIT_MR_EN , &pit->mr); - gd->timer_rate_hz = gd->mck_rate_hz / 16; - gd->tbu = gd->tbl = 0; + gd->arch.timer_rate_hz = gd->arch.mck_rate_hz / 16; + gd->arch.tbu = gd->arch.tbl = 0; return 0; } @@ -95,10 +95,10 @@ unsigned long long get_ticks(void) ulong now = readl(&pit->piir); /* increment tbu if tbl has rolled over */ - if (now < gd->tbl) - gd->tbu++; - gd->tbl = now; - return (((unsigned long long)gd->tbu) << 32) | gd->tbl; + if (now < gd->arch.tbl) + gd->arch.tbu++; + gd->arch.tbl = now; + return (((unsigned long long)gd->arch.tbu) << 32) | gd->arch.tbl; } void __udelay(unsigned long usec) @@ -132,5 +132,5 @@ ulong get_timer(ulong base) */ ulong get_tbclk(void) { - return gd->timer_rate_hz; + return gd->arch.timer_rate_hz; } |