summaryrefslogtreecommitdiff
path: root/arch/arm/cpu/armv7
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2013-11-22 15:29:38 +0100
committerMichal Simek <michal.simek@xilinx.com>2014-02-19 09:41:21 +0100
commit2826fd320cf364077ccc64e645af468adcbe567e (patch)
tree2cc33aad1d27a9e8ea10343a5c5a9911335e8539 /arch/arm/cpu/armv7
parent614c27251196b7567fdb6e98a8b1fe2905367c0c (diff)
downloadu-boot-imx-2826fd320cf364077ccc64e645af468adcbe567e.zip
u-boot-imx-2826fd320cf364077ccc64e645af468adcbe567e.tar.gz
u-boot-imx-2826fd320cf364077ccc64e645af468adcbe567e.tar.bz2
zynq: timer: Fix hangs if network activity attempted after about one hour
Cortex-A9 MPCore TRM' from ARM (ARM DDI 0407G ID072711) describes in the section 4.1.1 how this value calculation should be done. This patch fixes the problem if network activity such as ping or tftp is attempted after u-boot has been idle for an hour, it hangs, and cannot control-C out of it. Signed-off-by: Uday Hegde <udayh@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'arch/arm/cpu/armv7')
-rw-r--r--arch/arm/cpu/armv7/zynq/timer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm/cpu/armv7/zynq/timer.c b/arch/arm/cpu/armv7/zynq/timer.c
index 78e30a6..174e5a1 100644
--- a/arch/arm/cpu/armv7/zynq/timer.c
+++ b/arch/arm/cpu/armv7/zynq/timer.c
@@ -56,7 +56,7 @@ int timer_init(void)
(TIMER_PRESCALE << SCUTIMER_CONTROL_PRESCALER_SHIFT) |
SCUTIMER_CONTROL_ENABLE_MASK;
- gd->arch.timer_rate_hz = (gd->cpu_clk / 2) / TIMER_PRESCALE;
+ gd->arch.timer_rate_hz = (gd->cpu_clk / 2) / (TIMER_PRESCALE + 1);
/* Load the timer counter register */
writel(0xFFFFFFFF, &timer_base->load);
@@ -93,7 +93,7 @@ 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;
+ gd->arch.tbl += gd->arch.lastinc + TIMER_LOAD_VAL - now + 1;
}
gd->arch.lastinc = now;