Skip to contentSkip to conversation

x86: Add quick TSC calibration via PIT

PATCH New Bin Meng 2 participants 2 messages Nov 9, 2014 – Nov 10, 2014 x86

lore
Share & tools
lore

Bin Meng

author
#0 lore raw

PATCH v2 3/4 x86: Add quick TSC calibration via PIT

Use the same way that Linux does for quick TSC calibration via PIT when calibration via MSR fails.

---
 arch/x86/include/asm/i8254.h |   3 +
 arch/x86/lib/tsc_timer.c     | 155 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 158 insertions(+)
arch/x86/include/asm/i8254.h +3 -0
index c3ccd4f..4116de1 100644
@@ -36,4 +36,7 @@
 #define PIT_CMD_MODE4	0x08		/* Select mode 4 */
 #define PIT_CMD_MODE5	0x0A		/* Select mode 5 */
 
+/* The clock frequency of the i8253/i8254 PIT */
+#define PIT_TICK_RATE	1193182ul
+
 #endif
arch/x86/lib/tsc_timer.c +155 -0

167 lines not on this page · raw message

Signature · 1 line
1.8.2.1