Skip to content

Commit 655e52d

Browse files
praritKAGA-KOKO
authored andcommitted
x86/tsc: Use cpu id defines instead of hex constants
asm/intel-family.h contains defines for cpu ids which should be used instead of hex constants. Convert the switch case in native_calibrate_tsc() to use the defines before adding more cpu models. [ tglx: Massaged changelog ] Signed-off-by: Prarit Bhargava <[email protected]> Cc: Len Brown <[email protected]> Cc: Rafael Aquini <[email protected]> Cc: "Peter Zijlstra (Intel)" <[email protected]> Cc: Andy Lutomirski <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
1 parent f99fd22 commit 655e52d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

arch/x86/kernel/tsc.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <asm/x86_init.h>
2424
#include <asm/geode.h>
2525
#include <asm/apic.h>
26+
#include <asm/intel-family.h>
2627

2728
unsigned int __read_mostly cpu_khz; /* TSC clocks / usec, not used here */
2829
EXPORT_SYMBOL(cpu_khz);
@@ -686,11 +687,11 @@ unsigned long native_calibrate_tsc(void)
686687

687688
if (crystal_khz == 0) {
688689
switch (boot_cpu_data.x86_model) {
689-
case 0x4E: /* SKL */
690-
case 0x5E: /* SKL */
690+
case INTEL_FAM6_SKYLAKE_MOBILE:
691+
case INTEL_FAM6_SKYLAKE_DESKTOP:
691692
crystal_khz = 24000; /* 24.0 MHz */
692693
break;
693-
case 0x5C: /* BXT */
694+
case INTEL_FAM6_ATOM_GOLDMONT:
694695
crystal_khz = 19200; /* 19.2 MHz */
695696
break;
696697
}

0 commit comments

Comments
 (0)