diff options
author | Len Brown <len.brown@intel.com> | 2016-06-17 01:22:46 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-07-10 11:00:13 -0400 |
commit | 9e0cae9f6227f946fb0076b6a68c88156137f618 (patch) | |
tree | 02987c99c0e0d2f2413bf74503f6f36b4692fcb0 | |
parent | 14bb4e34860af48ef1ea0f52b11611ce4db987fe (diff) |
x86/tsc_msr: Update comments, expand definitions
Syntax only, no functional change.
Signed-off-by: Len Brown <len.brown@intel.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/8653a2dba21fef122fc7b29eafb750e2004d3976.1466138954.git.len.brown@intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | arch/x86/kernel/tsc_msr.c | 36 |
1 files changed, 10 insertions, 26 deletions
diff --git a/arch/x86/kernel/tsc_msr.c b/arch/x86/kernel/tsc_msr.c index f7ba44b89cc4..4110f723fd0f 100644 --- a/arch/x86/kernel/tsc_msr.c +++ b/arch/x86/kernel/tsc_msr.c | |||
@@ -1,14 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * tsc_msr.c - MSR based TSC calibration on Intel Atom SoC platforms. | 2 | * tsc_msr.c - TSC frequency enumeration via MSR |
3 | * | ||
4 | * TSC in Intel Atom SoC runs at a constant rate which can be figured | ||
5 | * by this formula: | ||
6 | * <maximum core-clock to bus-clock ratio> * <maximum resolved frequency> | ||
7 | * See Intel 64 and IA-32 System Programming Guid section 16.12 and 30.11.5 | ||
8 | * for details. | ||
9 | * Especially some Intel Atom SoCs don't have PIT(i8254) or HPET, so MSR | ||
10 | * based calibration is the only option. | ||
11 | * | ||
12 | * | 3 | * |
13 | * Copyright (C) 2013 Intel Corporation | 4 | * Copyright (C) 2013 Intel Corporation |
14 | * Author: Bin Gao <bin.gao@intel.com> | 5 | * Author: Bin Gao <bin.gao@intel.com> |
@@ -22,17 +13,10 @@ | |||
22 | #include <asm/apic.h> | 13 | #include <asm/apic.h> |
23 | #include <asm/param.h> | 14 | #include <asm/param.h> |
24 | 15 | ||
25 | /* CPU reference clock frequency: in KHz */ | ||
26 | #define FREQ_83 83200 | ||
27 | #define FREQ_100 99840 | ||
28 | #define FREQ_133 133200 | ||
29 | #define FREQ_166 166400 | ||
30 | |||
31 | #define MAX_NUM_FREQS 8 | 16 | #define MAX_NUM_FREQS 8 |
32 | 17 | ||
33 | /* | 18 | /* |
34 | * According to Intel 64 and IA-32 System Programming Guide, | 19 | * If MSR_PERF_STAT[31] is set, the maximum resolved bus ratio can be |
35 | * if MSR_PERF_STAT[31] is set, the maximum resolved bus ratio can be | ||
36 | * read in MSR_PLATFORM_ID[12:8], otherwise in MSR_PERF_STAT[44:40]. | 20 | * read in MSR_PLATFORM_ID[12:8], otherwise in MSR_PERF_STAT[44:40]. |
37 | * Unfortunately some Intel Atom SoCs aren't quite compliant to this, | 21 | * Unfortunately some Intel Atom SoCs aren't quite compliant to this, |
38 | * so we need manually differentiate SoC families. This is what the | 22 | * so we need manually differentiate SoC families. This is what the |
@@ -47,15 +31,15 @@ struct freq_desc { | |||
47 | 31 | ||
48 | static struct freq_desc freq_desc_tables[] = { | 32 | static struct freq_desc freq_desc_tables[] = { |
49 | /* PNW */ | 33 | /* PNW */ |
50 | { 6, 0x27, 0, { 0, 0, 0, 0, 0, FREQ_100, 0, FREQ_83 } }, | 34 | { 6, 0x27, 0, { 0, 0, 0, 0, 0, 99840, 0, 83200 } }, |
51 | /* CLV+ */ | 35 | /* CLV+ */ |
52 | { 6, 0x35, 0, { 0, FREQ_133, 0, 0, 0, FREQ_100, 0, FREQ_83 } }, | 36 | { 6, 0x35, 0, { 0, 133200, 0, 0, 0, 99840, 0, 83200 } }, |
53 | /* TNG */ | 37 | /* TNG - Intel Atom processor Z3400 series */ |
54 | { 6, 0x4a, 1, { 0, FREQ_100, FREQ_133, 0, 0, 0, 0, 0 } }, | 38 | { 6, 0x4a, 1, { 0, 99840, 133200, 0, 0, 0, 0, 0 } }, |
55 | /* VLV2 */ | 39 | /* VLV2 - Intel Atom processor E3000, Z3600, Z3700 series */ |
56 | { 6, 0x37, 1, { FREQ_83, FREQ_100, FREQ_133, FREQ_166, 0, 0, 0, 0 } }, | 40 | { 6, 0x37, 1, { 83200, 99840, 133200, 166400, 0, 0, 0, 0 } }, |
57 | /* ANN */ | 41 | /* ANN - Intel Atom processor Z3500 series */ |
58 | { 6, 0x5a, 1, { FREQ_83, FREQ_100, FREQ_133, FREQ_100, 0, 0, 0, 0 } }, | 42 | { 6, 0x5a, 1, { 83200, 99840, 133200, 99840, 0, 0, 0, 0 } }, |
59 | }; | 43 | }; |
60 | 44 | ||
61 | static int match_cpu(u8 family, u8 model) | 45 | static int match_cpu(u8 family, u8 model) |