[coreboot-gerrit] Change in coreboot[master]: x86/acpi: Use initialized VBIOS in VFCT table

Marshall Dawson (Code Review) gerrit at coreboot.org
Thu Apr 20 02:58:11 CEST 2017


Marshall Dawson has uploaded a new change for review. ( https://review.coreboot.org/19383 )

Change subject: x86/acpi: Use initialized VBIOS in VFCT table
......................................................................

x86/acpi: Use initialized VBIOS in VFCT table

AMD VBIOS option ROMs often modify themselves during initialization.
Check for the presence of a VBIOS at 0xc0000 before populating the
VFCT table.  If a matching ROM is found, use it for the source of
the copy.

Tested on Gardenia (Stoney) variant by observing amdgpu driver's
dmesg output.

Change-Id: I5be7e1562bde51800c5b0e704c79812d85bcf362
Signed-off-by: Marshall Dawson <marshalldawson3rd at gmail.com>
---
M src/device/pci_rom.c
1 file changed, 12 insertions(+), 0 deletions(-)


  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/83/19383/1

diff --git a/src/device/pci_rom.c b/src/device/pci_rom.c
index 20621d3..ff5a8af 100644
--- a/src/device/pci_rom.c
+++ b/src/device/pci_rom.c
@@ -179,6 +179,8 @@
 {
 	struct acpi_vfct_image_hdr *header = &vfct_struct->image_hdr;
 	struct rom_header *rom;
+	struct rom_header *run_rom;
+	struct pci_data *rom_data;
 
 	vfct_struct->VBIOSImageOffset = (size_t)header - (size_t)vfct_struct;
 
@@ -188,6 +190,16 @@
 		return current;
 	}
 
+	/* VBIOS may be modified after oprom init so use the copy if present. */
+	if (IS_ENABLED(CONFIG_VGA_ROM_RUN)) {
+		run_rom = (struct rom_header *)PCI_VGA_RAM_IMAGE_START;
+		rom_data = (struct pci_data *)((u8 *)run_rom
+					+ le32_to_cpu(run_rom->data));
+		if (device->device == rom_data->device
+					&& device->vendor == rom_data->vendor)
+			rom = run_rom;
+	}
+
 	header->DeviceID = device->device;
 	header->VendorID = device->vendor;
 	header->PCIBus = device->bus->secondary;

-- 
To view, visit https://review.coreboot.org/19383
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5be7e1562bde51800c5b0e704c79812d85bcf362
Gerrit-PatchSet: 1
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Marshall Dawson <marshalldawson3rd at gmail.com>



More information about the coreboot-gerrit mailing list