From d541890e7695018cd24640b9ba127e53a0e37e13 Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Tue, 11 Feb 2025 13:46:10 +0100 Subject: [PATCH] device/pci_rom: Support non VGA iGPUs Recent AMD iGPUs are not VGA compatible anymore, thus they don't identify themself as "VGA compatible" anymore by the PCI class code. Since the PCI VGA Option ROM code assumes it only runs on VGA compatible devices, relax the ACPI code part to handle display devices as well. In order to run a VBIOS in coreboot it still must be VGA compatible, but for ACPI table generation, where no code is run, it's not necessary any more. The new code allows to use Linux's amdgpu driver on AMD/glinda. TEST: On amd/birman+ the amdgpu kernel drivers starts and dmesg shows: [ 3.010224] [drm] amdgpu kernel modesetting enabled. The coreboot log shows: [INFO ] CBFS: Found 'pci1002,150e.rom' @0x10a40 size 0x4400 in mcache @0x1b7dd184 [DEBUG] In CBFS, ROM address for PCI: 00:02:00.0 = 0xff012a6c [DEBUG] Class Code mismatch ROM 00030000, dev 00038000 [DEBUG] Copying non-VGA ROM image from 0xff012a6c to 0x000d0000, 0x4400 bytes [...] Copying initialized VBIOS image from 0x000d0000 [DEBUG] ACPI: * VFCT at 1b5cb960 Change-Id: I623cd80b45b148b91f2796b22a589bbede0feeeb Signed-off-by: Patrick Rudolph Reviewed-on: https://review.coreboot.org/c/coreboot/+/86386 Reviewed-by: Angel Pons Tested-by: build bot (Jenkins) Reviewed-by: Felix Held --- src/device/pci_rom.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/device/pci_rom.c b/src/device/pci_rom.c index 49b9923d47..037f96eb66 100644 --- a/src/device/pci_rom.c +++ b/src/device/pci_rom.c @@ -226,8 +226,8 @@ unsigned long pci_rom_write_acpi_tables(const struct device *device, unsigned long current, struct acpi_rsdp *rsdp) { - /* Only handle VGA devices */ - if ((device->class >> 8) != PCI_CLASS_DISPLAY_VGA) + /* Only handle display devices */ + if ((device->class >> 16) != PCI_BASE_CLASS_DISPLAY) return current; /* Only handle enabled devices */