From 8205ce6b34aa4e73657fe61509b14cde781b4d58 Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Wed, 10 Mar 2021 17:25:01 -0800 Subject: fsp2_0: Replace fspld->get_destination() callback with CBFS allocator The Intel FSP 2.0 driver contains a custom construct that basically serves the same purpose as the new CBFS allocator concept: a callback function to customize placement of a loaded CBFS file whose size is initially unknown. This patch removes the existing implementation and replaces it with a CBFS allocator. Signed-off-by: Julius Werner Change-Id: I0b7b446a0d2af87ec337fb80ad54f2d404e69668 Reviewed-on: https://review.coreboot.org/c/coreboot/+/52082 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin Reviewed-by: Furquan Shaikh --- src/drivers/intel/fsp2_0/silicon_init.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/drivers/intel/fsp2_0/silicon_init.c') diff --git a/src/drivers/intel/fsp2_0/silicon_init.c b/src/drivers/intel/fsp2_0/silicon_init.c index c9898f5ce3..6326d53622 100644 --- a/src/drivers/intel/fsp2_0/silicon_init.c +++ b/src/drivers/intel/fsp2_0/silicon_init.c @@ -184,22 +184,16 @@ static void do_silicon_init(struct fsp_header *hdr) post_code(POST_FSP_MULTI_PHASE_SI_INIT_EXIT); } -static int fsps_get_dest(const struct fsp_load_descriptor *fspld, void **dest, - size_t size, const struct region_device *source) +static void *fsps_allocator(void *arg_unused, size_t size, const union cbfs_mdata *mdata_unused) { - *dest = cbmem_add(CBMEM_ID_REFCODE, size); - - if (*dest == NULL) - return -1; - - return 0; + return cbmem_add(CBMEM_ID_REFCODE, size); } void fsps_load(void) { struct fsp_load_descriptor fspld = { .fsp_prog = PROG_INIT(PROG_REFCODE, CONFIG_FSP_S_CBFS), - .get_destination = fsps_get_dest, + .alloc = fsps_allocator, }; struct prog *fsps = &fspld.fsp_prog; static int load_done; -- cgit v1.2.3