coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
cpulib.h File Reference
#include <types.h>
Include dependency graph for cpulib.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  { BURST_MODE_UNKNOWN , BURST_MODE_UNAVAILABLE , BURST_MODE_DISABLED , BURST_MODE_ENABLED }
 

Functions

void cpu_set_max_ratio (void)
 
u32 cpu_get_bus_frequency (void)
 
u8 cpu_get_max_non_turbo_ratio (void)
 
bool cpu_is_hybrid_supported (void)
 
uint8_t cpu_get_cpu_type (void)
 
u8 cpu_get_tdp_nominal_ratio (void)
 
int cpu_config_tdp_levels (void)
 
void cpu_set_p_state_to_turbo_ratio (void)
 
void cpu_set_p_state_to_nominal_tdp_ratio (void)
 
void cpu_set_p_state_to_max_non_turbo_ratio (void)
 
void cpu_set_p_state_to_min_clock_ratio (void)
 
int cpu_get_burst_mode_state (void)
 
void cpu_burst_mode (bool burst_mode_status)
 
void cpu_set_eist (bool eist_status)
 
bool cpu_soc_is_in_untrusted_mode (void)
 
int cpu_read_topology (unsigned int *num_phys, unsigned int *num_virt)
 
uint32_t cpu_get_bus_clock (void)
 
int cpu_get_coord_type (void)
 
uint32_t cpu_get_min_ratio (void)
 
uint32_t cpu_get_max_ratio (void)
 
void configure_tcc_thermal_target (void)
 
uint32_t cpu_get_power_max (void)
 
uint32_t cpu_get_max_turbo_ratio (void)
 
void mca_configure (void)
 
void cpu_lt_lock_memory (void)
 
int get_valid_prmrr_size (void)
 
void enable_pm_timer_emulation (void)
 
void get_cpu_topology_from_apicid (uint32_t apicid, uint8_t *package, uint8_t *core, uint8_t *thread)
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
BURST_MODE_UNKNOWN 
BURST_MODE_UNAVAILABLE 
BURST_MODE_DISABLED 
BURST_MODE_ENABLED 

Definition at line 92 of file cpulib.h.

Function Documentation

◆ configure_tcc_thermal_target()

void configure_tcc_thermal_target ( void  )

Definition at line 317 of file cpulib.c.

References BIT, CONFIG, config_of_soc, msr_struct::lo, MSR_PLATFORM_INFO, MSR_TEMPERATURE_TARGET, rdmsr(), and wrmsr().

Referenced by get_adl_cpu_type(), punit_init(), and soc_init_cpus().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cpu_burst_mode()

void cpu_burst_mode ( bool  burst_mode_status)

Definition at line 233 of file cpulib.c.

References BURST_MODE_DISABLE, msr_struct::hi, IA32_MISC_ENABLE, rdmsr(), and wrmsr().

Referenced by set_max_freq().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cpu_config_tdp_levels()

int cpu_config_tdp_levels ( void  )

Definition at line 300 of file haswell_init.c.

References cpuid_eax(), msr_struct::hi, IVB_CONFIG_TDP_MIN_CPUID, MSR_PLATFORM_INFO, and rdmsr().

Referenced by cpu_get_max_ratio(), set_max_ratio(), and set_power_limits().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cpu_get_burst_mode_state()

int cpu_get_burst_mode_state ( void  )

Definition at line 172 of file cpulib.c.

References BURST_MODE_DISABLE, BURST_MODE_DISABLED, BURST_MODE_ENABLED, BURST_MODE_UNAVAILABLE, BURST_MODE_UNKNOWN, cpuid_eax(), msr_struct::hi, IA32_MISC_ENABLE, and rdmsr().

Referenced by set_max_freq().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cpu_get_bus_clock()

uint32_t cpu_get_bus_clock ( void  )

Definition at line 350 of file cpulib.c.

References KHz.

Referenced by generate_p_state_entries().

Here is the caller graph for this function:

◆ cpu_get_bus_frequency()

u32 cpu_get_bus_frequency ( void  )

Definition at line 223 of file cpulib.c.

References cpuid_ecx(), and CPUID_PROCESSOR_FREQUENCY.

Referenced by acpi_get_cpu_nominal_freq().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cpu_get_coord_type()

int cpu_get_coord_type ( void  )

Definition at line 276 of file cpulib.c.

References HW_ALL.

Referenced by generate_p_state_entries().

Here is the caller graph for this function:

◆ cpu_get_cpu_type()

uint8_t cpu_get_cpu_type ( void  )

Definition at line 207 of file cpulib.c.

References cpuid_eax(), and CPUID_HYBRID_INFORMATION.

Here is the call graph for this function:

◆ cpu_get_max_non_turbo_ratio()

u8 cpu_get_max_non_turbo_ratio ( void  )

Definition at line 305 of file cpulib.c.

References msr_struct::lo, MSR_PLATFORM_INFO, and rdmsr().

Referenced by acpi_get_cpu_nomi_perf(), acpi_get_cpu_nominal_freq(), and cpu_set_p_state_to_max_non_turbo_ratio().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cpu_get_max_ratio()

uint32_t cpu_get_max_ratio ( void  )

Definition at line 289 of file cpulib.c.

References cpu_config_tdp_levels(), msr_struct::lo, MSR_CONFIG_TDP_NOMINAL, MSR_PLATFORM_INFO, and rdmsr().

Referenced by generate_p_state_entries().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cpu_get_max_turbo_ratio()

uint32_t cpu_get_max_turbo_ratio ( void  )

Definition at line 369 of file cpulib.c.

References msr_struct::lo, MSR_TURBO_RATIO_LIMIT, and rdmsr().

Referenced by generate_p_state_entries().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cpu_get_min_ratio()

uint32_t cpu_get_min_ratio ( void  )

Definition at line 281 of file cpulib.c.

References msr_struct::hi, MSR_PLATFORM_INFO, and rdmsr().

Referenced by cpu_set_p_state_to_min_clock_ratio(), and generate_p_state_entries().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cpu_get_power_max()

uint32_t cpu_get_power_max ( void  )

Definition at line 358 of file cpulib.c.

References msr_struct::lo, MSR_PKG_POWER_SKU, MSR_PKG_POWER_SKU_UNIT, and rdmsr().

Referenced by config_pmic_imon(), fill_vr_domain_config(), generate_p_state_entries(), and get_sku_icc_max().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cpu_get_tdp_nominal_ratio()

u8 cpu_get_tdp_nominal_ratio ( void  )

Definition at line 55 of file cpulib.c.

References msr_struct::lo, MSR_CONFIG_TDP_NOMINAL, and rdmsr().

Referenced by set_power_limits().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cpu_is_hybrid_supported()

bool cpu_is_hybrid_supported ( void  )

Definition at line 194 of file cpulib.c.

References cpuid_ext(), CPUID_STRUCT_EXTENDED_FEATURE_FLAGS, cpuid_result::edx, and HYBRID_FEATURE.

Here is the call graph for this function:

◆ cpu_lt_lock_memory()

void cpu_lt_lock_memory ( void  )

Definition at line 392 of file cpulib.c.

References LT_CONTROL_LOCK, MSR_LT_CONTROL, and msr_set().

Referenced by pch_finalize(), sgx_configure(), and soc_lockdown().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cpu_read_topology()

int cpu_read_topology ( unsigned int *  num_phys,
unsigned int *  num_virt 
)

Definition at line 267 of file cpulib.c.

References msr_struct::lo, MSR_CORE_THREAD_COUNT, and rdmsr().

Referenced by generate_cpu_entries(), get_cpu_count(), get_thread_count(), get_threads_per_package(), and wilco_set_cpu_id().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cpu_set_eist()

void cpu_set_eist ( bool  eist_status)

Definition at line 250 of file cpulib.c.

References IA32_MISC_ENABLE, msr_struct::lo, rdmsr(), and wrmsr().

Referenced by configure_misc(), set_max_freq(), and soc_core_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cpu_set_max_ratio()

void cpu_set_max_ratio ( void  )

Definition at line 45 of file cpulib.c.

References cpu_set_p_state_to_turbo_ratio(), get_turbo_state(), and TURBO_ENABLED.

Referenced by post_mp_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cpu_set_p_state_to_max_non_turbo_ratio()

void cpu_set_p_state_to_max_non_turbo_ratio ( void  )

Definition at line 138 of file cpulib.c.

References cpu_get_max_non_turbo_ratio(), msr_struct::hi, msr_struct::lo, and set_perf_control_msr().

Referenced by soc_core_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cpu_set_p_state_to_min_clock_ratio()

void cpu_set_p_state_to_min_clock_ratio ( void  )

Definition at line 154 of file cpulib.c.

References cpu_get_min_ratio(), msr_struct::hi, msr_struct::lo, and set_perf_control_msr().

Referenced by soc_core_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cpu_set_p_state_to_nominal_tdp_ratio()

void cpu_set_p_state_to_nominal_tdp_ratio ( void  )

Definition at line 121 of file cpulib.c.

References msr_struct::hi, msr_struct::lo, MSR_CONFIG_TDP_NOMINAL, rdmsr(), and set_perf_control_msr().

Here is the call graph for this function:

◆ cpu_set_p_state_to_turbo_ratio()

void cpu_set_p_state_to_turbo_ratio ( void  )

Definition at line 103 of file cpulib.c.

References msr_struct::hi, msr_struct::lo, MSR_TURBO_RATIO_LIMIT, rdmsr(), and set_perf_control_msr().

Referenced by cpu_set_max_ratio(), and set_max_freq().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cpu_soc_is_in_untrusted_mode()

bool cpu_soc_is_in_untrusted_mode ( void  )

Definition at line 33 of file cpu.c.

References CONFIG, ENABLE_IA_UNTRUSTED, msr_struct::lo, MSR_BIOS_DONE, MSR_POWER_MISC, and rdmsr().

Referenced by gpio_non_smm_lock_pad().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ enable_pm_timer_emulation()

void enable_pm_timer_emulation ( void  )

Definition at line 10 of file pm_timer_emulation.c.

References ACPI_BASE_ADDRESS, CONFIG, DIV_ROUND_CLOSEST, EMULATE_DELAY_OFFSET_VALUE, EMULATE_DELAY_VALUE, EMULATE_PM_TMR_EN, msr_struct::hi, msr_struct::lo, MSR_EMULATE_PM_TIMER, PM1_TMR, and wrmsr().

Referenced by bootblock_soc_early_init(), and soc_core_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_cpu_topology_from_apicid()

void get_cpu_topology_from_apicid ( uint32_t  apicid,
uint8_t package,
uint8_t core,
uint8_t thread 
)

Definition at line 471 of file cpulib.c.

References get_cpu_core_thread_bits().

Referenced by mp_get_processor_info().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_valid_prmrr_size()

int get_valid_prmrr_size ( void  )

Definition at line 397 of file cpulib.c.

References BIOS_DEBUG, BIOS_WARNING, CONFIG, msr_struct::lo, MiB, MSR_PRMRR_VALID_CONFIG, printk, and rdmsr().

Referenced by fill_fspm_cpu_params(), platform_fsp_memory_init_params_cb(), and soc_memory_init_params().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mca_configure()

void mca_configure ( void  )

Definition at line 376 of file cpulib.c.

References BIOS_DEBUG, IA32_MC_CTL, mca_clear_status(), mca_get_bank_count(), printk, and wrmsr().

Referenced by dnv_configure_mca(), soc_core_init(), and xeon_configure_mca().

Here is the call graph for this function:
Here is the caller graph for this function: