coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
agesa_acpi.c File Reference
#include <acpi/acpi.h>
#include <acpi/acpi_crat.h>
#include <acpi/acpi_ivrs.h>
#include <arch/cpu.h>
#include <cpu/amd/cpuid.h>
#include <cpu/amd/msr.h>
#include <FspGuids.h>
#include <soc/acpi.h>
#include <stdint.h>
#include <device/device.h>
#include <device/pci_def.h>
#include <device/pci_ops.h>
#include <amdblocks/acpi.h>
#include <amdblocks/cpu.h>
#include <amdblocks/data_fabric.h>
#include <amdblocks/ioapic.h>
#include <soc/data_fabric.h>
#include <soc/pci_devs.h>
#include <arch/mmio.h>
Include dependency graph for agesa_acpi.c:

Go to the source code of this file.

Functions

static unsigned long gen_crat_hsa_entry (struct acpi_crat_header *crat, unsigned long current)
 
static unsigned long create_crat_memory_entry (uint32_t domain, uint64_t region_base, uint64_t region_size, unsigned long current)
 
static unsigned long gen_crat_memory_entries (struct acpi_crat_header *crat, unsigned long current)
 
static unsigned long add_crat_cache_entry (struct crat_cache **cache_affinity, unsigned long current)
 
static uint8_t get_associativity (uint32_t encoded_associativity)
 
static unsigned long gen_crat_cache_entry (struct acpi_crat_header *crat, unsigned long current)
 
static uint8_t get_tlb_size (enum tlb_type type, struct crat_tlb *crat_tlb_entry, uint16_t raw_assoc_size)
 
static unsigned long add_crat_tlb_entry (struct crat_tlb **tlb_affinity, unsigned long current)
 
static unsigned long gen_crat_tlb_entry (struct acpi_crat_header *crat, unsigned long current)
 
static unsigned long acpi_fill_crat (struct acpi_crat_header *crat, unsigned long current)
 
uintptr_t agesa_write_acpi_tables (const struct device *device, uintptr_t current, acpi_rsdp_t *rsdp)
 

Function Documentation

◆ acpi_fill_crat()

static unsigned long acpi_fill_crat ( struct acpi_crat_header crat,
unsigned long  current 
)
static

Definition at line 532 of file agesa_acpi.c.

References gen_crat_cache_entry(), gen_crat_hsa_entry(), gen_crat_memory_entries(), gen_crat_tlb_entry(), and acpi_crat_header::num_nodes.

Referenced by acpi_create_crat(), and agesa_write_acpi_tables().

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

◆ add_crat_cache_entry()

static unsigned long add_crat_cache_entry ( struct crat_cache **  cache_affinity,
unsigned long  current 
)
static

Definition at line 112 of file agesa_acpi.c.

References CRAT_CACHE_FLAG_CPU_CACHE, CRAT_CACHE_FLAG_EN, CRAT_CACHE_TYPE, and memset().

Referenced by gen_crat_cache_entry().

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

◆ add_crat_tlb_entry()

static unsigned long add_crat_tlb_entry ( struct crat_tlb **  tlb_affinity,
unsigned long  current 
)
static

Definition at line 333 of file agesa_acpi.c.

References CRAT_TLB_FLAG_CPU_TLB, CRAT_TLB_FLAG_EN, CRAT_TLB_TYPE, and memset().

Referenced by gen_crat_tlb_entry().

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

◆ agesa_write_acpi_tables()

uintptr_t agesa_write_acpi_tables ( const struct device device,
uintptr_t  current,
acpi_rsdp_t rsdp 
)

◆ create_crat_memory_entry()

static unsigned long create_crat_memory_entry ( uint32_t  domain,
uint64_t  region_base,
uint64_t  region_size,
unsigned long  current 
)
static

◆ gen_crat_cache_entry()

static unsigned long gen_crat_cache_entry ( struct acpi_crat_header crat,
unsigned long  current 
)
static

Definition at line 171 of file agesa_acpi.c.

References add_crat_cache_entry(), crat_cache::associativity, CACHE_INCLUSIVE_MASK, crat_cache::cache_latency, crat_cache::cache_level, crat_cache::cache_line_size, crat_cache::cache_properties, CACHE_PROPS_0, CACHE_PROPS_1, CACHE_PROPS_2, CACHE_PROPS_3, crat_cache::cache_size, CPUID_CACHE_PROPS, cpuid_ecx(), cpuid_edx(), cpuid_ext(), CPUID_L1_TLB_CACHE_IDS, CPUID_L2_L3_CACHE_L2_TLB_IDS, CRAT_CACHE_FLAG_DATA_CACHE, CRAT_CACHE_FLAG_INSTR_CACHE, CRAT_L1_CACHE, CRAT_L2_CACHE, CRAT_L3_CACHE, cpuid_result::eax, cpuid_result::edx, crat_cache::flags, get_associativity(), get_cpu_count(), L1_DC_ASSOC_MASK, L1_DC_ASSOC_SHFT, L1_DC_LINE_SIZE_MASK, L1_DC_LINE_SIZE_SHFT, L1_DC_LINE_TAG_MASK, L1_DC_LINE_TAG_SHFT, L1_DC_SIZE_MASK, L1_DC_SIZE_SHFT, L1_IC_ASSOC_MASK, L1_IC_ASSOC_SHFT, L1_IC_LINE_SIZE_MASK, L1_IC_LINE_SIZE_SHFT, L1_IC_LINE_TAG_MASK, L1_IC_LINE_TAG_SHFT, L1_IC_SIZE_MASK, L1_IC_SIZE_SHFT, L2_DC_ASSOC_MASK, L2_DC_ASSOC_SHFT, L2_DC_LINE_SIZE_MASK, L2_DC_LINE_SIZE_SHFT, L2_DC_LINE_TAG_MASK, L2_DC_LINE_TAG_SHFT, L2_DC_SIZE_MASK, L2_DC_SIZE_SHFT, L3_DC_ASSOC_MASK, L3_DC_ASSOC_SHFT, L3_DC_LINE_SIZE_MASK, L3_DC_LINE_SIZE_SHFT, L3_DC_LINE_TAG_MASK, L3_DC_LINE_TAG_SHFT, L3_DC_SIZE_MASK, L3_DC_SIZE_SHFT, crat_cache::lines_per_tag, NULL, NUM_SHARE_CACHE_MASK, NUM_SHARE_CACHE_SHFT, crat_cache::proc_id_low, crat_cache::sibling_map, and acpi_crat_header::total_entries.

Referenced by acpi_fill_crat().

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

◆ gen_crat_hsa_entry()

static unsigned long gen_crat_hsa_entry ( struct acpi_crat_header crat,
unsigned long  current 
)
static

◆ gen_crat_memory_entries()

static unsigned long gen_crat_memory_entries ( struct acpi_crat_header crat,
unsigned long  current 
)
static

◆ gen_crat_tlb_entry()

static unsigned long gen_crat_tlb_entry ( struct acpi_crat_header crat,
unsigned long  current 
)
static

Definition at line 346 of file agesa_acpi.c.

References add_crat_tlb_entry(), CACHE_PROPS_0, CACHE_PROPS_1, CACHE_PROPS_2, CPUID_CACHE_PROPS, cpuid_eax(), cpuid_ebx(), cpuid_ext(), CPUID_L1_TLB_CACHE_IDS, CPUID_L2_L3_CACHE_L2_TLB_IDS, CPUID_TLB_L1L2_1G_IDS, CRAT_L1_CACHE, CRAT_L2_CACHE, CRAT_TLB_FLAG_DATA_TLB, CRAT_TLB_FLAG_INSTR_TLB, crat_tlb::data_tlb_1g_assoc, crat_tlb::data_tlb_1g_size, crat_tlb::data_tlb_2mb_assoc, crat_tlb::data_tlb_2mb_size, crat_tlb::data_tlb_4k_assoc, crat_tlb::data_tlb_4k_size, cpuid_result::eax, crat_tlb::flags, get_associativity(), get_cpu_count(), get_tlb_size(), crat_tlb::instr_tlb_1g_assoc, crat_tlb::instr_tlb_1g_size, crat_tlb::instr_tlb_2mb_assoc, crat_tlb::instr_tlb_2mb_size, crat_tlb::instr_tlb_4k_assoc, crat_tlb::instr_tlb_4k_size, L1_DAT_TLB_1G_ASSOC_MASK, L1_DAT_TLB_1G_ASSOC_SHFT, L1_DAT_TLB_1G_SIZE_MASK, L1_DAT_TLB_1G_SIZE_SHFT, L1_DAT_TLB_2M4M_ASSOC_MASK, L1_DAT_TLB_2M4M_ASSOC_SHFT, L1_DAT_TLB_2M4M_SIZE_MASK, L1_DAT_TLB_2M4M_SIZE_SHFT, L1_DAT_TLB_4K_ASSOC_MASK, L1_DAT_TLB_4K_ASSOC_SHFT, L1_DAT_TLB_4K_SIZE_MASK, L1_DAT_TLB_4K_SIZE_SHFT, L1_INST_TLB_1G_ASSOC_MASK, L1_INST_TLB_1G_ASSOC_SHFT, L1_INST_TLB_1G_SIZE_MASK, L1_INST_TLB_1G_SIZE_SHFT, L1_INST_TLB_2M4M_ASSOC_MASK, L1_INST_TLB_2M4M_ASSOC_SHFT, L1_INST_TLB_2M4M_SIZE_MASK, L1_INST_TLB_2M4M_SIZE_SHFT, L1_INST_TLB_4K_ASSOC_MASK, L1_INST_TLB_4K_ASSOC_SHFT, L1_INST_TLB_4K_SIZE_MASK, L1_INST_TLB_4K_SIZE_SHFT, L2_DAT_TLB_1G_ASSOC_MASK, L2_DAT_TLB_1G_ASSOC_SHFT, L2_DAT_TLB_1G_SIZE_MASK, L2_DAT_TLB_1G_SIZE_SHFT, L2_DAT_TLB_2M4M_ASSOC_MASK, L2_DAT_TLB_2M4M_ASSOC_SHFT, L2_DAT_TLB_2M4M_SIZE_MASK, L2_DAT_TLB_2M4M_SIZE_SHFT, L2_DAT_TLB_4K_ASSOC_SHFT, L2_DAT_TLB_4K_SIZE_MASK, L2_DAT_TLB_4K_SIZE_SHFT, L2_INST_TLB_1G_ASSOC_MASK, L2_INST_TLB_1G_ASSOC_SHFT, L2_INST_TLB_1G_SIZE_MASK, L2_INST_TLB_1G_SIZE_SHFT, L2_INST_TLB_2M4M_ASSOC_MASK, L2_INST_TLB_2M4M_ASSOC_SHFT, L2_INST_TLB_2M4M_SIZE_MASK, L2_INST_TLB_2M4M_SIZE_SHFT, L2_INST_TLB_4K_ASSOC_MASK, L2_INST_TLB_4K_ASSOC_SHFT, L2_INST_TLB_4K_SIZE_MASK, L2_INST_TLB_4K_SIZE_SHFT, NULL, NUM_SHARE_CACHE_MASK, NUM_SHARE_CACHE_SHFT, crat_tlb::proc_id_low, crat_tlb::sibling_map, tlb_1g, tlb_2m, tlb_4k, crat_tlb::tlb_level, and acpi_crat_header::total_entries.

Referenced by acpi_fill_crat().

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

◆ get_associativity()

static uint8_t get_associativity ( uint32_t  encoded_associativity)
static

Definition at line 126 of file agesa_acpi.c.

References crat_cache::associativity.

Referenced by gen_crat_cache_entry(), and gen_crat_tlb_entry().

Here is the caller graph for this function:

◆ get_tlb_size()

static uint8_t get_tlb_size ( enum tlb_type  type,
struct crat_tlb crat_tlb_entry,
uint16_t  raw_assoc_size 
)
static

Definition at line 313 of file agesa_acpi.c.

References CRAT_TLB_FLAG_1GB_BASE_256, CRAT_TLB_FLAG_2MB_BASE_256, CRAT_TLB_FLAG_4K_BASE_256, crat_tlb::flags, tlb_1g, tlb_2m, tlb_4k, and type.

Referenced by gen_crat_tlb_entry().

Here is the caller graph for this function: