summaryrefslogtreecommitdiff
path: root/src/drivers/intel
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2022-11-12 01:42:39 +0100
committerFelix Held <felix-coreboot@felixheld.de>2022-11-14 18:51:20 +0000
commit2516947fd95c771295abbb53f5a856535d96dcff (patch)
tree18b1bf0525ebe3c72d133708883d66ca7cb186ff /src/drivers/intel
parent2e81436be8e1b372cd15be93939adc8f48886449 (diff)
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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/69477 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'src/drivers/intel')
-rw-r--r--src/drivers/intel/fsp2_0/hand_off_block.c25
1 files changed, 3 insertions, 22 deletions
diff --git a/src/drivers/intel/fsp2_0/hand_off_block.c b/src/drivers/intel/fsp2_0/hand_off_block.c
index 13fbb06eef..2738c78988 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 @@ enum cb_err fsp_hob_iterator_get_next_guid_extension(const struct hob_header **h
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 @@ void fsp_print_guid(const void *base)
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;