coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
cpu.c File Reference
#include <console/console.h>
#include <device/pci.h>
#include <device/pci_ids.h>
#include <cpu/x86/mp.h>
#include <cpu/x86/msr.h>
#include <cpu/intel/smm_reloc.h>
#include <cpu/intel/turbo.h>
#include <cpu/intel/common/common.h>
#include <fsp/api.h>
#include <intelblocks/cpulib.h>
#include <intelblocks/mp_init.h>
#include <intelblocks/msr.h>
#include <intelblocks/acpi.h>
#include <soc/cpu.h>
#include <soc/msr.h>
#include <soc/pci_devs.h>
#include <soc/soc_chip.h>
#include <types.h>
Include dependency graph for cpu.c:

Go to the source code of this file.

Enumerations

enum  alderlake_model { ADL_MODEL_P_M = 0x9A , ADL_MODEL_N = 0xBE }
 

Functions

bool cpu_soc_is_in_untrusted_mode (void)
 
static void soc_fsp_load (void)
 
static void configure_misc (void)
 
enum core_type get_soc_cpu_type (void)
 
void soc_get_scaling_factor (u16 *big_core_scal_factor, u16 *small_core_scal_factor)
 
bool soc_is_nominal_freq_supported (void)
 
void soc_core_init (struct device *cpu)
 
static void per_cpu_smm_trigger (void)
 
static void pre_mp_init (void)
 
static void post_mp_init (void)
 
void soc_init_cpus (struct bus *cpu_bus)
 
enum adl_cpu_type get_adl_cpu_type (void)
 
uint8_t get_supported_lpm_mask (void)
 

Variables

static const struct mp_ops mp_ops
 

Enumeration Type Documentation

◆ alderlake_model

Enumerator
ADL_MODEL_P_M 
ADL_MODEL_N 

Definition at line 28 of file cpu.c.

Function Documentation

◆ configure_misc()

static void configure_misc ( void  )
static

Definition at line 46 of file cpu.c.

References config_of_soc, cpu_set_eist(), msr_struct::hi, IA32_MISC_ENABLE, IA32_PACKAGE_THERM_INTERRUPT, IA32_THERM_INTERRUPT, msr_struct::lo, MSR_POWER_CTL, rdmsr(), and wrmsr().

Referenced by soc_core_init().

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 ENABLE_IA_UNTRUSTED, msr_struct::lo, MSR_BIOS_DONE, 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:

◆ get_adl_cpu_type()

enum adl_cpu_type get_adl_cpu_type ( void  )

Definition at line 183 of file cpu.c.

References configure_tcc_thermal_target(), and mp_init_with_smm().

Referenced by get_supported_lpm_mask().

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

◆ get_soc_cpu_type()

enum core_type get_soc_cpu_type ( void  )

Definition at line 46 of file cpu.c.

Referenced by is_big_core().

Here is the caller graph for this function:

◆ get_supported_lpm_mask()

uint8_t get_supported_lpm_mask ( void  )

Definition at line 261 of file cpu.c.

References ADL_M, ADL_N, ADL_P, ADL_S, BIOS_ERR, get_adl_cpu_type(), LPM_S0i2_0, LPM_S0i2_1, LPM_S0i3_0, printk, and type.

Referenced by fill_fsps_misc_power_params(), platform_fsp_silicon_init_params_cb(), and soc_pmc_fill_ssdt().

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

◆ per_cpu_smm_trigger()

static void per_cpu_smm_trigger ( void  )
static

Definition at line 134 of file cpu.c.

References smm_relocate().

Here is the call graph for this function:

◆ post_mp_init()

static void post_mp_init ( void  )
static

Definition at line 153 of file cpu.c.

◆ pre_mp_init()

static void pre_mp_init ( void  )
static

Definition at line 140 of file cpu.c.

References BIOS_WARNING, check_energy_perf_cap(), config_of_soc, enable_energy_perf_pref(), printk, and soc_fsp_load().

Here is the call graph for this function:

◆ soc_core_init()

◆ soc_fsp_load()

static void soc_fsp_load ( void  )
static

Definition at line 41 of file cpu.c.

References fsps_load().

Referenced by pre_mp_init().

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

◆ soc_get_scaling_factor()

void soc_get_scaling_factor ( u16 big_core_scal_factor,
u16 small_core_scal_factor 
)

Definition at line 92 of file cpu.c.

Referenced by acpi_get_cpu_nomi_perf().

Here is the caller graph for this function:

◆ soc_init_cpus()

void soc_init_cpus ( struct bus cpu_bus)

Definition at line 183 of file cpu.c.

Referenced by apollolake_init_cpus(), and init_cpus().

Here is the caller graph for this function:

◆ soc_is_nominal_freq_supported()

bool soc_is_nominal_freq_supported ( void  )

Definition at line 98 of file cpu.c.

Referenced by acpigen_cppc_update_nominal_freq_perf().

Here is the caller graph for this function:

Variable Documentation

◆ mp_ops

const struct mp_ops mp_ops
static
Initial value:
= {
.pre_mp_init = pre_mp_init,
.get_cpu_count = get_cpu_count,
.get_smm_info = smm_info,
.get_microcode_info = get_microcode_info,
.pre_mp_smm_init = smm_initialize,
.per_cpu_smm_trigger = per_cpu_smm_trigger,
.relocation_handler = smm_relocation_handler,
.post_mp_init = post_mp_init,
}
void smm_relocation_handler(int cpu, uintptr_t curr_smbase, uintptr_t staggered_smbase)
Definition: smmrelocate.c:90
void smm_initialize(void)
Definition: smmrelocate.c:227
void smm_info(uintptr_t *perm_smbase, size_t *perm_smsize, size_t *smm_save_state_size)
Definition: smmrelocate.c:213
int get_cpu_count(void)
Definition: cpu.c:10
static void pre_mp_init(void)
Definition: cpu.c:140
static void per_cpu_smm_trigger(void)
Definition: cpu.c:134
static void post_mp_init(void)
Definition: cpu.c:153
void get_microcode_info(const void **microcode, int *parallel)
Definition: cpu.c:180

Definition at line 153 of file cpu.c.