coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
model_206ax_init.c File Reference
#include <console/console.h>
#include <device/device.h>
#include <cpu/cpu.h>
#include <cpu/x86/mtrr.h>
#include <cpu/x86/msr.h>
#include <cpu/x86/mp.h>
#include <cpu/intel/microcode.h>
#include <cpu/intel/speedstep.h>
#include <cpu/intel/turbo.h>
#include <cpu/x86/cache.h>
#include <cpu/x86/name.h>
#include "model_206ax.h"
#include "chip.h"
#include <cpu/intel/smm_reloc.h>
#include <cpu/intel/common/common.h>
#include <smbios.h>
#include <types.h>
Include dependency graph for model_206ax_init.c:

Go to the source code of this file.

Functions

int cpu_config_tdp_levels (void)
 
void set_power_limits (u8 power_limit_1_time)
 
static void configure_c_states (void)
 
static void configure_thermal_target (void)
 
static void configure_misc (void)
 
static void set_max_ratio (void)
 
unsigned int smbios_cpu_get_max_speed_mhz (void)
 
unsigned int smbios_cpu_get_current_speed_mhz (void)
 
unsigned int smbios_processor_external_clock (void)
 
static void model_206ax_report (void)
 
static void model_206ax_init (struct device *cpu)
 
static void pre_mp_init (void)
 
static int get_cpu_count (void)
 
static void get_microcode_info (const void **microcode, int *parallel)
 
static void per_cpu_smm_trigger (void)
 
static void post_mp_init (void)
 
void mp_init_cpus (struct bus *cpu_bus)
 

Variables

static const u8 power_limit_time_sec_to_msr []
 
static const u8 power_limit_time_msr_to_sec []
 
static const struct mp_ops mp_ops
 
static struct device_operations cpu_dev_ops
 
static const struct cpu_device_id cpu_table []
 
static const struct cpu_driver driver __cpu_driver
 

Function Documentation

◆ configure_c_states()

static void configure_c_states ( void  )
static

◆ configure_misc()

static void configure_misc ( void  )
static

Definition at line 236 of file model_206ax_init.c.

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

Referenced by model_206ax_init().

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

◆ configure_thermal_target()

static void configure_thermal_target ( void  )
static

Definition at line 214 of file model_206ax_init.c.

References device::chip_info, dev_find_lapic(), msr_struct::lo, MSR_PLATFORM_INFO, MSR_TEMPERATURE_TARGET, rdmsr(), SPEEDSTEP_APIC_MAGIC, cpu_intel_model_206ax_config::tcc_offset, and wrmsr().

Referenced by model_206ax_init().

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 79 of file model_206ax_init.c.

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

Referenced by set_max_ratio(), and set_power_limits().

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

◆ get_cpu_count()

static int get_cpu_count ( void  )
static

Definition at line 375 of file model_206ax_init.c.

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

Here is the call graph for this function:

◆ get_microcode_info()

static void get_microcode_info ( const void **  microcode,
int *  parallel 
)
static

Definition at line 390 of file model_206ax_init.c.

References intel_ht_supported(), and intel_microcode_find().

Here is the call graph for this function:

◆ model_206ax_init()

◆ model_206ax_report()

static void model_206ax_report ( void  )
static

Definition at line 298 of file model_206ax_init.c.

References BIOS_INFO, cpu_get_cpuid(), cpu_get_feature_flags_ecx(), cpu_id, CPUID_AES, CPUID_SMX, CPUID_VMX, fill_processor_name(), get_platform_id(), printk, and processor_name.

Referenced by model_206ax_init().

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

◆ mp_init_cpus()

void mp_init_cpus ( struct bus cpu_bus)

Definition at line 427 of file model_206ax_init.c.

◆ per_cpu_smm_trigger()

static void per_cpu_smm_trigger ( void  )
static

Definition at line 396 of file model_206ax_init.c.

References intel_microcode_find(), intel_microcode_load_unlocked(), microcode_patch, and smm_relocate().

Here is the call graph for this function:

◆ post_mp_init()

static void post_mp_init ( void  )
static

Definition at line 406 of file model_206ax_init.c.

◆ pre_mp_init()

static void pre_mp_init ( void  )
static

Definition at line 368 of file model_206ax_init.c.

References x86_mtrr_check(), and x86_setup_mtrrs_with_detect().

Here is the call graph for this function:

◆ set_max_ratio()

static void set_max_ratio ( void  )
static

Definition at line 257 of file model_206ax_init.c.

References BIOS_DEBUG, cpu_config_tdp_levels(), msr_struct::hi, IA32_PERF_CTL, msr_struct::lo, MSR_CONFIG_TDP_NOMINAL, MSR_PLATFORM_INFO, printk, rdmsr(), SANDYBRIDGE_BCLK, and wrmsr().

Referenced by model_206ax_init().

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

◆ set_power_limits()

◆ smbios_cpu_get_current_speed_mhz()

unsigned int smbios_cpu_get_current_speed_mhz ( void  )

Definition at line 286 of file model_206ax_init.c.

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

Here is the call graph for this function:

◆ smbios_cpu_get_max_speed_mhz()

unsigned int smbios_cpu_get_max_speed_mhz ( void  )

Definition at line 279 of file model_206ax_init.c.

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

Here is the call graph for this function:

◆ smbios_processor_external_clock()

unsigned int smbios_processor_external_clock ( void  )

Definition at line 293 of file model_206ax_init.c.

References SANDYBRIDGE_BCLK.

Variable Documentation

◆ __cpu_driver

const struct cpu_driver driver __cpu_driver
static
Initial value:
= {
.ops = &cpu_dev_ops,
.id_table = cpu_table,
}
static const struct cpu_device_id cpu_table[]
static struct device_operations cpu_dev_ops

Definition at line 427 of file model_206ax_init.c.

◆ cpu_dev_ops

struct device_operations cpu_dev_ops
static
Initial value:
= {
}
static void model_206ax_init(struct device *cpu)

Definition at line 427 of file model_206ax_init.c.

◆ cpu_table

const struct cpu_device_id cpu_table[]
static
Initial value:
= {
{ X86_VENDOR_INTEL, 0x206a0 },
{ X86_VENDOR_INTEL, 0x206a6 },
{ X86_VENDOR_INTEL, 0x206a7 },
{ X86_VENDOR_INTEL, 0x306a0 },
{ X86_VENDOR_INTEL, 0x306a2 },
{ X86_VENDOR_INTEL, 0x306a4 },
{ X86_VENDOR_INTEL, 0x306a5 },
{ X86_VENDOR_INTEL, 0x306a6 },
{ X86_VENDOR_INTEL, 0x306a8 },
{ X86_VENDOR_INTEL, 0x306a9 },
{ 0, 0 },
}
#define X86_VENDOR_INTEL
Definition: cpu.h:138

Definition at line 427 of file model_206ax_init.c.

◆ 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
static void get_microcode_info(const void **microcode, int *parallel)
static void pre_mp_init(void)
static void per_cpu_smm_trigger(void)
static int get_cpu_count(void)
static void post_mp_init(void)

Definition at line 406 of file model_206ax_init.c.

◆ power_limit_time_msr_to_sec

const u8 power_limit_time_msr_to_sec[]
static
Initial value:
= {
[0x00] = 0,
[0x0a] = 1,
[0x0b] = 2,
[0x4b] = 3,
[0x0c] = 4,
[0x2c] = 5,
[0x4c] = 6,
[0x6c] = 7,
[0x0d] = 8,
[0x2d] = 10,
[0x4d] = 12,
[0x6d] = 14,
[0x0e] = 16,
[0x2e] = 20,
[0x4e] = 24,
[0x6e] = 28,
[0x0f] = 32,
[0x2f] = 40,
[0x4f] = 48,
[0x6f] = 56,
[0x10] = 64,
[0x30] = 80,
[0x50] = 96,
[0x70] = 112,
[0x11] = 128,
}

Definition at line 51 of file model_206ax_init.c.

Referenced by set_power_limits().

◆ power_limit_time_sec_to_msr

const u8 power_limit_time_sec_to_msr[]
static
Initial value:
= {
[0] = 0x00,
[1] = 0x0a,
[2] = 0x0b,
[3] = 0x4b,
[4] = 0x0c,
[5] = 0x2c,
[6] = 0x4c,
[7] = 0x6c,
[8] = 0x0d,
[10] = 0x2d,
[12] = 0x4d,
[14] = 0x6d,
[16] = 0x0e,
[20] = 0x2e,
[24] = 0x4e,
[28] = 0x6e,
[32] = 0x0f,
[40] = 0x2f,
[48] = 0x4f,
[56] = 0x6f,
[64] = 0x10,
[80] = 0x30,
[96] = 0x50,
[112] = 0x70,
[128] = 0x11,
}

Definition at line 22 of file model_206ax_init.c.

Referenced by set_power_limits().