MCPcopy Create free account
hub / github.com/coreboot/coreboot / fsp_load_component

Function fsp_load_component

src/drivers/intel/fsp2_0/util.c:137–164  ·  view source on GitHub ↗

Load the FSP component described by fsp_load_descriptor from cbfs. The FSP * header object will be validated and filled in on successful load. */

Source from the content-addressed store, hash-verified

135/* Load the FSP component described by fsp_load_descriptor from cbfs. The FSP
136 * header object will be validated and filled in on successful load. */
137enum cb_err fsp_load_component(struct fsp_load_descriptor *fspld, struct fsp_header *hdr)
138{
139 size_t output_size;
140 void *dest;
141 struct prog *fsp_prog = &fspld->fsp_prog;
142
143 dest = cbfs_alloc(prog_name(fsp_prog), fspld->alloc, fspld, &output_size);
144 if (!dest)
145 return CB_ERR;
146
147 /* Don't allow FSP-M relocation when XIP. */
148 if (!fspm_xip() && fsp_component_relocate((uintptr_t)dest, dest, output_size) < 0) {
149 printk(BIOS_ERR, "Unable to relocate FSP component!\n");
150 return CB_ERR;
151 }
152
153 prog_set_area(fsp_prog, dest, output_size);
154
155 if (fsp_validate_component(hdr, dest, output_size) != CB_SUCCESS) {
156 printk(BIOS_ERR, "Invalid FSP header after load!\n");
157 return CB_ERR;
158 }
159
160 /* Signal that FSP component has been loaded. */
161 prog_segment_loaded(hdr->image_base, hdr->image_size, SEG_FINAL);
162
163 return CB_SUCCESS;
164}
165
166/* Only call this function when FSP header has been read and validated */
167void fsp_get_version(char *buf)

Callers 2

fsps_loadFunction · 0.85
fsp_memory_initFunction · 0.85

Calls 8

cbfs_allocFunction · 0.85
prog_nameFunction · 0.85
fspm_xipFunction · 0.85
fsp_component_relocateFunction · 0.85
prog_set_areaFunction · 0.85
fsp_validate_componentFunction · 0.85
prog_segment_loadedFunction · 0.85
printkFunction · 0.50

Tested by

no test coverage detected