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).
{
ulong now;
- now = XScuTimer_GetCounterValue();
+ now = XScuTimer_GetCounterValue() / (TIMER_TICK_HZ/CONFIG_SYS_HZ);
if (lastdec >= now) {
/* normal mode */
void reset_timer_masked(void)
{
/* reset time */
- lastdec = XScuTimer_GetCounterValue();
+ lastdec = XScuTimer_GetCounterValue() / (TIMER_TICK_HZ/CONFIG_SYS_HZ);
timestamp = 0;
}
#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? */