coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
util.h File Reference
#include <boot/coreboot_tables.h>
#include <cbfs.h>
#include <commonlib/region.h>
#include <arch/cpu.h>
#include <fsp/api.h>
#include <efi/efi_datatype.h>
#include <fsp/info_header.h>
#include <memrange.h>
#include <program_loading.h>
#include <types.h>
#include <fsp/debug.h>
Include dependency graph for util.h:

Go to the source code of this file.

Data Structures

struct  hob_header
 
struct  fsp_nvs_hob2_data_region_header
 
struct  fsp_notify_params
 
struct  fsp_multi_phase_params
 
struct  hob_resource
 
union  fsp_revision
 
union  extended_fsp_revision
 
struct  fsp_load_descriptor
 

Macros

#define FSP_VER_LEN   30
 
#define FSP_ARRAY_LOAD(dst, src)
 

Typedefs

typedef asmlinkage uint32_t(* temp_ram_exit_fn) (void *param)
 
typedef asmlinkage uint32_t(* fsp_memory_init_fn) (void *raminit_upd, void **hob_list)
 
typedef asmlinkage uint32_t(* fsp_silicon_init_fn) (void *silicon_upd)
 
typedef asmlinkage uint32_t(* fsp_multi_phase_si_init_fn) (struct fsp_multi_phase_params *)
 
typedef asmlinkage uint32_t(* fsp_notify_fn) (struct fsp_notify_params *)
 

Enumerations

enum  fsp_multi_phase_action { GET_NUMBER_OF_PHASES = 0 , EXECUTE_PHASE = 1 }
 
enum  hob_type {
  HOB_TYPE_HANDOFF = 0x0001 , HOB_TYPE_MEMORY_ALLOCATION = 0x0002 , HOB_TYPE_RESOURCE_DESCRIPTOR = 0x0003 , HOB_TYPE_GUID_EXTENSION = 0x0004 ,
  HOB_TYPE_FV = 0x0005 , HOB_TYPE_CPU = 0x0006 , HOB_TYPE_MEMORY_POOL = 0x0007 , HOB_TYPE_FV2 = 0x0009 ,
  HOB_TYPE_LOAD_PEIM_UNUSED = 0x000A , HOB_TYPE_UCAPSULE = 0x000B , HOB_TYPE_UNUSED = 0xFFFE , HOB_TYPE_END_OF_HOB_LIST = 0xFFFF
}
 

Functions

void fsp_display_timestamp (void)
 
const voidfsp_get_hob_list (void)
 
voidfsp_get_hob_list_ptr (void)
 
const voidfsp_find_extension_hob_by_guid (const uint8_t *guid, size_t *size)
 
const voidfsp_find_nv_storage_data (size_t *size)
 
int fsp_find_range_hob (struct range_entry *re, const uint8_t guid[16])
 
void fsp_display_fvi_version_hob (void)
 
void fsp_find_reserved_memory (struct range_entry *re)
 
const struct hob_resourcefsp_hob_header_to_resource (const struct hob_header *hob)
 
const struct hob_headerfsp_next_hob (const struct hob_header *parent)
 
bool fsp_guid_compare (const uint8_t guid1[16], const uint8_t guid2[16])
 
void fsp_find_bootloader_tolum (struct range_entry *re)
 
void fsp_get_version (char *buf)
 
void fsp_verify_upd_header_signature (uint64_t upd_signature, uint64_t expected_signature)
 
void lb_string_platform_blob_version (struct lb_header *header)
 
void report_fspt_output (void)
 
void soc_validate_fspm_header (const struct fsp_header *hdr)
 
enum cb_err fsp_validate_component (struct fsp_header *hdr, void *fsp_blob, size_t size)
 
enum cb_err fsp_load_component (struct fsp_load_descriptor *fspld, struct fsp_header *hdr)
 
void fsp_handle_reset (uint32_t status)
 
void chipset_handle_reset (uint32_t status)
 

Variables

struct hob_header __packed
 
const uint8_t fsp_bootloader_tolum_guid [16]
 
const uint8_t fsp_nv_storage_guid [16]
 
const uint8_t fsp_reserved_memory_guid [16]
 

Macro Definition Documentation

◆ FSP_ARRAY_LOAD

#define FSP_ARRAY_LOAD (   dst,
  src 
)
Value:
do { \
_Static_assert(ARRAY_SIZE(dst) >= ARRAY_SIZE(src), "copy buffer overflow!"); \
memcpy(dst, src, sizeof(src)); \
} while (0)
#define ARRAY_SIZE(a)
Definition: helpers.h:12

Definition at line 20 of file util.h.

◆ FSP_VER_LEN

#define FSP_VER_LEN   30

Definition at line 17 of file util.h.

Typedef Documentation

◆ fsp_memory_init_fn

typedef asmlinkage uint32_t(* fsp_memory_init_fn) (void *raminit_upd, void **hob_list)

Definition at line 159 of file util.h.

◆ fsp_multi_phase_si_init_fn

typedef asmlinkage uint32_t(* fsp_multi_phase_si_init_fn) (struct fsp_multi_phase_params *)

Definition at line 162 of file util.h.

◆ fsp_notify_fn

typedef asmlinkage uint32_t(* fsp_notify_fn) (struct fsp_notify_params *)

Definition at line 163 of file util.h.

◆ fsp_silicon_init_fn

typedef asmlinkage uint32_t(* fsp_silicon_init_fn) (void *silicon_upd)

Definition at line 161 of file util.h.

◆ temp_ram_exit_fn

typedef asmlinkage uint32_t(* temp_ram_exit_fn) (void *param)

Definition at line 158 of file util.h.

Enumeration Type Documentation

◆ fsp_multi_phase_action

Enumerator
GET_NUMBER_OF_PHASES 
EXECUTE_PHASE 

Definition at line 40 of file util.h.

◆ hob_type

enum hob_type
Enumerator
HOB_TYPE_HANDOFF 
HOB_TYPE_MEMORY_ALLOCATION 
HOB_TYPE_RESOURCE_DESCRIPTOR 
HOB_TYPE_GUID_EXTENSION 
HOB_TYPE_FV 
HOB_TYPE_CPU 
HOB_TYPE_MEMORY_POOL 
HOB_TYPE_FV2 
HOB_TYPE_LOAD_PEIM_UNUSED 
HOB_TYPE_UCAPSULE 
HOB_TYPE_UNUSED 
HOB_TYPE_END_OF_HOB_LIST 

Definition at line 90 of file util.h.

Function Documentation

◆ chipset_handle_reset()

void chipset_handle_reset ( uint32_t  status)

Definition at line 9 of file fsp_reset.c.

References BIOS_DEBUG, BIOS_ERR, BUG, die(), do_cold_reset(), full_reset(), global_reset(), and printk.

Referenced by fsp_handle_reset().

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

◆ fsp_display_fvi_version_hob()

void fsp_display_fvi_version_hob ( void  )

Definition at line 290 of file hand_off_block.c.

References BIOS_DEBUG, display_fsp_version_info_hob(), fsp_get_hob_list(), fsp_guid_compare(), fsp_next_hob(), hob_header_to_struct(), HOB_TYPE_END_OF_HOB_LIST, HOB_TYPE_GUID_EXTENSION, printk, hob_header::type, and uuid_fv_info.

Referenced by soc_init_pre_device().

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

◆ fsp_display_timestamp()

void fsp_display_timestamp ( void  )

Definition at line 86 of file fsp_timestamp.c.

References BIOS_INFO, fpdt_guid, fsp_find_extension_hob_by_guid(), generic_event_record::header, perf_record_hdr::length, print_fsp_perf_timestamp(), print_fsp_timestamp_header(), printk, and fpdt_pei_ext_perf_header::table_size.

Referenced by fsp_silicon_init().

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

◆ fsp_find_bootloader_tolum()

void fsp_find_bootloader_tolum ( struct range_entry re)

Definition at line 327 of file hand_off_block.c.

References die(), fsp_bootloader_tolum_guid, and fsp_find_range_hob().

Referenced by cbmem_top_chipset(), and fsp_verify_memory_init_hobs().

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

◆ fsp_find_extension_hob_by_guid()

◆ fsp_find_nv_storage_data()

const void* fsp_find_nv_storage_data ( size_t size)

Definition at line 312 of file hand_off_block.c.

References CONFIG, fsp_find_extension_hob_by_guid(), fsp_nv_storage_guid, fsp_nv_storage_guid_2, NULL, fsp_nvs_hob2_data_region_header::nvs_data_length, and fsp_nvs_hob2_data_region_header::nvs_data_ptr.

Referenced by save_memory_training_data().

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

◆ fsp_find_range_hob()

int fsp_find_range_hob ( struct range_entry re,
const uint8_t  guid[16] 
)

Definition at line 163 of file hand_off_block.c.

References hob_resource::addr, BIOS_SPEW, find_resource_hob_by_guid(), fsp_get_hob_list(), fsp_print_guid(), hob_resource::length, printk, and range_entry_init().

Referenced by fsp_find_bootloader_tolum(), fsp_find_reserved_memory(), and smm_region().

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

◆ fsp_find_reserved_memory()

void fsp_find_reserved_memory ( struct range_entry re)

Definition at line 185 of file hand_off_block.c.

References die(), fsp_find_range_hob(), and fsp_reserved_memory_guid.

Referenced by do_fsp_post_memory_init(), and fsp_verify_memory_init_hobs().

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

◆ fsp_get_hob_list()

◆ fsp_get_hob_list_ptr()

void* fsp_get_hob_list_ptr ( void  )

Definition at line 124 of file hand_off_block.c.

References fsp_hob_list_ptr.

Referenced by do_fsp_memory_init(), and fsp_debug_before_memory_init().

Here is the caller graph for this function:

◆ fsp_get_version()

void fsp_get_version ( char *  buf)

Definition at line 166 of file util.c.

References buf, FSP_VER_LEN, fsps_hdr, fsp_revision::revision, and snprintf().

Referenced by lb_string_platform_blob_version().

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

◆ fsp_guid_compare()

bool fsp_guid_compare ( const uint8_t  guid1[16],
const uint8_t  guid2[16] 
)

Definition at line 44 of file hand_off_block.c.

References memcmp().

Referenced by find_resource_hob_by_guid(), fsp_debug_event_handler(), fsp_display_fvi_version_hob(), fsp_find_extension_hob_by_guid(), fsp_get_guid_name(), fsp_print_resource_descriptor(), soc_display_hob(), and soc_get_guid_name().

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

◆ fsp_handle_reset()

void fsp_handle_reset ( uint32_t  status)

Definition at line 92 of file util.c.

References BIOS_SPEW, chipset_handle_reset(), fsp_reset_requested(), full_reset(), printk, and system_reset().

Referenced by do_fsp_memory_init(), fsp_notify(), and fsps_return_value_handler().

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

◆ fsp_hob_header_to_resource()

const struct hob_resource* fsp_hob_header_to_resource ( const struct hob_header hob)

Definition at line 88 of file hand_off_block.c.

References hob_header_to_struct().

Referenced by find_resource_hob_by_guid(), fsp_print_guid_extension_hob(), fsp_print_resource_descriptor(), read_resources(), and soc_display_hob().

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

◆ fsp_load_component()

enum cb_err fsp_load_component ( struct fsp_load_descriptor fspld,
struct fsp_header *  hdr 
)

Definition at line 126 of file util.c.

References CONFIG, and fspm_env().

Referenced by fsps_load().

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

◆ fsp_next_hob()

const struct hob_header* fsp_next_hob ( const struct hob_header parent)

◆ fsp_validate_component()

enum cb_err fsp_validate_component ( struct fsp_header *  hdr,
void fsp_blob,
size_t  size 
)

Definition at line 29 of file util.c.

Referenced by fsp_temp_ram_exit(), and fsps_load().

Here is the caller graph for this function:

◆ fsp_verify_upd_header_signature()

void fsp_verify_upd_header_signature ( uint64_t  upd_signature,
uint64_t  expected_signature 
)

Definition at line 180 of file util.c.

References die_with_post_code, and POST_INVALID_VENDOR_BINARY.

Referenced by do_fsp_memory_init(), and do_silicon_init().

Here is the caller graph for this function:

◆ lb_string_platform_blob_version()

void lb_string_platform_blob_version ( struct lb_header header)

Definition at line 193 of file util.c.

References ALIGN_UP, fsp_get_version(), FSP_VER_LEN, fsp_version, header, lb_new_record(), LB_TAG_PLATFORM_BLOB_VERSION, memcpy(), lb_string::size, lb_string::string, strlen(), and lb_string::tag.

Here is the call graph for this function:

◆ report_fspt_output()

void report_fspt_output ( void  )

Definition at line 11 of file fspt_report.c.

References _car_region_size, _car_region_start, BIOS_DEBUG, BIOS_ERR, region::offset, printk, region_is_subregion(), region::size, temp_memory_end, and temp_memory_start.

Referenced by bootblock_soc_init().

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

◆ soc_validate_fspm_header()

void soc_validate_fspm_header ( const struct fsp_header *  hdr)

Definition at line 207 of file util.c.

References BIOS_INFO, BIOS_WARNING, amd_image_revision::build, die(), amd_image_revision::major, amd_image_revision::minor, printk, and amd_image_revision::revision.

Here is the call graph for this function:

Variable Documentation

◆ __packed

◆ fsp_bootloader_tolum_guid

const uint8_t fsp_bootloader_tolum_guid[16]
extern

Definition at line 15 of file hand_off_block.c.

Referenced by fsp_find_bootloader_tolum().

◆ fsp_nv_storage_guid

const uint8_t fsp_nv_storage_guid[16]
extern

Definition at line 30 of file hand_off_block.c.

Referenced by fsp_find_nv_storage_data().

◆ fsp_reserved_memory_guid

const uint8_t fsp_reserved_memory_guid[16]
extern

Definition at line 20 of file hand_off_block.c.

Referenced by fsp_find_reserved_memory().