coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
acpi.c File Reference
#include <types.h>
#include <console/console.h>
#include <acpi/acpi.h>
#include <acpi/acpigen.h>
#include <arch/cpu.h>
#include <cpu/x86/msr.h>
#include <cpu/intel/speedstep.h>
#include <cpu/intel/turbo.h>
#include <device/device.h>
#include "haswell.h"
#include "chip.h"
#include <southbridge/intel/lynxpoint/pch.h>
Include dependency graph for acpi.c:

Go to the source code of this file.

Macros

#define MWAIT_RES(state, sub_state)
 

Functions

static int get_logical_cores_per_package (void)
 
static void generate_T_state_entries (int core, int cores_per_package)
 
static bool is_s0ix_enabled (void)
 
static void generate_C_state_entries (void)
 
static int calculate_power (int tdp, int p1_ratio, int ratio)
 
static void generate_P_state_entries (int core, int cores_per_package)
 
void generate_cpu_entries (const struct device *device)
 

Variables

static acpi_cstate_t cstate_map [NUM_C_STATES]
 
static const int cstate_set_s0ix [3]
 
static const int cstate_set_lp [3]
 
static const int cstate_set_trad [3]
 
static acpi_tstate_t tss_table_fine []
 
static acpi_tstate_t tss_table_coarse []
 
struct chip_operations cpu_intel_haswell_ops
 

Macro Definition Documentation

◆ MWAIT_RES

#define MWAIT_RES (   state,
  sub_state 
)
Value:
{ \
.addrl = (((state) << 4) | (sub_state)), \
.space_id = ACPI_ADDRESS_SPACE_FIXED, \
.bit_offset = ACPI_FFIXEDHW_CLASS_MWAIT, \
.access_size = ACPI_FFIXEDHW_FLAG_HW_COORD, \
}
#define ACPI_FFIXEDHW_FLAG_HW_COORD
Definition: acpi.h:120
#define ACPI_FFIXEDHW_VENDOR_INTEL
Definition: acpi.h:116
#define ACPI_FFIXEDHW_CLASS_MWAIT
Definition: acpi.h:119
#define ACPI_ADDRESS_SPACE_FIXED
Definition: acpi.h:115
state
Definition: raminit.c:1787

Definition at line 17 of file acpi.c.

Function Documentation

◆ calculate_power()

static int calculate_power ( int  tdp,
int  p1_ratio,
int  ratio 
)
static

Definition at line 207 of file acpi.c.

References m, and power.

Referenced by generate_P_state_entries().

Here is the caller graph for this function:

◆ generate_C_state_entries()

static void generate_C_state_entries ( void  )
static

Definition at line 181 of file acpi.c.

References acpigen_write_CST_package(), ARRAY_SIZE, count, cstate_map, cstate_set_lp, cstate_set_s0ix, cstate_set_trad, acpi_cstate::ctype, haswell_is_ult(), and is_s0ix_enabled().

Here is the call graph for this function:

◆ generate_cpu_entries()

void generate_cpu_entries ( const struct device device)

Definition at line 334 of file acpi.c.

Referenced by cpu_fill_ssdt(), and mc_gen_ssdt().

Here is the caller graph for this function:

◆ generate_P_state_entries()

◆ generate_T_state_entries()

static void generate_T_state_entries ( int  core,
int  cores_per_package 
)
static

◆ get_logical_cores_per_package()

static int get_logical_cores_per_package ( void  )
static

Definition at line 108 of file acpi.c.

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

Here is the call graph for this function:

◆ is_s0ix_enabled()

static bool is_s0ix_enabled ( void  )
static

Definition at line 166 of file acpi.c.

References device::chip_info, dev_find_lapic(), haswell_is_ult(), cpu_intel_haswell_config::s0ix_enable, and SPEEDSTEP_APIC_MAGIC.

Referenced by generate_C_state_entries().

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

Variable Documentation

◆ cpu_intel_haswell_ops

struct chip_operations cpu_intel_haswell_ops
Initial value:
= {
}

Definition at line 334 of file acpi.c.

◆ cstate_map

acpi_cstate_t cstate_map[NUM_C_STATES]
static

Definition at line 26 of file acpi.c.

Referenced by generate_C_state_entries().

◆ cstate_set_lp

const int cstate_set_lp[3]
static
Initial value:
= {
}
@ C_STATE_C7S_LONG_LAT
Definition: acpi.c:35
@ C_STATE_C1E
Definition: acpi.c:29
@ C_STATE_C3
Definition: acpi.c:33

Definition at line 96 of file acpi.c.

Referenced by generate_C_state_entries().

◆ cstate_set_s0ix

const int cstate_set_s0ix[3]
static
Initial value:

Definition at line 90 of file acpi.c.

Referenced by generate_C_state_entries().

◆ cstate_set_trad

const int cstate_set_trad[3]
static
Initial value:
= {
}
@ C_STATE_C6_LONG_LAT
Definition: acpi.c:31
@ C_STATE_C1
Definition: acpi.c:28

Definition at line 102 of file acpi.c.

Referenced by generate_C_state_entries().

◆ tss_table_coarse

acpi_tstate_t tss_table_coarse[]
static
Initial value:
= {
{ 100, 1000, 0, 0x00, 0 },
{ 88, 875, 0, 0x1f, 0 },
{ 75, 750, 0, 0x1e, 0 },
{ 63, 625, 0, 0x1d, 0 },
{ 50, 500, 0, 0x1c, 0 },
{ 38, 375, 0, 0x1b, 0 },
{ 25, 250, 0, 0x1a, 0 },
{ 13, 125, 0, 0x19, 0 },
}

Definition at line 132 of file acpi.c.

Referenced by generate_T_state_entries().

◆ tss_table_fine

acpi_tstate_t tss_table_fine[]
static
Initial value:
= {
{ 100, 1000, 0, 0x00, 0 },
{ 94, 940, 0, 0x1f, 0 },
{ 88, 880, 0, 0x1e, 0 },
{ 82, 820, 0, 0x1d, 0 },
{ 75, 760, 0, 0x1c, 0 },
{ 69, 700, 0, 0x1b, 0 },
{ 63, 640, 0, 0x1a, 0 },
{ 57, 580, 0, 0x19, 0 },
{ 50, 520, 0, 0x18, 0 },
{ 44, 460, 0, 0x17, 0 },
{ 38, 400, 0, 0x16, 0 },
{ 32, 340, 0, 0x15, 0 },
{ 25, 280, 0, 0x14, 0 },
{ 19, 220, 0, 0x13, 0 },
{ 13, 160, 0, 0x12, 0 },
}

Definition at line 114 of file acpi.c.

Referenced by generate_T_state_entries().