summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPratikkumar Prajapati <pratikkumar.v.prajapati@intel.com>2023-02-01 17:25:07 -0800
committerFelix Held <felix-coreboot@felixheld.de>2023-03-29 13:15:11 +0000
commitf5f756d50743e7a23ab99d779bba98b5fec363cf (patch)
tree7a62055278fb7f6ac9886d825376ae79f846949a
parentb0ddae6a5bcaa5e99661a638cd6bda010f9a0477 (diff)
drivers/intel/fsp2_0: Add API to find FSP resource HOB by GUID
The API finds the FSP resource HOB for the given GUID. Returns the pointer to the HOB if found, otherwise NULL Change-Id: I4ebc9b7d214e5fc731ae45f28e7f5732a7635cbc Signed-off-by: Pratikkumar Prajapati <pratikkumar.v.prajapati@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/72721 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Sridhar Siricilla <sridhar.siricilla@intel.com>
-rw-r--r--src/drivers/intel/fsp2_0/hand_off_block.c14
-rw-r--r--src/drivers/intel/fsp2_0/include/fsp/util.h5
2 files changed, 19 insertions, 0 deletions
diff --git a/src/drivers/intel/fsp2_0/hand_off_block.c b/src/drivers/intel/fsp2_0/hand_off_block.c
index f6af894877..08b2555855 100644
--- a/src/drivers/intel/fsp2_0/hand_off_block.c
+++ b/src/drivers/intel/fsp2_0/hand_off_block.c
@@ -250,6 +250,20 @@ const void *fsp_find_extension_hob_by_guid(const uint8_t *guid, size_t *size)
return NULL;
}
+const void *fsp_find_resource_hob_by_guid(const uint8_t *guid)
+{
+ const struct hob_header *hob_iterator;
+ const struct hob_resource *res_hob;
+
+ if (fsp_hob_iterator_init(&hob_iterator) != CB_SUCCESS)
+ return NULL;
+
+ if (fsp_hob_iterator_get_next_guid_resource(&hob_iterator, guid, &res_hob) == CB_SUCCESS)
+ return res_hob;
+
+ return NULL;
+}
+
static void display_fsp_version_info_hob(const void *hob)
{
#if CONFIG(DISPLAY_FSP_VERSION_INFO) || CONFIG(DISPLAY_FSP_VERSION_INFO_2)
diff --git a/src/drivers/intel/fsp2_0/include/fsp/util.h b/src/drivers/intel/fsp2_0/include/fsp/util.h
index 5ff5814642..f9b31e96bf 100644
--- a/src/drivers/intel/fsp2_0/include/fsp/util.h
+++ b/src/drivers/intel/fsp2_0/include/fsp/util.h
@@ -145,6 +145,11 @@ void fsp_verify_upd_header_signature(uint64_t upd_signature, uint64_t expected_s
void lb_string_platform_blob_version(struct lb_header *header);
void report_fspt_output(void);
void soc_validate_fspm_header(const struct fsp_header *hdr);
+/*
+ * This function finds the FSP resource HOB for the given GUID.
+ * Returns the pointer to the HOB if found, otherwise NULL
+ */
+const void *fsp_find_resource_hob_by_guid(const uint8_t *guid);
/* Fill in header and validate a loaded FSP component. */
enum cb_err fsp_validate_component(struct fsp_header *hdr, void *fsp_blob, size_t size);