coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
cpu_hybrid.c File Reference
#include <acpi/acpigen.h>
#include <intelblocks/acpi.h>
#include <soc/cpu.h>
#include <smp/spinlock.h>
#include <device/device.h>
#include <device/path.h>
#include <cpu/x86/lapic.h>
#include <cpu/x86/mp.h>
Include dependency graph for cpu_hybrid.c:

Go to the source code of this file.

Macros

#define CPPC_NOM_FREQ_IDX   22
 
#define CPPC_NOM_PERF_IDX   3
 

Enumerations

enum  cpu_perf_eff_type { CPU_TYPE_SMALL , CPU_TYPE_BIG }
 

Functions

 DECLARE_SPIN_LOCK (cpu_lock)
 
static bool is_big_core (void)
 
static u32 get_cpu_index (void)
 
static void set_cpu_type (void *unused)
 
static void run_set_cpu_type (void *unused)
 
static void acpi_get_cpu_nomi_perf (u16 *small_core_nom_perf, u16 *big_core_nom_perf)
 
static u16 acpi_get_cpu_nominal_freq (void)
 
static void acpigen_cppc_update_nominal_freq_perf (const char *pkg_path, s32 core_id)
 
void acpigen_write_CPPC_hybrid_method (s32 core_id)
 
 BOOT_STATE_INIT_ENTRY (BS_DEV_INIT_CHIPS, BS_ON_EXIT, run_set_cpu_type, NULL)
 

Variables

static u8 global_cpu_type [CONFIG_MAX_CPUS]
 

Macro Definition Documentation

◆ CPPC_NOM_FREQ_IDX

#define CPPC_NOM_FREQ_IDX   22

Definition at line 11 of file cpu_hybrid.c.

◆ CPPC_NOM_PERF_IDX

#define CPPC_NOM_PERF_IDX   3

Definition at line 12 of file cpu_hybrid.c.

Enumeration Type Documentation

◆ cpu_perf_eff_type

Enumerator
CPU_TYPE_SMALL 
CPU_TYPE_BIG 

Definition at line 14 of file cpu_hybrid.c.

Function Documentation

◆ acpi_get_cpu_nomi_perf()

static void acpi_get_cpu_nomi_perf ( u16 small_core_nom_perf,
u16 big_core_nom_perf 
)
static

Definition at line 67 of file cpu_hybrid.c.

References cpu_get_max_non_turbo_ratio(), and soc_get_scaling_factor().

Referenced by acpigen_cppc_update_nominal_freq_perf().

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

◆ acpi_get_cpu_nominal_freq()

static u16 acpi_get_cpu_nominal_freq ( void  )
static

Definition at line 79 of file cpu_hybrid.c.

References cpu_get_bus_frequency(), and cpu_get_max_non_turbo_ratio().

Referenced by acpigen_cppc_update_nominal_freq_perf().

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

◆ acpigen_cppc_update_nominal_freq_perf()

static void acpigen_cppc_update_nominal_freq_perf ( const char *  pkg_path,
s32  core_id 
)
static

Definition at line 85 of file cpu_hybrid.c.

References acpi_get_cpu_nomi_perf(), acpi_get_cpu_nominal_freq(), acpigen_set_package_element_int(), CPPC_NOM_FREQ_IDX, CPPC_NOM_PERF_IDX, CPU_TYPE_BIG, global_cpu_type, and soc_is_nominal_freq_supported().

Referenced by acpigen_write_CPPC_hybrid_method().

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

◆ acpigen_write_CPPC_hybrid_method()

void acpigen_write_CPPC_hybrid_method ( s32  core_id)

Definition at line 105 of file cpu_hybrid.c.

References acpigen_cppc_update_nominal_freq_perf(), acpigen_emit_byte(), acpigen_emit_namestring(), acpigen_pop_len(), acpigen_write_method(), CPPC_PACKAGE_NAME, RETURN_OP, and snprintf().

Referenced by generate_cppc_entries().

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

◆ BOOT_STATE_INIT_ENTRY()

BOOT_STATE_INIT_ENTRY ( BS_DEV_INIT_CHIPS  ,
BS_ON_EXIT  ,
run_set_cpu_type  ,
NULL   
)

◆ DECLARE_SPIN_LOCK()

DECLARE_SPIN_LOCK ( cpu_lock  )

◆ get_cpu_index()

static u32 get_cpu_index ( void  )
static

Definition at line 27 of file cpu_hybrid.c.

References device_path::apic, apic_path::apic_id, cpu_index(), dev_find_lapic(), lapicid(), device::next, and device::path.

Referenced by set_cpu_type().

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

◆ is_big_core()

static bool is_big_core ( void  )
static

Definition at line 22 of file cpu_hybrid.c.

References CPUID_CORE_TYPE_INTEL_CORE, and get_soc_cpu_type().

Referenced by set_cpu_type().

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

◆ run_set_cpu_type()

static void run_set_cpu_type ( void unused)
static

Definition at line 59 of file cpu_hybrid.c.

References BIOS_ERR, CB_SUCCESS, mp_run_on_all_cpus(), NULL, printk, and set_cpu_type().

Here is the call graph for this function:

◆ set_cpu_type()

static void set_cpu_type ( void unused)
static

Definition at line 48 of file cpu_hybrid.c.

References cpu_index(), CPU_TYPE_BIG, get_cpu_index(), global_cpu_type, is_big_core(), spin_lock, and spin_unlock.

Referenced by run_set_cpu_type().

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

Variable Documentation

◆ global_cpu_type

u8 global_cpu_type[CONFIG_MAX_CPUS]
static

Definition at line 20 of file cpu_hybrid.c.

Referenced by acpigen_cppc_update_nominal_freq_perf(), and set_cpu_type().