diff options
author | Julius Werner <jwerner@chromium.org> | 2021-04-12 17:00:16 -0700 |
---|---|---|
committer | Julius Werner <jwerner@chromium.org> | 2021-04-14 01:03:26 +0000 |
commit | 43c9d709c75813276f166da8b6bc7bc220e5288d (patch) | |
tree | e8d34d85dc8c16f4dd420d9f679834ebe2df1d4d /src/drivers/intel/fsp2_0/temp_ram_exit.c | |
parent | b3182fbb0021f725c302bf327663696ca0800a4d (diff) | |
download | coreboot-43c9d709c75813276f166da8b6bc7bc220e5288d.tar.gz coreboot-43c9d709c75813276f166da8b6bc7bc220e5288d.tar.bz2 coreboot-43c9d709c75813276f166da8b6bc7bc220e5288d.zip |
intel: fsp2_0: Move last pieces to new CBFS API
This patch ports the last remaining use of cbfs_boot_locate() in the
Intel FSP drivers to the new CBFS API. As a consequence, there is no
longer a reason for fsp_validate_component() to operate on rdevs, and
the function is simplified to take a direct void pointer and size to a
memory-mapping of the FSP blob instead.
Signed-off-by: Julius Werner <jwerner@chromium.org>
Change-Id: If1f0239eefa4542e4d23f6e2e3ff19106f2e3c0d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52281
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/drivers/intel/fsp2_0/temp_ram_exit.c')
-rw-r--r-- | src/drivers/intel/fsp2_0/temp_ram_exit.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/drivers/intel/fsp2_0/temp_ram_exit.c b/src/drivers/intel/fsp2_0/temp_ram_exit.c index c3bfbba6af9e..0ef6c5cc782a 100644 --- a/src/drivers/intel/fsp2_0/temp_ram_exit.c +++ b/src/drivers/intel/fsp2_0/temp_ram_exit.c @@ -12,18 +12,17 @@ void fsp_temp_ram_exit(void) struct fsp_header hdr; uint32_t status; temp_ram_exit_fn temp_ram_exit; - struct cbfsf file_desc; - struct region_device file_data; + void *mapping; + size_t size; const char *name = CONFIG_FSP_M_CBFS; - if (cbfs_boot_locate(&file_desc, name, NULL)) { - printk(BIOS_CRIT, "Could not locate %s in CBFS\n", name); + mapping = cbfs_map(name, &size); + if (!mapping) { + printk(BIOS_CRIT, "Could not map %s from CBFS\n", name); die("FSPM not available for CAR Exit!\n"); } - cbfs_file_data(&file_data, &file_desc); - - if (fsp_validate_component(&hdr, &file_data) != CB_SUCCESS) + if (fsp_validate_component(&hdr, mapping, size) != CB_SUCCESS) die("Invalid FSPM header!\n"); temp_ram_exit = (void *)(hdr.image_base + hdr.temp_ram_exit_entry); @@ -34,6 +33,8 @@ void fsp_temp_ram_exit(void) printk(BIOS_CRIT, "TempRamExit returned 0x%08x\n", status); die("TempRamExit returned an error!\n"); } + + cbfs_unmap(mapping); } void late_car_teardown(void) |