coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
common.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef _CPU_INTEL_COMMON_H
4 #define _CPU_INTEL_COMMON_H
5 
6 #include <types.h>
7 #include <acpi/acpigen.h>
8 
9 void set_vmx_and_lock(void);
10 void set_feature_ctrl_vmx(void);
11 void set_feature_ctrl_vmx_arg(bool enable);
12 void set_feature_ctrl_lock(void);
13 
14 /*
15  * Init CPPC block with MSRs for Intel Enhanced Speed Step Technology.
16  * Version 2 is suggested--this function's implementation of version 3
17  * may have room for improvement.
18  */
19 struct cppc_config;
21 
22 /*
23  * Returns true if CPU supports Hyper-Threading.
24  */
25 bool intel_ht_supported(void);
26 
27 /*
28  * Returns true if it's not thread 0 on a hyperthreading enabled core.
29  */
30 bool intel_ht_sibling(void);
31 
32 /*
33  * Lock AES-NI feature (MSR_FEATURE_CONFIG) to prevent unintended changes
34  * to the enablement state as suggested in Intel document 325384-070US.
35  */
36 void set_aesni_lock(void);
37 
38 /* Enable local CPU APIC TPR (Task Priority Register) updates */
39 void enable_lapic_tpr(void);
40 
41 /* Enable DCA (Direct Cache Access) */
42 void configure_dca_cap(void);
43 
44 /*
45  * Set EPB (Energy Performance Bias)
46  * Possible values are 0 (performance) to 15 (powersave).
47  */
48 void set_energy_perf_bias(u8 policy);
49 
50 /*
51  * Check energy performance preference and HWP capabilities from Thermal and
52  * Power Management Leaf CPUID.
53  */
54 bool check_energy_perf_cap(void);
55 
56 /*
57  * Set the IA32_HWP_REQUEST Energy-Performance Preference bits on the logical
58  * thread. 0 is a hint to the HWP to prefer performance, and 255 is a hint to
59  * prefer energy efficiency.
60  */
61 void set_energy_perf_pref(u8 pref);
62 
63 /*
64  * Instructs the CPU to use EPP hints. This means that any energy policies set
65  * up in `set_energy_perf_bias` will be ignored afterwards.
66  */
67 void enable_energy_perf_pref(void);
68 
69 #endif
void configure_dca_cap(void)
Definition: common_init.c:172
void set_energy_perf_pref(u8 pref)
Definition: common_init.c:223
void set_aesni_lock(void)
Definition: common_init.c:146
bool check_energy_perf_cap(void)
Definition: common_init.c:193
void cpu_init_cppc_config(struct cppc_config *config, u32 version)
Definition: common_init.c:111
void enable_energy_perf_pref(void)
Definition: common_init.c:207
void set_energy_perf_bias(u8 policy)
Definition: common_init.c:178
bool intel_ht_sibling(void)
void enable_lapic_tpr(void)
Definition: common_init.c:167
void set_feature_ctrl_vmx(void)
Definition: common_init.c:67
void set_feature_ctrl_lock(void)
Definition: common_init.c:72
void set_vmx_and_lock(void)
Definition: common_init.c:15
void set_feature_ctrl_vmx_arg(bool enable)
Definition: common_init.c:21
bool intel_ht_supported(void)
Definition: hyperthreading.c:7
unsigned int version[2]
Definition: edid.c:55
enum board_config config
Definition: memory.c:448
uint32_t u32
Definition: stdint.h:51
uint8_t u8
Definition: stdint.h:45