summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt DeVillier <matt.devillier@amd.corp-partner.google.com>2023-09-08 12:56:52 -0500
committerFelix Held <felix-coreboot@felixheld.de>2023-09-25 14:11:38 +0000
commit9f01005da04951e53bd14cea105606c32cac15ed (patch)
treefbb8b9a40d4a37139c825d5758834c1520f6cbaf
parentd5f5dd7984a3e3a9938dcb282dfbe199186d1e3e (diff)
soc/amd/common/graphics: Update VBIOS cache data before hashing
On the first boot after flashing, the data read from the FMAP and stored in vbios_data is not valid, so hashing it produces a value which will not match on the subsequent boot, requiring an additional boot before the vbios_data and hash match / before the GOP driver can be skipped. To fix this, update vbios_data before hashing. BUG=b:271850970 BRANCH=skyrim TEST=build/boot google/skyrim with USE_SELECTIVE_GOP_INIT selected, verify that GOP driver execution is skipping on 2nd boot after flashing when booting in normal / verified boot mode. Change-Id: Idc10d752bfa004a34b91307a743c620fb97eeb82 Signed-off-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/77727 Reviewed-by: Martin L Roth <gaumless@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
-rw-r--r--src/soc/amd/common/block/graphics/graphics.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/soc/amd/common/block/graphics/graphics.c b/src/soc/amd/common/block/graphics/graphics.c
index 93f71f9ce9..4d33cadf94 100644
--- a/src/soc/amd/common/block/graphics/graphics.c
+++ b/src/soc/amd/common/block/graphics/graphics.c
@@ -244,6 +244,9 @@ static void write_vbios_cache_to_fmap(void *unused)
VBIOS_CACHE_FMAP_SIZE) != VBIOS_CACHE_FMAP_SIZE)
printk(BIOS_ERR, "Failed to save vbios data to flash; rdev_writeat() failed.\n");
+ /* copy modified vbios data from PCI_VGA_RAM_IMAGE_START to buffer before hashing */
+ memcpy(vbios_data, (void *)PCI_VGA_RAM_IMAGE_START, VBIOS_CACHE_FMAP_SIZE);
+
/* save data hash to TPM NVRAM for validation on subsequent boots */
vbios_cache_update_hash(vbios_data, VBIOS_CACHE_FMAP_SIZE);