22
22
* read in MSR_PLATFORM_ID[12:8], otherwise in MSR_PERF_STAT[44:40].
23
23
* Unfortunately some Intel Atom SoCs aren't quite compliant to this,
24
24
* so we need manually differentiate SoC families. This is what the
25
- * field msr_plat does.
25
+ * field use_msr_plat does.
26
26
*/
27
27
struct freq_desc {
28
- u8 msr_plat ; /* 1: use MSR_PLATFORM_INFO, 0: MSR_IA32_PERF_STATUS */
28
+ bool use_msr_plat ;
29
29
u32 freqs [MAX_NUM_FREQS ];
30
30
};
31
31
@@ -35,31 +35,39 @@ struct freq_desc {
35
35
* by MSR based on SDM.
36
36
*/
37
37
static const struct freq_desc freq_desc_pnw = {
38
- 0 , { 0 , 0 , 0 , 0 , 0 , 99840 , 0 , 83200 }
38
+ .use_msr_plat = false,
39
+ .freqs = { 0 , 0 , 0 , 0 , 0 , 99840 , 0 , 83200 },
39
40
};
40
41
41
42
static const struct freq_desc freq_desc_clv = {
42
- 0 , { 0 , 133200 , 0 , 0 , 0 , 99840 , 0 , 83200 }
43
+ .use_msr_plat = false,
44
+ .freqs = { 0 , 133200 , 0 , 0 , 0 , 99840 , 0 , 83200 },
43
45
};
44
46
45
47
static const struct freq_desc freq_desc_byt = {
46
- 1 , { 83300 , 100000 , 133300 , 116700 , 80000 , 0 , 0 , 0 }
48
+ .use_msr_plat = true,
49
+ .freqs = { 83300 , 100000 , 133300 , 116700 , 80000 , 0 , 0 , 0 },
47
50
};
48
51
49
52
static const struct freq_desc freq_desc_cht = {
50
- 1 , { 83300 , 100000 , 133300 , 116700 , 80000 , 93300 , 90000 , 88900 , 87500 }
53
+ .use_msr_plat = true,
54
+ .freqs = { 83300 , 100000 , 133300 , 116700 , 80000 , 93300 , 90000 ,
55
+ 88900 , 87500 },
51
56
};
52
57
53
58
static const struct freq_desc freq_desc_tng = {
54
- 1 , { 0 , 100000 , 133300 , 0 , 0 , 0 , 0 , 0 }
59
+ .use_msr_plat = true,
60
+ .freqs = { 0 , 100000 , 133300 , 0 , 0 , 0 , 0 , 0 },
55
61
};
56
62
57
63
static const struct freq_desc freq_desc_ann = {
58
- 1 , { 83300 , 100000 , 133300 , 100000 , 0 , 0 , 0 , 0 }
64
+ .use_msr_plat = true,
65
+ .freqs = { 83300 , 100000 , 133300 , 100000 , 0 , 0 , 0 , 0 },
59
66
};
60
67
61
68
static const struct freq_desc freq_desc_lgm = {
62
- 1 , { 78000 , 78000 , 78000 , 78000 , 78000 , 78000 , 78000 , 78000 }
69
+ .use_msr_plat = true,
70
+ .freqs = { 78000 , 78000 , 78000 , 78000 , 78000 , 78000 , 78000 , 78000 },
63
71
};
64
72
65
73
static const struct x86_cpu_id tsc_msr_cpu_ids [] = {
@@ -91,7 +99,7 @@ unsigned long cpu_khz_from_msr(void)
91
99
return 0 ;
92
100
93
101
freq_desc = (struct freq_desc * )id -> driver_data ;
94
- if (freq_desc -> msr_plat ) {
102
+ if (freq_desc -> use_msr_plat ) {
95
103
rdmsr (MSR_PLATFORM_INFO , lo , hi );
96
104
ratio = (lo >> 8 ) & 0xff ;
97
105
} else {
0 commit comments