public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Strange macros set HZ value for timer channel zero
@ 2001-08-17 13:23 Richard B. Johnson
  2001-08-17 19:27 ` george anzinger
  0 siblings, 1 reply; 6+ messages in thread
From: Richard B. Johnson @ 2001-08-17 13:23 UTC (permalink / raw)
  To: Linux kernel


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.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-08-20 16:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-08-17 13:23 Strange macros set HZ value for timer channel zero Richard B. Johnson
2001-08-17 19:27 ` george anzinger
2001-08-17 21:13   ` george anzinger
2001-08-20  1:11     ` Richard B. Johnson
2001-08-20 14:22   ` Richard B. Johnson
2001-08-20 16:55     ` george anzinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox