coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
systemagent.c File Reference
#include <cbmem.h>
#include <console/console.h>
#include <cpu/cpu.h>
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_ids.h>
#include <intelblocks/acpi.h>
#include <intelblocks/cfg.h>
#include <intelblocks/systemagent.h>
#include <smbios.h>
#include <soc/iomap.h>
#include <soc/nvs.h>
#include <soc/pci_devs.h>
#include <soc/systemagent.h>
#include <types.h>
#include "systemagent_def.h"
Include dependency graph for systemagent.c:

Go to the source code of this file.

Functions

__weak void soc_systemagent_init (struct device *dev)
 
__weak void soc_add_fixed_mmio_resources (struct device *dev, int *resource_cnt)
 
__weak int soc_get_uncore_prmmr_base_and_mask (uint64_t *base, uint64_t *mask)
 
__weak unsigned long sa_write_acpi_tables (const struct device *dev, unsigned long current, struct acpi_rsdp *rsdp)
 
__weak uint32_t soc_systemagent_max_chan_capacity_mib (u8 capid0_a_ddrsz)
 
static uint8_t sa_get_ecc_type (const uint32_t capid0_a)
 
static size_t sa_slots_per_channel (const uint32_t capid0_a)
 
static size_t sa_number_of_channels (const uint32_t capid0_a)
 
static void sa_soc_systemagent_init (struct device *dev)
 
void sa_add_fixed_mmio_resources (struct device *dev, int *resource_cnt, const struct sa_mmio_descriptor *sa_fixed_resources, size_t count)
 
static void sa_read_map_entry (struct device *dev, const struct sa_mem_map_descriptor *entry, uint64_t *result)
 
void sa_fill_gnvs (struct global_nvs *gnvs)
 
static void sa_get_mem_map (struct device *dev, uint64_t *values)
 
static void sa_add_dram_resources (struct device *dev, int *resource_count)
 
static bool is_imr_enabled (uint32_t imr_base_reg)
 
static void imr_resource (struct device *dev, int idx, uint32_t base, uint32_t mask)
 
static void sa_add_imr_resources (struct device *dev, int *resource_cnt)
 
static void systemagent_read_resources (struct device *dev)
 
void enable_power_aware_intr (void)
 
void sa_lock_pam (void)
 

Variables

static const struct sa_mem_map_descriptor sa_memory_map [MAX_MAP_ENTRIES]
 
static struct device_operations systemagent_ops
 
static const unsigned short systemagent_ids []
 
static const struct pci_driver systemagent_driver __pci_driver
 

Function Documentation

◆ enable_power_aware_intr()

void enable_power_aware_intr ( void  )

Definition at line 298 of file systemagent.c.

References MCH_PAIR, and MCHBAR8.

Referenced by soc_systemagent_init().

Here is the caller graph for this function:

◆ imr_resource()

static void imr_resource ( struct device dev,
int  idx,
uint32_t  base,
uint32_t  mask 
)
static

Definition at line 239 of file systemagent.c.

References base, mask, and reserved_ram_resource.

Referenced by sa_add_imr_resources().

Here is the caller graph for this function:

◆ is_imr_enabled()

static bool is_imr_enabled ( uint32_t  imr_base_reg)
static

Definition at line 234 of file systemagent.c.

Referenced by sa_add_imr_resources().

Here is the caller graph for this function:

◆ sa_add_dram_resources()

static void sa_add_dram_resources ( struct device dev,
int *  resource_count 
)
static

Definition at line 187 of file systemagent.c.

References cbmem_top(), GiB, KiB, MAX_MAP_ENTRIES, MiB, mmio_resource, ram_resource, reserved_ram_resource, sa_get_mem_map(), SA_TOLUD_REG, and SA_TOUUD_REG.

Referenced by systemagent_read_resources().

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

◆ sa_add_fixed_mmio_resources()

void sa_add_fixed_mmio_resources ( struct device dev,
int *  resource_cnt,
const struct sa_mmio_descriptor sa_fixed_resources,
size_t  count 
)

Definition at line 87 of file systemagent.c.

References base, sa_mmio_descriptor::base, count, KiB, mmio_resource, and sa_mmio_descriptor::size.

Referenced by soc_add_fixed_mmio_resources().

Here is the caller graph for this function:

◆ sa_add_imr_resources()

static void sa_add_imr_resources ( struct device dev,
int *  resource_cnt 
)
static

Definition at line 259 of file systemagent.c.

References base, imr_resource(), is_imr_enabled(), mask, MCH_IMR0_BASE, MCH_IMR0_MASK, MCH_IMR_PITCH, MCH_NUM_IMRS, and MCHBAR32.

Referenced by systemagent_read_resources().

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

◆ sa_fill_gnvs()

void sa_fill_gnvs ( struct global_nvs gnvs)

Definition at line 140 of file systemagent.c.

References global_nvs::a4gb, global_nvs::a4gs, BIOS_DEBUG, cpu_phys_address_size(), gnvs, pcidev_path_on_root(), POWER_OF_2, printk, SA_DEVFN_ROOT, sa_memory_map, sa_read_map_entry(), and SA_TOUUD_REG.

Referenced by soc_fill_gnvs().

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

◆ sa_get_ecc_type()

static uint8_t sa_get_ecc_type ( const uint32_t  capid0_a)
static

Definition at line 51 of file systemagent.c.

References CAPID_ECCDIS, MEMORY_ARRAY_ECC_NONE, and MEMORY_ARRAY_ECC_SINGLE_BIT.

Referenced by sa_soc_systemagent_init().

Here is the caller graph for this function:

◆ sa_get_mem_map()

static void sa_get_mem_map ( struct device dev,
uint64_t values 
)
static

Definition at line 150 of file systemagent.c.

References MAX_MAP_ENTRIES, sa_memory_map, and sa_read_map_entry().

Referenced by sa_add_dram_resources().

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

◆ sa_lock_pam()

void sa_lock_pam ( void  )

Definition at line 309 of file systemagent.c.

References PAM0, PAM_LOCK, pci_or_config8(), pcidev_path_on_root(), and SA_DEVFN_ROOT.

Referenced by sa_lockdown_config().

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

◆ sa_number_of_channels()

static size_t sa_number_of_channels ( const uint32_t  capid0_a)
static

Definition at line 61 of file systemagent.c.

References CAPID_PDCD.

Referenced by sa_soc_systemagent_init().

Here is the caller graph for this function:

◆ sa_read_map_entry()

static void sa_read_map_entry ( struct device dev,
const struct sa_mem_map_descriptor entry,
uint64_t result 
)
static

Definition at line 122 of file systemagent.c.

References ALIGN_DOWN, sa_mem_map_descriptor::is_64_bit, MiB, pci_read_config32(), sa_mem_map_descriptor::reg, and value.

Referenced by sa_fill_gnvs(), and sa_get_mem_map().

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

◆ sa_slots_per_channel()

static size_t sa_slots_per_channel ( const uint32_t  capid0_a)
static

Definition at line 56 of file systemagent.c.

References CAPID_DDPCD.

Referenced by sa_soc_systemagent_init().

Here is the caller graph for this function:

◆ sa_soc_systemagent_init()

static void sa_soc_systemagent_init ( struct device dev)
static

◆ sa_write_acpi_tables()

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

Definition at line 39 of file systemagent.c.

◆ soc_add_fixed_mmio_resources()

__weak void soc_add_fixed_mmio_resources ( struct device dev,
int *  resource_cnt 
)

Definition at line 26 of file systemagent.c.

◆ soc_get_uncore_prmmr_base_and_mask()

__weak int soc_get_uncore_prmmr_base_and_mask ( uint64_t base,
uint64_t mask 
)

Definition at line 32 of file systemagent.c.

◆ soc_systemagent_init()

__weak void soc_systemagent_init ( struct device dev)

Definition at line 21 of file systemagent.c.

◆ soc_systemagent_max_chan_capacity_mib()

__weak uint32_t soc_systemagent_max_chan_capacity_mib ( u8  capid0_a_ddrsz)

Definition at line 46 of file systemagent.c.

◆ systemagent_read_resources()

static void systemagent_read_resources ( struct device dev)
static

Definition at line 277 of file systemagent.c.

References CONFIG, KiB, mmio_resource, pci_dev_read_resources(), sa_add_dram_resources(), sa_add_imr_resources(), and soc_add_fixed_mmio_resources().

Here is the call graph for this function:

Variable Documentation

◆ __pci_driver

const struct pci_driver systemagent_driver __pci_driver
static
Initial value:
= {
.ops = &systemagent_ops,
.vendor = PCI_VID_INTEL,
.devices = systemagent_ids
}
static struct device_operations systemagent_ops
Definition: systemagent.c:318
static const unsigned short systemagent_ids[]
Definition: systemagent.c:329
#define PCI_VID_INTEL
Definition: pci_ids.h:2157

Definition at line 329 of file systemagent.c.

◆ sa_memory_map

const struct sa_mem_map_descriptor sa_memory_map[MAX_MAP_ENTRIES]
static
Initial value:
= {
{ TOUUD, true, "TOUUD" },
{ TOLUD, false, "TOLUD" },
{ BGSM, false, "BGSM" },
{ TSEG, false, "TSEG" },
}
#define TOLUD
Definition: host_bridge.h:61
#define TOUUD
Definition: host_bridge.h:57
#define TSEG
Definition: host_bridge.h:60
#define BGSM
Definition: host_bridge.h:59

Definition at line 87 of file systemagent.c.

Referenced by sa_fill_gnvs(), and sa_get_mem_map().

◆ systemagent_ids

const unsigned short systemagent_ids[]
static

Definition at line 329 of file systemagent.c.

◆ systemagent_ops

struct device_operations systemagent_ops
static
Initial value:
= {
.read_resources = systemagent_read_resources,
.set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
.ops_pci = &pci_dev_ops_pci,
}
static void sa_soc_systemagent_init(struct device *dev)
Definition: systemagent.c:66
static void systemagent_read_resources(struct device *dev)
Definition: systemagent.c:277
void pci_dev_enable_resources(struct device *dev)
Definition: pci_device.c:721
struct pci_operations pci_dev_ops_pci
Default device operation for PCI devices.
Definition: pci_device.c:911
void pci_dev_set_resources(struct device *dev)
Definition: pci_device.c:691

Definition at line 309 of file systemagent.c.