summaryrefslogtreecommitdiff
path: root/src/drivers/intel/fsp2_0/silicon_init.c
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2021-03-10 17:25:01 -0800
committerJulius Werner <jwerner@chromium.org>2021-04-05 22:59:09 +0000
commit8205ce6b34aa4e73657fe61509b14cde781b4d58 (patch)
tree1b8c508632848b7a9dfcf5733ba669a64028baaa /src/drivers/intel/fsp2_0/silicon_init.c
parent4676ec52c279d44eee44ceef40d0107b09bedce6 (diff)
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 <jwerner@chromium.org> Change-Id: I0b7b446a0d2af87ec337fb80ad54f2d404e69668 Reviewed-on: https://review.coreboot.org/c/coreboot/+/52082 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/drivers/intel/fsp2_0/silicon_init.c')
-rw-r--r--src/drivers/intel/fsp2_0/silicon_init.c12
1 files changed, 3 insertions, 9 deletions
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;