coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
msr.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef SOC_INTEL_COMMON_MSR_H
4 #define SOC_INTEL_COMMON_MSR_H
5 
6 #define MSR_CORE_THREAD_COUNT 0x35
7 #define MSR_PLATFORM_INFO 0xce
8 #define MSR_PKG_CST_CONFIG_CONTROL 0xe2
9 /* Set MSR_PKG_CST_CONFIG_CONTROL[3:0] for Package C-State limit */
10 #define PKG_C_STATE_LIMIT_C2_MASK 0x2
11 /* Set MSR_PKG_CST_CONFIG_CONTROL[7:4] for Core C-State limit*/
12 #define CORE_C_STATE_LIMIT_C10_MASK 0x70
13 /* Set MSR_PKG_CST_CONFIG_CONTROL[10] to IO redirect to MWAIT */
14 #define IO_MWAIT_REDIRECT_MASK 0x400
15 /* Set MSR_PKG_CST_CONFIG_CONTROL[15] to lock CST_CFG [0-15] bits */
16 #define CST_CFG_LOCK_MASK 0x8000
17 #define MSR_BIOS_UPGD_TRIG 0x7a
18 #define SGX_ACTIVATE_BIT (1)
19 #define MSR_PMG_IO_CAPTURE_BASE 0xe4
20 #define MSR_EMULATE_PM_TIMER 0x121
21 #define EMULATE_DELAY_OFFSET_VALUE 20
22 #define EMULATE_PM_TMR_EN (1 << 16)
23 #define EMULATE_DELAY_VALUE 0x13
24 #define SMM_MCA_CAP_MSR 0x17d
25 #define SMM_CPU_SVRSTR_BIT 57
26 #define SMM_CPU_SVRSTR_MASK (1 << (SMM_CPU_SVRSTR_BIT - 32))
27 #define MSR_FLEX_RATIO 0x194
28 #define FLEX_RATIO_LOCK (1 << 20)
29 #define FLEX_RATIO_EN (1 << 16)
30 /* This is burst mode BIT 38 in IA32_MISC_ENABLE MSR at offset 1A0h */
31 #define BURST_MODE_DISABLE (1 << 6)
32 #define MSR_TEMPERATURE_TARGET 0x1a2
33 #define TEMPERATURE_TCC_MASK 0xf
34 #define TEMPERATURE_TCC_SHIFT 24
35 #define MSR_PREFETCH_CTL 0x1a4
36 #define PREFETCH_L1_DISABLE (1 << 0)
37 #define PREFETCH_L2_DISABLE (1 << 2)
38 #define MSR_MISC_PWR_MGMT 0x1aa
39 #define MISC_PWR_MGMT_EIST_HW_DIS (1 << 0)
40 #define MISC_PWR_MGMT_ISST_EN (1 << 6)
41 #define MISC_PWR_MGMT_ISST_EN_INT (1 << 7)
42 #define MISC_PWR_MGMT_ISST_EN_EPP (1 << 12)
43 #define MSR_TURBO_RATIO_LIMIT 0x1ad
44 #define MSR_PRMRR_PHYS_BASE 0x1f4
45 #define MSR_PRMRR_PHYS_MASK 0x1f5
46 #define PRMRR_PHYS_MASK_LOCK (1 << 10)
47 #define PRMRR_PHYS_MASK_VALID (1 << 11)
48 #define MSR_PRMRR_VALID_CONFIG 0x1fb
49 #define MSR_POWER_CTL 0x1fc
50 #define POWER_CTL_C1E_MASK (1 << 1)
51 #define MSR_EVICT_CTL 0x2e0
52 #define MSR_LT_CONTROL 0x2e7
53 #define LT_CONTROL_LOCK (1 << 0)
54 #define MSR_SGX_OWNEREPOCH0 0x300
55 #define MSR_SGX_OWNEREPOCH1 0x301
56 #define SMM_FEATURE_CONTROL_MSR 0x4e0
57 #define SMM_CPU_SAVE_EN (1 << 1)
58 #define MSR_PKG_POWER_SKU_UNIT 0x606
59 #define MSR_C_STATE_LATENCY_CONTROL_0 0x60a
60 #define MSR_C_STATE_LATENCY_CONTROL_1 0x60b
61 #define MSR_C_STATE_LATENCY_CONTROL_2 0x60c
62 #define MSR_PKG_POWER_LIMIT 0x610
63 /*
64  * For Mobile, RAPL default PL1 time window value set to 28 seconds.
65  * RAPL time window calculation defined as follows:
66  * Time Window = (float)((1+X/4)*(2*^Y), X Corresponds to [23:22],
67  * Y to [21:17] in MSR 0x610. 28 sec is equal to 0x6e.
68  */
69 #define MB_POWER_LIMIT1_TIME_DEFAULT 0x6e
70 #define MSR_PKG_POWER_SKU 0x614
71 #define MSR_DDR_RAPL_LIMIT 0x618
72 #define MSR_C_STATE_LATENCY_CONTROL_3 0x633
73 #define MSR_C_STATE_LATENCY_CONTROL_4 0x634
74 #define MSR_C_STATE_LATENCY_CONTROL_5 0x635
75 #define IRTL_VALID (1 << 15)
76 #define IRTL_1_NS (0 << 10)
77 #define IRTL_32_NS (1 << 10)
78 #define IRTL_1024_NS (2 << 10)
79 #define IRTL_32768_NS (3 << 10)
80 #define IRTL_1048576_NS (4 << 10)
81 #define IRTL_33554432_NS (5 << 10)
82 #define IRTL_RESPONSE_MASK (0x3ff)
83 #define MSR_COUNTER_24_MHZ 0x637
84 #define MSR_CONFIG_TDP_NOMINAL 0x648
85 #define MSR_CONFIG_TDP_LEVEL1 0x649
86 #define MSR_CONFIG_TDP_LEVEL2 0x64a
87 #define MSR_CONFIG_TDP_CONTROL 0x64b
88 #define MSR_TURBO_ACTIVATION_RATIO 0x64c
89 #define PKG_POWER_LIMIT_MASK (0x7fff)
90 #define PKG_POWER_LIMIT_EN (1 << 15)
91 #define PKG_POWER_LIMIT_CLAMP (1 << 16)
92 #define PKG_POWER_LIMIT_TIME_SHIFT 17
93 #define PKG_POWER_LIMIT_TIME_MASK (0x7f)
94 #define PKG_POWER_LIMIT_DUTYCYCLE_SHIFT 24
95 #define PKG_POWER_LIMIT_DUTYCYCLE_MASK (0x7f)
96 /* SMM save state MSRs */
97 #define SMBASE_MSR 0xc20
98 #define IEDBASE_MSR 0xc22
99 
100 #define MSR_L2_QOS_MASK(reg) (0xd10 + reg)
101 
102 /* MTRR_CAP_MSR bits */
103 #define SMRR_SUPPORTED (1<<11)
104 #define PRMRR_SUPPORTED (1<<12)
105 #define SMRR_LOCK_SUPPORTED (1<<14)
106 
107 #define SGX_SUPPORTED (1<<2)
108 
109 #endif /* SOC_INTEL_COMMON_MSR_H */