summaryrefslogtreecommitdiff
path: root/src/drivers/intel/fsp2_0
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/intel/fsp2_0')
-rw-r--r--src/drivers/intel/fsp2_0/header_display.c10
-rw-r--r--src/drivers/intel/fsp2_0/include/fsp/util.h11
-rw-r--r--src/drivers/intel/fsp2_0/util.c18
3 files changed, 21 insertions, 18 deletions
diff --git a/src/drivers/intel/fsp2_0/header_display.c b/src/drivers/intel/fsp2_0/header_display.c
index 57e13b5354..b45b4d8a7c 100644
--- a/src/drivers/intel/fsp2_0/header_display.c
+++ b/src/drivers/intel/fsp2_0/header_display.c
@@ -5,15 +5,7 @@
void fsp_print_header_info(const struct fsp_header *hdr)
{
- union {
- uint32_t val;
- struct {
- uint8_t bld_num;
- uint8_t revision;
- uint8_t minor;
- uint8_t major;
- } rev;
- } revision;
+ union fsp_revision revision;
revision.val = hdr->fsp_revision;
diff --git a/src/drivers/intel/fsp2_0/include/fsp/util.h b/src/drivers/intel/fsp2_0/include/fsp/util.h
index a57b1bb942..315db056e9 100644
--- a/src/drivers/intel/fsp2_0/include/fsp/util.h
+++ b/src/drivers/intel/fsp2_0/include/fsp/util.h
@@ -42,6 +42,16 @@ struct hob_resource {
uint64_t length;
} __packed;
+union fsp_revision {
+ uint32_t val;
+ struct {
+ uint8_t bld_num;
+ uint8_t revision;
+ uint8_t minor;
+ uint8_t major;
+ } rev;
+};
+
#if CONFIG_UDK_VERSION < CONFIG_UDK_2017_VERSION
enum resource_type {
EFI_RESOURCE_SYSTEM_MEMORY = 0,
@@ -90,6 +100,7 @@ void fsp_find_bootloader_tolum(struct range_entry *re);
void fsp_get_version(char *buf);
void lb_string_platform_blob_version(struct lb_header *header);
void report_fspt_output(void);
+void soc_validate_fsp_version(const struct fsp_header *hdr);
/* Fill in header and validate sanity of component within region device. */
enum cb_err fsp_validate_component(struct fsp_header *hdr,
diff --git a/src/drivers/intel/fsp2_0/util.c b/src/drivers/intel/fsp2_0/util.c
index acc3f4b9b3..490816d343 100644
--- a/src/drivers/intel/fsp2_0/util.c
+++ b/src/drivers/intel/fsp2_0/util.c
@@ -85,6 +85,9 @@ enum cb_err fsp_validate_component(struct fsp_header *hdr,
return CB_ERR;
}
+ if (ENV_ROMSTAGE)
+ soc_validate_fsp_version(hdr);
+
return CB_SUCCESS;
}
@@ -213,15 +216,7 @@ enum cb_err fsp_load_component(struct fsp_load_descriptor *fspld, struct fsp_hea
void fsp_get_version(char *buf)
{
struct fsp_header *hdr = &fsps_hdr;
- union {
- uint32_t val;
- struct {
- uint8_t bld_num;
- uint8_t revision;
- uint8_t minor;
- uint8_t major;
- } rev;
- } revision;
+ union fsp_revision revision;
revision.val = hdr->fsp_revision;
snprintf(buf, FSP_VER_LEN, "%u.%u-%u.%u.%u.%u", (hdr->spec_version >> 4),
@@ -243,3 +238,8 @@ void lb_string_platform_blob_version(struct lb_header *header)
rec->size = ALIGN_UP(sizeof(*rec) + len + 1, 8);
memcpy(rec->string, fsp_version, len+1);
}
+
+__weak void soc_validate_fsp_version(const struct fsp_header *hdr)
+{
+ printk(BIOS_DEBUG, "%s not implemented.\n", __func__);
+}