coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
ramstage.c File Reference
#include <assert.h>
#include <console/console.h>
#include <drivers/ipmi/ipmi_ops.h>
#include <drivers/ocp/dmi/ocp_dmi.h>
#include <drivers/vpd/vpd.h>
#include <security/intel/txt/txt.h>
#include <soc/ramstage.h>
#include <soc/soc_util.h>
#include <stdio.h>
#include <string.h>
#include <smbios.h>
#include <device/pci_def.h>
#include <device/pci_ops.h>
#include <soc/util.h>
#include <hob_iiouds.h>
#include <hob_memmap.h>
#include <cpxsp_dl_gpio.h>
#include "ipmi.h"
#include "vpd.h"
Include dependency graph for ramstage.c:

Go to the source code of this file.

Data Structures

struct  slot_info
 

Macros

#define SLOT_ID_LEN   2
 
#define SPD_REGVID_LEN   6
 

Functions

void smbios_ec_revision (uint8_t *ec_major_revision, uint8_t *ec_minor_revision)
 
const char * smbios_mainboard_location_in_chassis (void)
 
u8 smbios_mainboard_feature_flags (void)
 
unsigned int smbios_cpu_get_voltage (void)
 
static void write_oem_word (uint16_t val, char *str)
 
static void dl_oem_smbios_strings (struct device *dev, struct smbios_type11 *t)
 
static int create_smbios_type9 (int *handle, unsigned long *current)
 
static int mainboard_smbios_data (struct device *dev, int *handle, unsigned long *current)
 
void smbios_fill_dimm_locator (const struct dimm_info *dimm, struct smbios_type17 *t)
 
unsigned int smbios_processor_family (struct cpuid_result res)
 
unsigned int smbios_processor_characteristics (void)
 
static void mainboard_enable (struct device *dev)
 
void mainboard_silicon_init_params (FSPS_UPD *params)
 
static void mainboard_final (void *chip_info)
 
bool skip_intel_txt_lockdown (void)
 

Variables

struct fru_info_str fru_strings
 
static char slot_id_str [SLOT_ID_LEN]
 
slot_info slotinfo []
 
static const struct port_information smbios_type8_info []
 
struct chip_operations mainboard_ops
 

Macro Definition Documentation

◆ SLOT_ID_LEN

#define SLOT_ID_LEN   2

Definition at line 24 of file ramstage.c.

◆ SPD_REGVID_LEN

#define SPD_REGVID_LEN   6

Definition at line 107 of file ramstage.c.

Function Documentation

◆ create_smbios_type9()

◆ dl_oem_smbios_strings()

static void dl_oem_smbios_strings ( struct device dev,
struct smbios_type11 t 
)
static

◆ mainboard_enable()

static void mainboard_enable ( struct device dev)
static

Definition at line 337 of file ramstage.c.

References dl_oem_smbios_strings(), fru_strings, mainboard_smbios_data(), device::ops, and read_fru_areas().

Here is the call graph for this function:

◆ mainboard_final()

static void mainboard_final ( void chip_info)
static

Definition at line 350 of file ramstage.c.

◆ mainboard_silicon_init_params()

void mainboard_silicon_init_params ( FSPS_UPD *  params)

Definition at line 344 of file ramstage.c.

References ARRAY_SIZE, gpio_configure_pads(), and gpio_table.

Here is the call graph for this function:

◆ mainboard_smbios_data()

static int mainboard_smbios_data ( struct device dev,
int *  handle,
unsigned long *  current 
)
static

Definition at line 299 of file ramstage.c.

References ARRAY_SIZE, create_smbios_type9(), smbios_type8_info, and smbios_write_type8().

Referenced by mainboard_enable().

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

◆ skip_intel_txt_lockdown()

bool skip_intel_txt_lockdown ( void  )

Definition at line 359 of file ramstage.c.

References BIOS_DEBUG, BIOS_INFO, printk, SKIP_INTEL_TXT_LOCKDOWN, SKIP_INTEL_TXT_LOCKDOWN_DEFAULT, vpd_get_bool(), and VPD_RW_THEN_RO.

Referenced by dmi3_init(), iio_dfx_global_init(), and lockdown_intel_txt().

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

◆ smbios_cpu_get_voltage()

unsigned int smbios_cpu_get_voltage ( void  )

Definition at line 73 of file ramstage.c.

◆ smbios_ec_revision()

void smbios_ec_revision ( uint8_t ec_major_revision,
uint8_t ec_minor_revision 
)

Definition at line 35 of file ramstage.c.

References ipmi_bmc_version().

Here is the call graph for this function:

◆ smbios_fill_dimm_locator()

void smbios_fill_dimm_locator ( const struct dimm_info dimm,
struct smbios_type17 t 
)

Definition at line 315 of file ramstage.c.

References smbios_type17::bank_locator, buf, dimm_info::channel_num, smbios_type17::device_locator, smbios_type17::eos, smbios_add_string(), and snprintf().

Here is the call graph for this function:

◆ smbios_mainboard_feature_flags()

u8 smbios_mainboard_feature_flags ( void  )

◆ smbios_mainboard_location_in_chassis()

const char* smbios_mainboard_location_in_chassis ( void  )

Definition at line 45 of file ramstage.c.

References BIOS_ERR, CB_SUCCESS, ipmi_get_slot_id(), PCIE_CONFIG_D, printk, SLOT_ID_LEN, slot_id_str, and snprintf().

Here is the call graph for this function:

◆ smbios_processor_characteristics()

unsigned int smbios_processor_characteristics ( void  )

Definition at line 331 of file ramstage.c.

◆ smbios_processor_family()

unsigned int smbios_processor_family ( struct cpuid_result  res)

Definition at line 326 of file ramstage.c.

◆ write_oem_word()

static void write_oem_word ( uint16_t  val,
char *  str 
)
static

Definition at line 109 of file ramstage.c.

References snprintf(), SPD_REGVID_LEN, and val.

Referenced by dl_oem_smbios_strings().

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

Variable Documentation

◆ fru_strings

struct fru_info_str fru_strings
extern

Definition at line 1 of file smbios.c.

Referenced by mainboard_enable(), and tp_oem_smbios_strings().

◆ mainboard_ops

struct chip_operations mainboard_ops
Initial value:
= {
.enable_dev = mainboard_enable,
.final = mainboard_final,
}
static void mainboard_final(void *chip_info)
Definition: ramstage.c:350
static void mainboard_enable(struct device *dev)
Definition: ramstage.c:337

Definition at line 350 of file ramstage.c.

◆ slot_id_str

char slot_id_str[SLOT_ID_LEN]
static

Definition at line 27 of file ramstage.c.

Referenced by smbios_mainboard_location_in_chassis().

◆ slotinfo

slot_info slotinfo[]
Initial value:
= {
{CSTACK, SlotTypePciExpressGen3X4, SlotDataBusWidth4X, 0xE8, "SSD1_M2_Data_Drive"},
{PSTACK1, SlotTypePciExpressGen3X4, SlotDataBusWidth4X, 0x10, "SSD0_M2_Boot_Drive"},
{PSTACK1, SlotTypePciExpressGen3X4, SlotDataBusWidth4X, 0x18, "BB_OCP_NIC"},
{PSTACK2, SlotTypePciExpressGen3X16, SlotDataBusWidth16X, 0x00, "1OU_OCP_NIC"},
{PSTACK0, SlotTypePciExpressGen3X4, SlotDataBusWidth4X, 0x00, "2OU_JD1_M2_0"},
{PSTACK0, SlotTypePciExpressGen3X4, SlotDataBusWidth4X, 0x08, "2OU_JD1_M2_1"},
{PSTACK1, SlotTypePciExpressGen3X4, SlotDataBusWidth4X, 0x08, "2OU_JD2_M2_2"},
{PSTACK1, SlotTypePciExpressGen3X4, SlotDataBusWidth4X, 0x00, "2OU_JD2_M2_3"},
{PSTACK0, SlotTypePciExpressGen3X4, SlotDataBusWidth4X, 0x10, "2OU_JD3_M2_4"},
{PSTACK0, SlotTypePciExpressGen3X4, SlotDataBusWidth4X, 0x18, "2OU_JD3_M2_5"},
{PSTACK2, SlotTypePciExpressGen3X4, SlotDataBusWidth4X, 0x18, "1OU_JD1_M2_0"},
{PSTACK2, SlotTypePciExpressGen3X4, SlotDataBusWidth4X, 0x10, "1OU_JD1_M2_1"},
{PSTACK2, SlotTypePciExpressGen3X4, SlotDataBusWidth4X, 0x08, "1OU_JD2_M2_2"},
{PSTACK2, SlotTypePciExpressGen3X4, SlotDataBusWidth4X, 0x00, "1OU_JD2_M2_3"},
}
@ SlotTypePciExpressGen3X16
Definition: smbios.h:727
@ SlotTypePciExpressGen3X4
Definition: smbios.h:725
@ SlotDataBusWidth16X
Definition: smbios.h:750
@ SlotDataBusWidth4X
Definition: smbios.h:747

Definition at line 90 of file ramstage.c.

Referenced by create_smbios_type9().

◆ smbios_type8_info

const struct port_information smbios_type8_info[]
static
Initial value:
= {
{
.internal_reference_designator = "JCN18 - CPU MIPI60",
.internal_connector_type = CONN_OTHER,
.external_reference_designator = "",
.external_connector_type = CONN_NONE,
.port_type = TYPE_OTHER_PORT
},
{
.internal_reference_designator = "JCN32 - TPM_CONN",
.internal_connector_type = CONN_OTHER,
.external_reference_designator = "",
.external_connector_type = CONN_NONE,
.port_type = TYPE_OTHER_PORT
},
{
.internal_reference_designator = "JCN7 - USB type C",
.internal_connector_type = CONN_USB_TYPE_C,
.external_reference_designator = "",
.external_connector_type = CONN_NONE,
.port_type = TYPE_USB
},
}
@ CONN_USB_TYPE_C
Definition: smbios.h:598
@ CONN_OTHER
Definition: smbios.h:604
@ CONN_NONE
Definition: smbios.h:563
@ TYPE_USB
Definition: smbios.h:625
@ TYPE_OTHER_PORT
Definition: smbios.h:647

Definition at line 114 of file ramstage.c.

Referenced by mainboard_smbios_data().