From 27ef291ea2a8783bfc55953145abe2fc6e5af8e9 Mon Sep 17 00:00:00 2001 From: Brian Hill Date: Tue, 24 May 2011 13:00:37 -0600 Subject: [PATCH] Xilinx: ARM: Adjust CONFIG_SYS_HZ to 1000. Adjust CONFIG_SYS_HZ to 1000. Parts of the networking code assume that the clock tick is natively expressed in milliseconds (and don't adjust the values by using CONFIG_SYS_HZ). --- arch/arm/cpu/armv7/pele/timer.c | 4 ++-- include/configs/xpele.h | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/arm/cpu/armv7/pele/timer.c b/arch/arm/cpu/armv7/pele/timer.c index 2caf628db67..1884448a835 100644 --- a/arch/arm/cpu/armv7/pele/timer.c +++ b/arch/arm/cpu/armv7/pele/timer.c @@ -107,7 +107,7 @@ unsigned long long get_ticks(void) { ulong now; - now = XScuTimer_GetCounterValue(); + now = XScuTimer_GetCounterValue() / (TIMER_TICK_HZ/CONFIG_SYS_HZ); if (lastdec >= now) { /* normal mode */ @@ -133,7 +133,7 @@ ulong get_tbclk(void) void reset_timer_masked(void) { /* reset time */ - lastdec = XScuTimer_GetCounterValue(); + lastdec = XScuTimer_GetCounterValue() / (TIMER_TICK_HZ/CONFIG_SYS_HZ); timestamp = 0; } diff --git a/include/configs/xpele.h b/include/configs/xpele.h index f19e21e471e..4de9b904733 100644 --- a/include/configs/xpele.h +++ b/include/configs/xpele.h @@ -140,9 +140,10 @@ #define CONFIG_TTC0 1 #define CONFIG_GEM0 1 -#define TIMER_CLOCK 5000000 +#define TIMER_INPUT_CLOCK 5000000 #define CONFIG_TIMER_PRESCALE 255 -#define CONFIG_SYS_HZ (TIMER_CLOCK / CONFIG_TIMER_PRESCALE) +#define TIMER_TICK_HZ (TIMER_INPUT_CLOCK / CONFIG_TIMER_PRESCALE) +#define CONFIG_SYS_HZ 1000 /* And here... */ #define CONFIG_SYS_LOAD_ADDR 0 /* default? */ -- 2.47.3