Attention is currently required from: CoolStar.
Hello CoolStar,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/77628?usp=email
to review the following change.
Change subject: device/pci_rom: Set VBIOS checksum when filling VFCT table ......................................................................
device/pci_rom: Set VBIOS checksum when filling VFCT table
AMD's Windows display drivers validate the checksum of the VBIOS data in the VFCT table (which gets modified by the FSP GOP driver), so ensure it is set correctly after copying the VBIOS into it.
Thanks to coolstar for root causing the issue.
TEST=build/boot Win11 on google/skyrim (frostflow), ensure GPU driver loaded and functional.
Change-Id: I809f87865fd2a25fb106444574b619746aec068d Signed-off-by: Matt DeVillier matt.devillier@amd.corp-partner.google.com Signed-off-by: CoolStar coolstarorganization@gmail.com --- M src/device/pci_rom.c M src/include/acpi/acpi.h 2 files changed, 9 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/28/77628/1
diff --git a/src/device/pci_rom.c b/src/device/pci_rom.c index a454c9e..af0f98e 100644 --- a/src/device/pci_rom.c +++ b/src/device/pci_rom.c @@ -218,6 +218,8 @@ return NULL; }
+#define ATOMBIOS_CHECKSUM_OFFSET 0x21 + static unsigned long pci_rom_acpi_fill_vfct(const struct device *device, acpi_vfct_t *vfct_struct, unsigned long current) @@ -245,10 +247,15 @@ header->PCIFunction = PCI_FUNC(device->path.pci.devfn); header->PCIDevice = PCI_SLOT(device->path.pci.devfn); header->ImageLength = rom->size * 512; - memcpy((void *)&header->VbiosContent, rom, header->ImageLength); + memcpy((void *)header->VbiosContent, rom, header->ImageLength);
vfct_struct->VBIOSImageOffset = (size_t)header - (size_t)vfct_struct;
+ /* Calculate checksum for VBIOS data. */ + header->VbiosContent[ATOMBIOS_CHECKSUM_OFFSET] = 0; + header->VbiosContent[ATOMBIOS_CHECKSUM_OFFSET] = + acpi_checksum(header->VbiosContent, header->ImageLength); + current += header->ImageLength; return current; } diff --git a/src/include/acpi/acpi.h b/src/include/acpi/acpi.h index 33bd735..f325457 100644 --- a/src/include/acpi/acpi.h +++ b/src/include/acpi/acpi.h @@ -478,7 +478,7 @@ u16 SSID; u32 Revision; u32 ImageLength; - u8 VbiosContent; // dummy - copy VBIOS here + u8 VbiosContent[1]; // dummy - copy VBIOS here } __packed acpi_vfct_image_hdr_t;
/* VFCT (VBIOS Fetch Table) */