coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
acpi.c File Reference
#include <acpi/acpi.h>
#include <acpi/acpi_gnvs.h>
#include <acpi/acpigen.h>
#include <arch/ioapic.h>
#include <arch/smp/mpspec.h>
#include <device/mmio.h>
#include <console/console.h>
#include <cpu/intel/turbo.h>
#include <cpu/x86/msr.h>
#include <cpu/x86/smm.h>
#include <device/pci.h>
#include <drivers/intel/gma/opregion.h>
#include <soc/acpi.h>
#include <soc/device_nvs.h>
#include <soc/gfx.h>
#include <soc/iomap.h>
#include <soc/irq.h>
#include <soc/msr.h>
#include <soc/nvs.h>
#include <soc/pattrs.h>
#include <soc/pci_devs.h>
#include <soc/pm.h>
#include <string.h>
#include <types.h>
#include <wrdd.h>
#include "chip.h"
Include dependency graph for acpi.c:

Go to the source code of this file.

Macros

#define MWAIT_RES(state, sub_state)
 

Functions

size_t size_of_dnvs (void)
 
void soc_fill_gnvs (struct global_nvs *gnvs)
 
int acpi_sci_irq (void)
 
static void generate_t_state_entries (int core, int cores_per_package)
 
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)
 Generate ACPI entries for Speedstep for each cpu. More...
 
static unsigned long acpi_madt_irq_overrides (unsigned long current)
 
unsigned long acpi_fill_madt (unsigned long current)
 
unsigned long southcluster_write_acpi_tables (const struct device *device, unsigned long current, struct acpi_rsdp *rsdp)
 
__weak void acpi_create_serialio_ssdt (acpi_header_t *ssdt)
 

Variables

static const acpi_cstate_t cstate_map []
 
static acpi_tstate_t soc_tss_table []
 

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 31 of file acpi.c.

Function Documentation

◆ acpi_create_serialio_ssdt()

__weak void acpi_create_serialio_ssdt ( acpi_header_t ssdt)

Definition at line 371 of file acpi.c.

Referenced by southbridge_write_acpi_tables(), and southcluster_write_acpi_tables().

Here is the caller graph for this function:

◆ acpi_fill_madt()

unsigned long acpi_fill_madt ( unsigned long  current)

Definition at line 329 of file acpi.c.

References acpi_create_madt_ioapic(), acpi_create_madt_lapics(), acpi_madt_irq_overrides(), and IO_APIC_ADDR.

Here is the call graph for this function:

◆ acpi_madt_irq_overrides()

static unsigned long acpi_madt_irq_overrides ( unsigned long  current)
static

Definition at line 308 of file acpi.c.

References acpi_create_madt_irqoverride(), acpi_sci_irq(), MP_IRQ_POLARITY_HIGH, MP_IRQ_POLARITY_LOW, and MP_IRQ_TRIGGER_LEVEL.

Here is the call graph for this function:

◆ acpi_sci_irq()

int acpi_sci_irq ( void  )

Definition at line 84 of file acpi.c.

References ACTL, BIOS_DEBUG, ILB_BASE_ADDRESS, printk, read32(), SCIS_IRQ10, SCIS_IRQ11, SCIS_IRQ20, SCIS_IRQ21, SCIS_IRQ22, SCIS_IRQ23, SCIS_IRQ9, and SCIS_MASK.

Here is the call graph for this function:

◆ calculate_power()

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

Definition at line 143 of file acpi.c.

References m, and power.

Referenced by generate_p_state_entries().

Here is the caller graph for this function:

◆ generate_cpu_entries()

void generate_cpu_entries ( const struct device device)

◆ generate_p_state_entries()

◆ generate_t_state_entries()

static void generate_t_state_entries ( int  core,
int  cores_per_package 
)
static

Definition at line 128 of file acpi.c.

References acpigen_write_empty_PTC(), acpigen_write_TPC(), acpigen_write_TSD_package(), acpigen_write_TSS_package(), ARRAY_SIZE, soc_tss_table, and SW_ALL.

Referenced by generate_cpu_entries().

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

◆ size_of_dnvs()

size_t size_of_dnvs ( void  )

Definition at line 66 of file acpi.c.

◆ soc_fill_gnvs()

void soc_fill_gnvs ( struct global_nvs gnvs)

Definition at line 71 of file acpi.c.

References global_nvs::cid1, config, CONFIG, config_of_soc, global_nvs::dpte, gnvs, wifi_regulatory_domain(), and WRDD_DEFAULT_REGULATORY_DOMAIN.

Here is the call graph for this function:

◆ southcluster_write_acpi_tables()

unsigned long southcluster_write_acpi_tables ( const struct device device,
unsigned long  current,
struct acpi_rsdp rsdp 
)

Definition at line 342 of file acpi.c.

References acpi_add_table(), acpi_align_current(), acpi_create_serialio_ssdt(), acpi_write_hpet(), BIOS_DEBUG, CONFIG, acpi_table_header::length, memset(), NULL, and printk.

Here is the call graph for this function:

Variable Documentation

◆ cstate_map

const acpi_cstate_t cstate_map[]
static
Initial value:
= {
{
.ctype = 1,
.latency = 1,
.power = 1000,
.resource = MWAIT_RES(0, 0),
},
{
.ctype = 2,
.latency = 500,
.power = 10,
.resource = MWAIT_RES(5, 1),
},
{
.ctype = 3,
.latency = 1500,
.power = 1,
.resource = MWAIT_RES(5, 2),
}
}
#define MWAIT_RES(state, sub_state)
Definition: acpi.c:31

Definition at line 41 of file acpi.c.

Referenced by generate_cpu_entries().

◆ soc_tss_table

acpi_tstate_t soc_tss_table[]
static
Initial value:
= {
{ 100, 1000, 0, 0x00, 0 },
{ 88, 875, 0, 0x1e, 0 },
{ 75, 750, 0, 0x1c, 0 },
{ 63, 625, 0, 0x1a, 0 },
{ 50, 500, 0, 0x18, 0 },
{ 38, 375, 0, 0x16, 0 },
{ 25, 250, 0, 0x14, 0 },
{ 13, 125, 0, 0x12, 0 },
}

Definition at line 117 of file acpi.c.

Referenced by generate_t_state_entries().