Attention is currently required from: Andrey Petrov.
Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/69477 )
Change subject: drivers/intel/fsp2_0/hand_off_block: use iterator in fsp_find_range_hob ......................................................................
drivers/intel/fsp2_0/hand_off_block: use iterator in fsp_find_range_hob
Drop the find_resource_hob_by_guid implementation and use the new fsp_hob_iterator_init and fsp_hob_iterator_get_next_guid_resource functions in fsp_find_range_hob.
TEST=Mandolin still finds the TSEG range HOB and uses the correct TSEG location.
Signed-off-by: Felix Held felix-coreboot@felixheld.de Change-Id: I00786cbeea203fba195ddc953c3242be544a7d70 --- M src/drivers/intel/fsp2_0/hand_off_block.c 1 file changed, 20 insertions(+), 22 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/77/69477/1
diff --git a/src/drivers/intel/fsp2_0/hand_off_block.c b/src/drivers/intel/fsp2_0/hand_off_block.c index 13fbb06..2738c78 100644 --- a/src/drivers/intel/fsp2_0/hand_off_block.c +++ b/src/drivers/intel/fsp2_0/hand_off_block.c @@ -190,23 +190,6 @@ return CB_ERR; }
-static const -struct hob_resource *find_resource_hob_by_guid(const struct hob_header *hob, - const uint8_t guid[16]) -{ - const struct hob_resource *res; - - for (; hob->type != HOB_TYPE_END_OF_HOB_LIST; hob = fsp_next_hob(hob)) { - if (hob->type != HOB_TYPE_RESOURCE_DESCRIPTOR) - continue; - - res = fsp_hob_header_to_resource(hob); - if (fsp_guid_compare(res->owner_guid, guid)) - return res; - } - return NULL; -} - void fsp_print_guid(const void *base) { uint32_t big; @@ -224,17 +207,15 @@
int fsp_find_range_hob(struct range_entry *re, const uint8_t guid[16]) { + const struct hob_header *hob_iterator; const struct hob_resource *fsp_mem; - const void *hob_list = fsp_get_hob_list();
- if (!hob_list) + if (fsp_hob_iterator_init(&hob_iterator) != CB_SUCCESS) return -1;
range_entry_init(re, 0, 0, 0);
- fsp_mem = find_resource_hob_by_guid(hob_list, guid); - - if (!fsp_mem) { + if (fsp_hob_iterator_get_next_guid_resource(&hob_iterator, guid, &fsp_mem) != CB_SUCCESS) { fsp_print_guid(guid); printk(BIOS_SPEW, " not found!\n"); return -1;