1
1
/*
2
- * tsc_msr.c - MSR based TSC calibration on Intel Atom SoC platforms.
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
- *
2
+ * tsc_msr.c - TSC frequency enumeration via MSR
12
3
*
13
4
* Copyright (C) 2013 Intel Corporation
14
5
* Author: Bin Gao <[email protected] >
22
13
#include <asm/apic.h>
23
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
16
#define MAX_NUM_FREQS 8
32
17
33
18
/*
34
- * According to Intel 64 and IA-32 System Programming Guide,
35
- * if MSR_PERF_STAT[31] is set, the maximum resolved bus ratio can be
19
+ * If MSR_PERF_STAT[31] is set, the maximum resolved bus ratio can be
36
20
* read in MSR_PLATFORM_ID[12:8], otherwise in MSR_PERF_STAT[44:40].
37
21
* Unfortunately some Intel Atom SoCs aren't quite compliant to this,
38
22
* so we need manually differentiate SoC families. This is what the
@@ -47,15 +31,15 @@ struct freq_desc {
47
31
48
32
static struct freq_desc freq_desc_tables [] = {
49
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
35
/* CLV+ */
52
- { 6 , 0x35 , 0 , { 0 , FREQ_133 , 0 , 0 , 0 , FREQ_100 , 0 , FREQ_83 } },
53
- /* TNG */
54
- { 6 , 0x4a , 1 , { 0 , FREQ_100 , FREQ_133 , 0 , 0 , 0 , 0 , 0 } },
55
- /* VLV2 */
56
- { 6 , 0x37 , 1 , { FREQ_83 , FREQ_100 , FREQ_133 , FREQ_166 , 0 , 0 , 0 , 0 } },
57
- /* ANN */
58
- { 6 , 0x5a , 1 , { FREQ_83 , FREQ_100 , FREQ_133 , FREQ_100 , 0 , 0 , 0 , 0 } },
36
+ { 6 , 0x35 , 0 , { 0 , 133200 , 0 , 0 , 0 , 99840 , 0 , 83200 } },
37
+ /* TNG - Intel Atom processor Z3400 series */
38
+ { 6 , 0x4a , 1 , { 0 , 99840 , 133200 , 0 , 0 , 0 , 0 , 0 } },
39
+ /* VLV2 - Intel Atom processor E3000, Z3600, Z3700 series */
40
+ { 6 , 0x37 , 1 , { 83200 , 99840 , 133200 , 166400 , 0 , 0 , 0 , 0 } },
41
+ /* ANN - Intel Atom processor Z3500 series */
42
+ { 6 , 0x5a , 1 , { 83200 , 99840 , 133200 , 99840 , 0 , 0 , 0 , 0 } },
59
43
};
60
44
61
45
static int match_cpu (u8 family , u8 model )
0 commit comments