From 0fcd6f912ba53ef1fc6327143c07727a556a718a Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Tue, 8 Mar 2016 11:23:52 -0600 Subject: drivers/intel/fsp2_0: remove struct resource usage There's no need to use a struct resource type for fsp_find_reserved_memory(). struct resource is mainly associated with a device and that memory is added to cbmem after memory init. Other uses ins FSP 2.0 just use struct range_entry. Use that instead for consistency. Change-Id: Id7d39da1c2e23f97cdaafd7f5d281cefa6fee543 Signed-off-by: Aaron Durbin Reviewed-on: https://review.coreboot.org/13960 Tested-by: build bot (Jenkins) Reviewed-by: Andrey Petrov --- src/drivers/intel/fsp2_0/hand_off_block.c | 7 +++---- src/drivers/intel/fsp2_0/include/fsp/util.h | 3 +-- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'src/drivers') diff --git a/src/drivers/intel/fsp2_0/hand_off_block.c b/src/drivers/intel/fsp2_0/hand_off_block.c index 3bc33afccf..c1f8f10fed 100644 --- a/src/drivers/intel/fsp2_0/hand_off_block.c +++ b/src/drivers/intel/fsp2_0/hand_off_block.c @@ -208,11 +208,11 @@ struct hob_resource *find_resource_hob_by_uuid(const struct hob_header *hob, return NULL; } -void fsp_find_reserved_memory(struct resource *res, const void *hob_list) +void fsp_find_reserved_memory(struct range_entry *re, const void *hob_list) { const struct hob_resource *fsp_mem; - memset(res, 0, sizeof(*res)); + range_entry_init(re, 0, 0, 0); fsp_mem = find_resource_hob_by_uuid(hob_list, uuid_owner_fsp); @@ -220,8 +220,7 @@ void fsp_find_reserved_memory(struct resource *res, const void *hob_list) return; } - res->base = fsp_mem->addr; - res->size = fsp_mem->length; + range_entry_init(re, fsp_mem->addr, fsp_mem->addr + fsp_mem->length, 0); } /* diff --git a/src/drivers/intel/fsp2_0/include/fsp/util.h b/src/drivers/intel/fsp2_0/include/fsp/util.h index 69e545ee0e..0bdcd79dd4 100644 --- a/src/drivers/intel/fsp2_0/include/fsp/util.h +++ b/src/drivers/intel/fsp2_0/include/fsp/util.h @@ -15,7 +15,6 @@ #include #include -#include #include /* @@ -30,7 +29,7 @@ enum cb_err fsp_fill_lb_framebuffer(struct lb_framebuffer *framebuffer); * Hand-off-block utilities which do not depend on CBMEM, but need to be passed * the HOB list explicitly. */ -void fsp_find_reserved_memory(struct resource *res, const void *hob_list); +void fsp_find_reserved_memory(struct range_entry *re, const void *hob_list); void fsp_print_memory_resource_hobs(const void *hob_list); /* Load an FSP binary into CBFS, and fill the associated fsp_header struct */ -- cgit v1.2.3