coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
StmPlatformResource.c File Reference
#include <stdint.h>
#include <security/intel/stm/StmApi.h>
#include <security/intel/stm/SmmStm.h>
#include <security/intel/stm/StmPlatformResource.h>
#include <soc/pm.h>
#include <cpu/x86/msr.h>
#include <console/console.h>
Include dependency graph for StmPlatformResource.c:

Go to the source code of this file.

Data Structures

struct  MSR_TABLE_ENTRY
 

Macros

#define RDWR_ACCS   3
 
#define FULL_ACCS   7
 

Functions

static void fixup_pciex_resource (void)
 
static void add_simple_resources (void)
 
static void add_msr_resources (void)
 
void add_resources_cmd (void)
 

Variables

static STM_RSC_MEM_DESC rsc_tseg_memory
 
static STM_RSC_MEM_DESC rsc_spi_memory
 
static STM_RSC_IO_DESC rsc_pm_io = {{IO_RANGE, sizeof(STM_RSC_IO_DESC)}, 0, 128}
 
static STM_RSC_MMIO_DESC rsc_pcie_mmio
 
static STM_RSC_MMIO_DESC rsc_apic_mmio
 
static STM_RSC_TRAPPED_IO_DESC rsc_sw_smi_trap_io
 
static STM_RSC_END rsc_list_end
 
STM_RSC_PCI_CFG_DESC rsc_lpc_bridge_pci
 
STM_RSC_MSR_DESC rsc_msr_tpl
 
MSR_TABLE_ENTRY msr_table []
 
uint8_tm_stm_resources_ptr
 

Macro Definition Documentation

◆ FULL_ACCS

#define FULL_ACCS   7

Definition at line 17 of file StmPlatformResource.c.

◆ RDWR_ACCS

#define RDWR_ACCS   3

Definition at line 16 of file StmPlatformResource.c.

Function Documentation

◆ add_msr_resources()

static void add_msr_resources ( void  )
static

Definition at line 149 of file StmPlatformResource.c.

References add_pi_resource(), ARRAY_SIZE, BIOS_DEBUG, STM_RSC_MSR_DESC::msr_index, msr_table, printk, STM_RSC_MSR_DESC::read_mask, rsc_msr_tpl, and STM_RSC_MSR_DESC::write_mask.

Referenced by add_resources_cmd().

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

◆ add_resources_cmd()

void add_resources_cmd ( void  )

Definition at line 173 of file StmPlatformResource.c.

References add_msr_resources(), add_simple_resources(), m_stm_resources_ptr, and NULL.

Referenced by stm_setup().

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

◆ add_simple_resources()

◆ fixup_pciex_resource()

static void fixup_pciex_resource ( void  )
static

Definition at line 98 of file StmPlatformResource.c.

References STM_RSC_MMIO_DESC::base, STM_RSC_MMIO_DESC::length, and rsc_pcie_mmio.

Referenced by add_simple_resources().

Here is the caller graph for this function:

Variable Documentation

◆ m_stm_resources_ptr

uint8_t* m_stm_resources_ptr
extern

◆ msr_table

MSR_TABLE_ENTRY msr_table[]
Initial value:
= {
}
#define MASK64
#define MASK0
#define SMRR_PHYSBASE_MSR
Definition: msr.h:54
#define SMRR_PHYSMASK_MSR
Definition: msr.h:55

Definition at line 88 of file StmPlatformResource.c.

Referenced by add_msr_resources().

◆ rsc_apic_mmio

STM_RSC_MMIO_DESC rsc_apic_mmio
static
Initial value:
0,
0x400,
#define MMIO_RANGE
Definition: StmApi.h:328
#define RDWR_ACCS

Definition at line 44 of file StmPlatformResource.c.

Referenced by add_simple_resources().

◆ rsc_list_end

STM_RSC_END rsc_list_end
static
Initial value:
= {
#define END_OF_RESOURCES
Definition: StmApi.h:325

Definition at line 56 of file StmPlatformResource.c.

◆ rsc_lpc_bridge_pci

STM_RSC_PCI_CFG_DESC rsc_lpc_bridge_pci
Initial value:
= {
0,
0,
0x1000,
0,
0,
{
},
}
#define PCI_CFG_RANGE
Definition: StmApi.h:330
#define LPC_DEVICE
#define LPC_FUNCTION

Definition at line 62 of file StmPlatformResource.c.

Referenced by add_simple_resources().

◆ rsc_msr_tpl

STM_RSC_MSR_DESC rsc_msr_tpl
Initial value:
= {
}
#define MACHINE_SPECIFIC_REG
Definition: StmApi.h:329

Definition at line 77 of file StmPlatformResource.c.

Referenced by add_msr_resources().

◆ rsc_pcie_mmio

STM_RSC_MMIO_DESC rsc_pcie_mmio
static
Initial value:
0,
0,

Definition at line 38 of file StmPlatformResource.c.

Referenced by add_simple_resources(), and fixup_pciex_resource().

◆ rsc_pm_io

STM_RSC_IO_DESC rsc_pm_io = {{IO_RANGE, sizeof(STM_RSC_IO_DESC)}, 0, 128}
static

Definition at line 35 of file StmPlatformResource.c.

Referenced by add_simple_resources().

◆ rsc_spi_memory

STM_RSC_MEM_DESC rsc_spi_memory
static
Initial value:
= {
0xFE000000,
0x01000000,
#define MEM_RANGE
Definition: StmApi.h:326
#define FULL_ACCS

Definition at line 28 of file StmPlatformResource.c.

Referenced by add_simple_resources().

◆ rsc_sw_smi_trap_io

STM_RSC_TRAPPED_IO_DESC rsc_sw_smi_trap_io
static
Initial value:
= {
0xB2,
2}
#define TRAPPED_IO_RANGE
Definition: StmApi.h:331

Definition at line 50 of file StmPlatformResource.c.

Referenced by add_simple_resources().

◆ rsc_tseg_memory

STM_RSC_MEM_DESC rsc_tseg_memory
static
Initial value:
0,
0,

Definition at line 22 of file StmPlatformResource.c.

Referenced by add_simple_resources().