coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
selfboot.c File Reference
#include <commonlib/bsd/compression.h>
#include <commonlib/endian.h>
#include <console/console.h>
#include <string.h>
#include <symbols.h>
#include <cbfs.h>
#include <lib.h>
#include <bootmem.h>
#include <program_loading.h>
#include <timestamp.h>
#include <cbmem.h>
#include <types.h>
Include dependency graph for selfboot.c:

Go to the source code of this file.

Typedefs

typedef int(* checker_t) (struct cbfs_payload_segment *cbfssegs, void *args)
 

Functions

static void cbfs_decode_payload_segment (struct cbfs_payload_segment *segment, const struct cbfs_payload_segment *src)
 
static int segment_targets_type (void *dest, unsigned long memsz, enum bootmem_type dest_type)
 
static int load_one_segment (uint8_t *dest, uint8_t *src, size_t len, size_t memsz, uint32_t compression, int flags)
 
static int last_loadable_segment (struct cbfs_payload_segment *seg)
 
static int check_payload_segments (struct cbfs_payload_segment *cbfssegs, enum bootmem_type dest_type)
 
static int load_payload_segments (struct cbfs_payload_segment *cbfssegs, uintptr_t *entry)
 
__weak int payload_arch_usable_ram_quirk (uint64_t start, uint64_t size)
 
bool selfload_mapped (struct prog *payload, void *mapping, enum bootmem_type dest_type)
 
bool selfload_check (struct prog *payload, enum bootmem_type dest_type)
 
bool selfload (struct prog *payload)
 

Typedef Documentation

◆ checker_t

typedef int(* checker_t) (struct cbfs_payload_segment *cbfssegs, void *args)

Definition at line 17 of file selfboot.c.

Function Documentation

◆ cbfs_decode_payload_segment()

static void cbfs_decode_payload_segment ( struct cbfs_payload_segment segment,
const struct cbfs_payload_segment src 
)
static

Definition at line 22 of file selfboot.c.

References cbfs_payload_segment::compression, cbfs_payload_segment::len, cbfs_payload_segment::load_addr, cbfs_payload_segment::mem_len, cbfs_payload_segment::offset, read_be32(), read_be64(), and cbfs_payload_segment::type.

Referenced by check_payload_segments(), and load_payload_segments().

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

◆ check_payload_segments()

static int check_payload_segments ( struct cbfs_payload_segment cbfssegs,
enum bootmem_type  dest_type 
)
static

Definition at line 135 of file selfboot.c.

References BIOS_DEBUG, BM_MEM_INVALID, cbfs_decode_payload_segment(), cbfs_payload_segment::load_addr, cbfs_payload_segment::mem_len, PAYLOAD_SEGMENT_ENTRY, printk, segment_targets_type(), and cbfs_payload_segment::type.

Referenced by selfload_mapped().

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

◆ last_loadable_segment()

static int last_loadable_segment ( struct cbfs_payload_segment seg)
static

Definition at line 130 of file selfboot.c.

References PAYLOAD_SEGMENT_ENTRY, read_be32(), and type.

Referenced by load_payload_segments().

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

◆ load_one_segment()

static int load_one_segment ( uint8_t dest,
uint8_t src,
size_t  len,
size_t  memsz,
uint32_t  compression,
int  flags 
)
static

◆ load_payload_segments()

◆ payload_arch_usable_ram_quirk()

__weak int payload_arch_usable_ram_quirk ( uint64_t  start,
uint64_t  size 
)

Definition at line 232 of file selfboot.c.

Referenced by segment_targets_type().

Here is the caller graph for this function:

◆ segment_targets_type()

static int segment_targets_type ( void dest,
unsigned long  memsz,
enum bootmem_type  dest_type 
)
static

Definition at line 33 of file selfboot.c.

References BIOS_ERR, bootmem_dump_ranges(), bootmem_region_targets_type(), ENV_RAMSTAGE, payload_arch_usable_ram_quirk(), and printk.

Referenced by check_payload_segments().

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

◆ selfload()

bool selfload ( struct prog payload)

Definition at line 275 of file selfboot.c.

References BM_MEM_INVALID, and selfload_check().

Referenced by aop_fw_load_reset(), cpucp_fw_load_reset(), and shrm_fw_load_reset().

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

◆ selfload_check()

bool selfload_check ( struct prog payload,
enum bootmem_type  dest_type 
)

Definition at line 259 of file selfboot.c.

References prog::cbfs_type, cbfs_type_map(), CBFS_TYPE_SELF, cbfs_unmap(), NULL, prog_locate_hook(), prog_name(), and selfload_mapped().

Referenced by arch_prog_run(), run_bl31(), and selfload().

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

◆ selfload_mapped()

bool selfload_mapped ( struct prog payload,
void mapping,
enum bootmem_type  dest_type 
)

Definition at line 237 of file selfboot.c.

References BIOS_SPEW, cbmem_find(), CBMEM_ID_CBTABLE, check_payload_segments(), load_payload_segments(), printk, and prog_set_entry().

Referenced by selfload_check().

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