coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
smbios.c File Reference
#include <console/console.h>
#include <device/device.h>
#include <drivers/ipmi/ipmi_ops.h>
#include <delay.h>
#include <cpu/x86/mp.h>
#include <timer.h>
#include <stdio.h>
#include <string.h>
#include <soc/soc_util.h>
#include <soc/util.h>
#include <smbios.h>
#include <types.h>
#include "ocp_dmi.h"
Include dependency graph for smbios.c:

Go to the source code of this file.

Macros

#define PPIN_STR_LEN   17
 

Functions

const char * smbios_system_manufacturer (void)
 
const char * smbios_system_product_name (void)
 
const char * smbios_system_serial_number (void)
 
const char * smbios_system_version (void)
 
void smbios_system_set_uuid (u8 *uuid)
 
const char * smbios_mainboard_version (void)
 
const char * smbios_mainboard_manufacturer (void)
 
const char * smbios_mainboard_product_name (void)
 
const char * smbios_mainboard_serial_number (void)
 
const char * smbios_mainboard_asset_tag (void)
 
smbios_enclosure_type smbios_mainboard_enclosure_type (void)
 
const char * smbios_chassis_version (void)
 
const char * smbios_chassis_serial_number (void)
 
const char * smbios_processor_serial_number (void)
 
static void read_remote_ppin (void *data)
 
static void wait_for_remote_ppin (void)
 
int smbios_add_oem_string (u8 *start, const char *str)
 
static void ppin_string_fixup (int i, char *ppin)
 
void ocp_oem_smbios_strings (struct device *dev, struct smbios_type11 *t)
 

Variables

struct fru_info_str fru_strings = {0}
 
msr_t xeon_sp_ppin [2] = {0}
 
static bool remote_ppin_done = false
 

Macro Definition Documentation

◆ PPIN_STR_LEN

#define PPIN_STR_LEN   17

Definition at line 18 of file smbios.c.

Function Documentation

◆ ocp_oem_smbios_strings()

◆ ppin_string_fixup()

static void ppin_string_fixup ( int  i,
char *  ppin 
)
static

Definition at line 187 of file smbios.c.

References PPIN_STR_LEN, snprintf(), and xeon_sp_ppin.

Referenced by ocp_oem_smbios_strings().

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

◆ read_remote_ppin()

static void read_remote_ppin ( void data)
static

Definition at line 144 of file smbios.c.

References read_msr_ppin(), and remote_ppin_done.

Referenced by ocp_oem_smbios_strings().

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

◆ smbios_add_oem_string()

int smbios_add_oem_string ( u8 start,
const char *  str 
)

Definition at line 164 of file smbios.c.

References stopwatch::start, strcpy(), and strlen().

Referenced by dl_oem_smbios_strings(), ocp_oem_smbios_strings(), and tp_oem_smbios_strings().

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

◆ smbios_chassis_serial_number()

const char* smbios_chassis_serial_number ( void  )

Definition at line 124 of file smbios.c.

References fru_info_str::chassis_info, fru_strings, NULL, and fru_chassis_info::serial_number.

Referenced by smbios_write_type3().

Here is the caller graph for this function:

◆ smbios_chassis_version()

const char* smbios_chassis_version ( void  )

Definition at line 116 of file smbios.c.

References fru_info_str::chassis_info, fru_chassis_info::chassis_partnumber, fru_strings, and NULL.

Referenced by smbios_write_type3().

Here is the caller graph for this function:

◆ smbios_mainboard_asset_tag()

const char* smbios_mainboard_asset_tag ( void  )

Definition at line 98 of file smbios.c.

References fru_product_info::asset_tag, fru_strings, NULL, and fru_info_str::prod_info.

Referenced by smbios_write_type2(), and smbios_write_type3().

Here is the caller graph for this function:

◆ smbios_mainboard_enclosure_type()

smbios_enclosure_type smbios_mainboard_enclosure_type ( void  )

Definition at line 107 of file smbios.c.

References fru_info_str::chassis_info, fru_chassis_info::chassis_type, fru_strings, and SMBIOS_ENCLOSURE_RACK_MOUNT_CHASSIS.

Referenced by smbios_write_type3().

Here is the caller graph for this function:

◆ smbios_mainboard_manufacturer()

const char* smbios_mainboard_manufacturer ( void  )

Definition at line 73 of file smbios.c.

References fru_info_str::board_info, fru_strings, fru_board_info::manufacturer, and NULL.

Referenced by smbios_write_type2().

Here is the caller graph for this function:

◆ smbios_mainboard_product_name()

const char* smbios_mainboard_product_name ( void  )

Definition at line 81 of file smbios.c.

References fru_info_str::board_info, fru_strings, NULL, and fru_board_info::product_name.

Referenced by smbios_write_type2().

Here is the caller graph for this function:

◆ smbios_mainboard_serial_number()

const char* smbios_mainboard_serial_number ( void  )

Definition at line 89 of file smbios.c.

References fru_info_str::board_info, fru_strings, NULL, and fru_board_info::serial_number.

Referenced by smbios_chassis_serial_number(), and smbios_write_type2().

Here is the caller graph for this function:

◆ smbios_mainboard_version()

const char* smbios_mainboard_version ( void  )

Definition at line 65 of file smbios.c.

References fru_info_str::board_info, fru_strings, NULL, and fru_board_info::part_number.

Referenced by smbios_chassis_version(), and smbios_write_type2().

Here is the caller graph for this function:

◆ smbios_processor_serial_number()

const char* smbios_processor_serial_number ( void  )

Definition at line 133 of file smbios.c.

References fru_chassis_info::chassis_custom, fru_info_str::chassis_info, fru_strings, and NULL.

Referenced by smbios_write_type4().

Here is the caller graph for this function:

◆ smbios_system_manufacturer()

const char* smbios_system_manufacturer ( void  )

Definition at line 26 of file smbios.c.

References fru_strings, fru_product_info::manufacturer, NULL, and fru_info_str::prod_info.

Referenced by smbios_write_type1(), and smbios_write_type3().

Here is the caller graph for this function:

◆ smbios_system_product_name()

const char* smbios_system_product_name ( void  )

Definition at line 34 of file smbios.c.

References fru_info_str::board_info, fru_strings, NULL, fru_info_str::prod_info, fru_product_info::product_name, and fru_board_info::product_name.

Referenced by smbios_write_type1().

Here is the caller graph for this function:

◆ smbios_system_serial_number()

const char* smbios_system_serial_number ( void  )

Definition at line 42 of file smbios.c.

References fru_strings, NULL, fru_info_str::prod_info, and fru_product_info::serial_number.

Referenced by smbios_write_type1().

Here is the caller graph for this function:

◆ smbios_system_set_uuid()

void smbios_system_set_uuid ( u8 uuid)

Definition at line 59 of file smbios.c.

References ipmi_get_system_guid().

Referenced by smbios_write_type1().

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

◆ smbios_system_version()

const char* smbios_system_version ( void  )

Definition at line 50 of file smbios.c.

References fru_strings, NULL, fru_info_str::prod_info, and fru_product_info::product_version.

Referenced by smbios_write_type1().

Here is the caller graph for this function:

◆ wait_for_remote_ppin()

static void wait_for_remote_ppin ( void  )
static

Definition at line 150 of file smbios.c.

References BIOS_ERR, mdelay(), printk, remote_ppin_done, stopwatch_expired(), and stopwatch_init_msecs_expire().

Referenced by ocp_oem_smbios_strings().

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

Variable Documentation

◆ fru_strings

◆ remote_ppin_done

bool remote_ppin_done = false
static

Definition at line 23 of file smbios.c.

Referenced by read_remote_ppin(), and wait_for_remote_ppin().

◆ xeon_sp_ppin

msr_t xeon_sp_ppin[2] = {0}

Definition at line 22 of file smbios.c.

Referenced by ipmi_set_ppin(), ocp_oem_smbios_strings(), and ppin_string_fixup().