diff options
author | Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com> | 2015-04-13 10:57:04 +0530 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2015-04-29 11:19:03 +0200 |
commit | a7858f62d7bff145fe699ea0af7b8f61a2affa8a (patch) | |
tree | 0a62981c13494b0252b4eeab2b634e1fd0d0460e /arch | |
parent | eddabd16625d8de56589564a6b6262423accd9eb (diff) | |
download | u-boot-imx-a7858f62d7bff145fe699ea0af7b8f61a2affa8a.zip u-boot-imx-a7858f62d7bff145fe699ea0af7b8f61a2affa8a.tar.gz u-boot-imx-a7858f62d7bff145fe699ea0af7b8f61a2affa8a.tar.bz2 |
zynq: timer: Fix wrong timer calculation
Fix wrong timer calculation in get_timer_masked incase of
overflow.
This fixes the issue of getting wrong time from get_timer()
calls.
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/cpu/armv7/zynq/timer.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/arm/cpu/armv7/zynq/timer.c b/arch/arm/cpu/armv7/zynq/timer.c index 303dbcf..5ed9642 100644 --- a/arch/arm/cpu/armv7/zynq/timer.c +++ b/arch/arm/cpu/armv7/zynq/timer.c @@ -93,7 +93,9 @@ ulong get_timer_masked(void) gd->arch.tbl += gd->arch.lastinc - now; } else { /* We have an overflow ... */ - gd->arch.tbl += gd->arch.lastinc + TIMER_LOAD_VAL - now + 1; + gd->arch.tbl += gd->arch.lastinc + (TIMER_LOAD_VAL / + (gd->arch.timer_rate_hz / CONFIG_SYS_HZ)) - + now + 1; } gd->arch.lastinc = now; |