coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
memory_init.c File Reference
#include <security/vboot/antirollback.h>
#include <arch/symbols.h>
#include <assert.h>
#include <cbfs.h>
#include <cbmem.h>
#include <cf9_reset.h>
#include <console/console.h>
#include <elog.h>
#include <fsp/api.h>
#include <fsp/util.h>
#include <memrange.h>
#include <mrc_cache.h>
#include <program_loading.h>
#include <romstage_handoff.h>
#include <string.h>
#include <symbols.h>
#include <timestamp.h>
#include <security/vboot/vboot_common.h>
#include <security/tpm/tspi.h>
#include <vb2_api.h>
#include <types.h>
#include <mode_switch.h>
Include dependency graph for memory_init.c:

Go to the source code of this file.

Data Structures

struct  fspm_context
 

Functions

static uint8_t temp_ram[CONFIG_FSP_TEMP_RAM_SIZE] __aligned (sizeof(uint64_t))
 
static void save_memory_training_data (bool s3wake, uint32_t fsp_version)
 
static void do_fsp_post_memory_init (bool s3wake, uint32_t fsp_version)
 
static void fsp_fill_mrc_cache (FSPM_ARCH_UPD *arch_upd, uint32_t fsp_version)
 
static enum cb_err check_region_overlap (const struct memranges *ranges, const char *description, uintptr_t begin, uintptr_t end)
 
static enum cb_err setup_fsp_stack_frame (FSPM_ARCH_UPD *arch_upd, const struct memranges *memmap)
 
static enum cb_err fsp_fill_common_arch_params (FSPM_ARCH_UPD *arch_upd, bool s3wake, uint32_t fsp_version, const struct memranges *memmap)
 
__weak uint8_t fsp_memory_mainboard_version (void)
 
__weak uint8_t fsp_memory_soc_version (void)
 
static uint32_t fsp_memory_settings_version (const struct fsp_header *hdr)
 
static void do_fsp_memory_init (const struct fspm_context *context, bool s3wake)
 
static voidfspm_allocator (void *arg, size_t size, const union cbfs_mdata *unused)
 
void preload_fspm (void)
 
void fsp_memory_init (bool s3wake)
 

Function Documentation

◆ __aligned()

static uint8_t temp_ram [CONFIG_FSP_TEMP_RAM_SIZE] __aligned ( sizeof(uint64_t )
static

◆ check_region_overlap()

static enum cb_err check_region_overlap ( const struct memranges ranges,
const char *  description,
uintptr_t  begin,
uintptr_t  end 
)
static

Definition at line 84 of file memory_init.c.

References assert, BIOS_SPEW, CONFIG, fsp_version, mrc_cache_current_mmap_leak(), MRC_TRAINING_DATA, NULL, and printk.

Referenced by fspm_allocator().

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

◆ do_fsp_memory_init()

◆ do_fsp_post_memory_init()

static void do_fsp_post_memory_init ( bool  s3wake,
uint32_t  fsp_version 
)
static

◆ fsp_fill_common_arch_params()

static enum cb_err fsp_fill_common_arch_params ( FSPM_ARCH_UPD *  arch_upd,
bool  s3wake,
uint32_t  fsp_version,
const struct memranges memmap 
)
static

Definition at line 84 of file memory_init.c.

Referenced by do_fsp_memory_init().

Here is the caller graph for this function:

◆ fsp_fill_mrc_cache()

static void fsp_fill_mrc_cache ( FSPM_ARCH_UPD *  arch_upd,
uint32_t  fsp_version 
)
static

Definition at line 84 of file memory_init.c.

◆ fsp_memory_init()

void fsp_memory_init ( bool  s3wake)

Definition at line 350 of file memory_init.c.

Referenced by car_stage_entry(), mainboard_romstage_entry(), and raminit().

Here is the caller graph for this function:

◆ fsp_memory_mainboard_version()

__weak uint8_t fsp_memory_mainboard_version ( void  )

Definition at line 186 of file memory_init.c.

Referenced by fsp_memory_settings_version().

Here is the caller graph for this function:

◆ fsp_memory_settings_version()

static uint32_t fsp_memory_settings_version ( const struct fsp_header *  hdr)
static

Definition at line 205 of file memory_init.c.

References CONFIG, fsp_memory_mainboard_version(), and fsp_memory_soc_version().

Referenced by do_fsp_memory_init().

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

◆ fsp_memory_soc_version()

__weak uint8_t fsp_memory_soc_version ( void  )

Definition at line 192 of file memory_init.c.

Referenced by fsp_memory_settings_version().

Here is the caller graph for this function:

◆ fspm_allocator()

static void* fspm_allocator ( void arg,
size_t  size,
const union cbfs_mdata unused 
)
static

Definition at line 325 of file memory_init.c.

References fsp_load_descriptor::arg, arg, CB_SUCCESS, check_region_overlap(), fspm_context::memmap, and NULL.

Here is the call graph for this function:

◆ preload_fspm()

void preload_fspm ( void  )

Definition at line 341 of file memory_init.c.

References BIOS_DEBUG, cbfs_preload(), CONFIG, and printk.

Here is the call graph for this function:

◆ save_memory_training_data()

static void save_memory_training_data ( bool  s3wake,
uint32_t  fsp_version 
)
static

Definition at line 28 of file memory_init.c.

References BIOS_ERR, CONFIG, fsp_find_nv_storage_data(), fsp_version, mrc_cache_stash_data(), MRC_TRAINING_DATA, and printk.

Referenced by do_fsp_post_memory_init().

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

◆ setup_fsp_stack_frame()

static enum cb_err setup_fsp_stack_frame ( FSPM_ARCH_UPD *  arch_upd,
const struct memranges memmap 
)
static

Definition at line 84 of file memory_init.c.