lkml.org 
[lkml]   [2001]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectStrange 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/

\
 
 \ /
  Last update: 2005-03-22 12:57    [W:0.059 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site