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 <console/console.h>
#include <device/device.h>
#include <device/mmio.h>
#include <arch/smp/mpspec.h>
#include <assert.h>
#include <device/pci_ops.h>
#include <gpio.h>
#include <intelblocks/acpi.h>
#include <intelblocks/pmclib.h>
#include <intelblocks/p2sb.h>
#include <soc/iomap.h>
#include <soc/pm.h>
#include <soc/nvs.h>
#include <soc/pci_devs.h>
#include <soc/systemagent.h>
#include "chip.h"
Include dependency graph for acpi.c:

Go to the source code of this file.

Macros

#define CSTATE_RES(address_space, width, offset, address)
 

Functions

uint32_t soc_read_sci_irq_select (void)
 
void soc_write_sci_irq_select (uint32_t scis)
 
const acpi_cstate_tsoc_get_cstate_map (size_t *entries)
 
void soc_fill_gnvs (struct global_nvs *gnvs)
 
int soc_madt_sci_irq_polarity (int sci)
 
void soc_fill_fadt (acpi_fadt_t *fadt)
 
static unsigned long soc_fill_dmar (unsigned long current)
 
unsigned long sa_write_acpi_tables (const struct device *const dev, unsigned long current, struct acpi_rsdp *const rsdp)
 
void soc_power_states_generation (int core_id, int cores_per_package)
 
static void acpigen_soc_get_dw0_in_local5 (uintptr_t addr)
 
static int acpigen_soc_get_gpio_val (unsigned int gpio_num, uint32_t mask)
 
static int acpigen_soc_set_gpio_val (unsigned int gpio_num, uint32_t val)
 
int acpigen_soc_read_rx_gpio (unsigned int gpio_num)
 
int acpigen_soc_get_tx_gpio (unsigned int gpio_num)
 
int acpigen_soc_set_tx_gpio (unsigned int gpio_num)
 
int acpigen_soc_clear_tx_gpio (unsigned int gpio_num)
 

Variables

static const acpi_cstate_t cstate_map []
 

Macro Definition Documentation

◆ CSTATE_RES

#define CSTATE_RES (   address_space,
  width,
  offset,
  address 
)
Value:
{ \
.space_id = address_space, \
.bit_width = width, \
.bit_offset = offset, \
.addrl = address, \
}
static int width
Definition: bochs.c:42
static size_t offset
Definition: flashconsole.c:16
uint64_t address
Definition: fw_cfg_if.h:0

Definition at line 24 of file acpi.c.

Function Documentation

◆ acpigen_soc_clear_tx_gpio()

int acpigen_soc_clear_tx_gpio ( unsigned int  gpio_num)

Definition at line 288 of file acpi.c.

References acpigen_soc_set_gpio_val().

Here is the call graph for this function:

◆ acpigen_soc_get_dw0_in_local5()

static void acpigen_soc_get_dw0_in_local5 ( uintptr_t  addr)
static

Definition at line 206 of file acpi.c.

References acpigen_emit_byte(), acpigen_emit_namestring(), acpigen_write_integer(), acpigen_write_store(), addr, and LOCAL5_OP.

Referenced by acpigen_soc_get_gpio_val(), and acpigen_soc_set_gpio_val().

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

◆ acpigen_soc_get_gpio_val()

static int acpigen_soc_get_gpio_val ( unsigned int  gpio_num,
uint32_t  mask 
)
static

Definition at line 219 of file acpi.c.

References acpigen_pop_len(), acpigen_soc_get_dw0_in_local5(), acpigen_write_else(), acpigen_write_if_and(), acpigen_write_store_ops(), addr, assert, gpio_dwx_address(), LOCAL0_OP, LOCAL5_OP, mask, ONE_OP, TOTAL_PADS, and ZERO_OP.

Referenced by acpigen_soc_get_tx_gpio(), and acpigen_soc_read_rx_gpio().

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

◆ acpigen_soc_get_tx_gpio()

int acpigen_soc_get_tx_gpio ( unsigned int  gpio_num)

Definition at line 278 of file acpi.c.

References acpigen_soc_get_gpio_val(), and PAD_CFG0_TX_STATE.

Here is the call graph for this function:

◆ acpigen_soc_read_rx_gpio()

int acpigen_soc_read_rx_gpio ( unsigned int  gpio_num)

Definition at line 273 of file acpi.c.

References acpigen_soc_get_gpio_val(), and PAD_CFG0_RX_STATE.

Here is the call graph for this function:

◆ acpigen_soc_set_gpio_val()

static int acpigen_soc_set_gpio_val ( unsigned int  gpio_num,
uint32_t  val 
)
static

◆ acpigen_soc_set_tx_gpio()

int acpigen_soc_set_tx_gpio ( unsigned int  gpio_num)

Definition at line 283 of file acpi.c.

References acpigen_soc_set_gpio_val().

Here is the call graph for this function:

◆ sa_write_acpi_tables()

unsigned long sa_write_acpi_tables ( const struct device *const  dev,
unsigned long  current,
struct acpi_rsdp *const  rsdp 
)

◆ soc_fill_dmar()

◆ soc_fill_fadt()

◆ soc_fill_gnvs()

◆ soc_get_cstate_map()

const acpi_cstate_t* soc_get_cstate_map ( size_t entries)

Definition at line 64 of file acpi.c.

References ARRAY_SIZE, and cstate_map.

◆ soc_madt_sci_irq_polarity()

int soc_madt_sci_irq_polarity ( int  sci)

Definition at line 94 of file acpi.c.

References MP_IRQ_POLARITY_LOW.

◆ soc_power_states_generation()

void soc_power_states_generation ( int  core_id,
int  cores_per_package 
)

Definition at line 197 of file acpi.c.

References generate_p_state_entries(), and generate_t_state_entries().

Here is the call graph for this function:

◆ soc_read_sci_irq_select()

uint32_t soc_read_sci_irq_select ( void  )

Definition at line 54 of file acpi.c.

References IRQ_REG, read32p(), and soc_read_pmc_base().

Here is the call graph for this function:

◆ soc_write_sci_irq_select()

void soc_write_sci_irq_select ( uint32_t  scis)

Definition at line 59 of file acpi.c.

References IRQ_REG, soc_read_pmc_base(), and write32p().

Referenced by set_sci_irq().

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

Variable Documentation

◆ cstate_map

const acpi_cstate_t cstate_map[]
static
Initial value:
= {
{
.ctype = 1,
.latency = 1,
.power = 1000,
.resource = CSTATE_RES(ACPI_ADDRESS_SPACE_FIXED, 0, 0, 0),
},
{
.ctype = 2,
.latency = 50,
.power = 10,
.resource = CSTATE_RES(ACPI_ADDRESS_SPACE_IO, 8, 0, 0x415),
},
{
.ctype = 3,
.latency = 150,
.power = 10,
.resource = CSTATE_RES(ACPI_ADDRESS_SPACE_IO, 8, 0, 0x419),
}
}
#define ACPI_ADDRESS_SPACE_IO
Definition: acpi.h:105
#define ACPI_ADDRESS_SPACE_FIXED
Definition: acpi.h:115
#define CSTATE_RES(address_space, width, offset, address)
Definition: acpi.c:24

Definition at line 32 of file acpi.c.

Referenced by soc_get_cstate_map().