Messages in this thread | | | Date | Fri, 17 Aug 2001 09:23:29 -0400 (EDT) | From | "Richard B. Johnson" <> | Subject | Strange macros set HZ value for timer channel zero |
| |
To whomever maintains the timer code, greetings.
When using Linux on the AMD SC520 chip, the system time will not be correct because the PIT clock is 1.1882 MHz instead of the usual 1.19318 MHz. Therefore, I put a conditional value in ../linux/include/asm/timex.h .
#ifndef _ASMi386_TIMEX_H #define _ASMi386_TIMEX_H
#include <linux/config.h> #include <asm/msr.h> #ifdef SC520 #define CLOCK_TICK_RATE 1188200 /* Underlying HZ */ #else #define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ #endif
Something is wrong! I now gain 3 hours in a 12 hour period. There are some calculations performed somewhere that result in the wrong divisor for the timer (PIT). I don't understand any of the SHIFT stuff, nor FINE_TUNE stuff. It all seems bogus although it might be the "new math" that's biting me.
The correct value for 100 Hz should be 1188200/100 = 11882 = 0x2e6a for the divisor. If I hard-code the value as a divisor in /usr/src/linux/arch/i386/kernel/i8259.c, it works. If I use the #defines and macros in the headers, it doesn't.
Cheers, Dick Johnson
Penguin : Linux version 2.4.1 on an i686 machine (799.53 BogoMips).
I was going to compile a list of innovations that could be attributed to Microsoft. Once I realized that Ctrl-Alt-Del was handled in the BIOS, I found that there aren't any.
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |