]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
Xilinx: ARM: Adjust CONFIG_SYS_HZ to 1000.
authorBrian Hill <brian.hill@xilinx.com>
Tue, 24 May 2011 19:00:37 +0000 (13:00 -0600)
committerBrian Hill <brian.hill@xilinx.com>
Tue, 24 May 2011 19:00:37 +0000 (13:00 -0600)
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
include/configs/xpele.h

index 2caf628db67991751bcf2dac477dc792a6236540..1884448a8356c2ed750840a9dc2f4819291ed8e7 100644 (file)
@@ -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;
 }
 
index f19e21e471edeb237e3375495e948e2309aaad38..4de9b9047339f1241271995ec0c428f298379c64 100644 (file)
 #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? */