From 889959890ca9e5f4db12335f079c5a3de4caae1d Mon Sep 17 00:00:00 2001 From: Felix Held Date: Thu, 28 Jan 2021 22:43:52 +0100 Subject: drivers/intel/fsp2_0: factor out and improve UPD signature check In case of a mismatch print both the UPD signature in the FSP and the expected signature and then calls die(), since it shouldn't try calling into the wrong FSP binary for the platform. Signed-off-by: Justin Frodsham Signed-off-by: Felix Held Change-Id: I469836e09db6024ecb448a5261439c66d8e65daf Reviewed-on: https://review.coreboot.org/c/coreboot/+/50090 Tested-by: build bot (Jenkins) Reviewed-by: Marshall Dawson Reviewed-by: Furquan Shaikh --- src/drivers/intel/fsp2_0/memory_init.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/drivers/intel/fsp2_0/memory_init.c') diff --git a/src/drivers/intel/fsp2_0/memory_init.c b/src/drivers/intel/fsp2_0/memory_init.c index 759bfa40f4..92f3d9d960 100644 --- a/src/drivers/intel/fsp2_0/memory_init.c +++ b/src/drivers/intel/fsp2_0/memory_init.c @@ -239,9 +239,7 @@ static void do_fsp_memory_init(const struct fspm_context *context, bool s3wake) upd = (FSPM_UPD *)(hdr->cfg_region_offset + hdr->image_base); - if (upd->FspUpdHeader.Signature != FSPM_UPD_SIGNATURE) - die_with_post_code(POST_INVALID_VENDOR_BINARY, - "Invalid FSPM signature!\n"); + fsp_verify_upd_header_signature(upd->FspUpdHeader.Signature, FSPM_UPD_SIGNATURE); /* Copy the default values from the UPD area */ memcpy(&fspm_upd, upd, sizeof(fspm_upd)); -- cgit v1.2.3