x86: More accurate PIT frequency estimation (1193182Hz)
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 21 Jul 2008 08:46:17 +0000 (09:46 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 21 Jul 2008 08:46:17 +0000 (09:46 +0100)
In practice this has no impact since variance between crystals will be
substantially greater than 1-2ppm. But we may as well be as accurate
as possible.

From: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/arch/x86/i8259.c
xen/arch/x86/time.c
xen/include/asm-x86/hvm/vpt.h

index 815e9e57f32d54ef0f7c3bdf214a7862ab9f4eb2..525bf1720e635860242949a9fe757bdab514af7d 100644 (file)
@@ -411,7 +411,7 @@ void __init init_IRQ(void)
     apic_intr_init();
 
     /* Set the clock to HZ Hz */
-#define CLOCK_TICK_RATE 1193180 /* crystal freq (Hz) */
+#define CLOCK_TICK_RATE 1193182 /* crystal freq (Hz) */
 #define LATCH (((CLOCK_TICK_RATE)+(HZ/2))/HZ)
     outb_p(0x34, PIT_MODE);        /* binary, mode 2, LSB/MSB, ch 0 */
     outb_p(LATCH & 0xff, PIT_CH0); /* LSB */
index 24df5bcbe4dfbf953af1d067803f349026bb3603..24bd8f8acb83b9846af3ed84c734c633ee50b9f4 100644 (file)
@@ -214,7 +214,7 @@ static struct irqaction irq0 = { timer_interrupt, "timer", NULL };
  * Return processor ticks per second / CALIBRATE_FRAC.
  */
 
-#define CLOCK_TICK_RATE 1193180 /* system crystal frequency (Hz) */
+#define CLOCK_TICK_RATE 1193182 /* system crystal frequency (Hz) */
 #define CALIBRATE_FRAC  20      /* calibrate over 50ms */
 #define CALIBRATE_LATCH ((CLOCK_TICK_RATE+(CALIBRATE_FRAC/2))/CALIBRATE_FRAC)
 
index db58653411a1f8fec0506bf35a615006fa2e93d6..b43f5aea2e8dfd1b20496fced607b7a624eab1a8 100644 (file)
@@ -95,7 +95,7 @@ struct periodic_time {
 };
 
 
-#define PIT_FREQ 1193181
+#define PIT_FREQ 1193182
 #define PIT_BASE 0x40
 
 typedef struct PITState {