program_loading: Replace prog_rdev() with raw start pointer and size

Since prog_locate() was eliminated, prog_rdev() only ever represents the
loaded program in memory now. Using the rdev API for this is unnecessary
if we know that the "device" is always just memory. This patch changes
it to be represented by a simple pointer and size. Since some code still
really wants this to be an rdev, introduce a prog_chain_rdev() helper to
translate back to that if necessary.

Signed-off-by: Julius Werner <jwerner@chromium.org>
Change-Id: If7c0f1c5698fa0c326e23c553ea0fe928b25d202
Reviewed-on: https://review.coreboot.org/c/coreboot/+/46483
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
Julius Werner
2020-09-03 21:17:20 -07:00
committed by Patrick Georgi
parent 8e15e91dc4
commit 2e973942bc
5 changed files with 25 additions and 28 deletions

View File

@ -180,7 +180,7 @@ enum cb_err fsp_load_component(struct fsp_load_descriptor *fspld, struct fsp_hea
uint32_t compression_algo;
size_t output_size;
void *dest;
struct region_device source_rdev;
struct region_device source_rdev, prog_rdev;
struct prog *fsp_prog = &fspld->fsp_prog;
if (fspld->get_destination == NULL)
@ -201,7 +201,8 @@ enum cb_err fsp_load_component(struct fsp_load_descriptor *fspld, struct fsp_hea
prog_set_area(fsp_prog, dest, output_size);
if (fsp_validate_component(hdr, prog_rdev(fsp_prog)) != CB_SUCCESS) {
prog_chain_rdev(fsp_prog, &prog_rdev);
if (fsp_validate_component(hdr, &prog_rdev) != CB_SUCCESS) {
printk(BIOS_ERR, "Invalid FSP header after load!\n");
return CB_ERR;
}