diff options
author | Marek Vasut <marek.vasut@gmail.com> | 2012-02-07 06:47:31 +0000 |
---|---|---|
committer | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2012-02-27 21:19:23 +0100 |
commit | ff250f3ed89bf9119173e2eade77dfc90d7e9d7d (patch) | |
tree | 513a17a870e99cc4b5d63ce84daecf1c094575a2 /arch | |
parent | 61698fd563bb3747079c079558d590e45d130552 (diff) | |
download | u-boot-imx-ff250f3ed89bf9119173e2eade77dfc90d7e9d7d.zip u-boot-imx-ff250f3ed89bf9119173e2eade77dfc90d7e9d7d.tar.gz u-boot-imx-ff250f3ed89bf9119173e2eade77dfc90d7e9d7d.tar.bz2 |
MX28: Fix get_timer() / get_tbclk() issue
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Detlev Zundel <dzu@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/cpu/arm926ejs/mx28/timer.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/arch/arm/cpu/arm926ejs/mx28/timer.c b/arch/arm/cpu/arm926ejs/mx28/timer.c index dbc904d..5b73f4a 100644 --- a/arch/arm/cpu/arm926ejs/mx28/timer.c +++ b/arch/arm/cpu/arm926ejs/mx28/timer.c @@ -82,7 +82,7 @@ int timer_init(void) return 0; } -ulong get_timer(ulong base) +unsigned long long get_ticks(void) { struct mx28_timrot_regs *timrot_regs = (struct mx28_timrot_regs *)MXS_TIMROT_BASE; @@ -103,7 +103,17 @@ ulong get_timer(ulong base) } lastdec = now; - return tick_to_time(timestamp) - base; + return timestamp; +} + +ulong get_timer_masked(void) +{ + return tick_to_time(get_ticks()); +} + +ulong get_timer(ulong base) +{ + return get_timer_masked() - base; } /* We use the HW_DIGCTL_MICROSECONDS register for sub-millisecond timer. */ @@ -139,3 +149,8 @@ void __udelay(unsigned long usec) old = new; } } + +ulong get_tbclk(void) +{ + return MX28_INCREMENTER_HZ; +} |