From b649d6ac116e0a650f4db93a430686965450eca0 Mon Sep 17 00:00:00 2001 From: Nikolai Vyssotski Date: Thu, 11 Mar 2021 19:15:03 -0600 Subject: soc/amd/common/block/graphics/graphics: GOP: load VBIOS Load VBIOS in pci set_resources to PCI_VGA_RAM_IMAGE_START (0xc0000) since pci_dev_init() will not load it in GOP case (VGA_ROM_RUN is not set). Add Cezanne GFX PID. BUG=b:171234996 BRANCH=Zork Change-Id: I4a6fea9b6cd60c862e15ed2ed539869c0f9bd363 Signed-off-by: Nikolai Vyssotski Reviewed-on: https://review.coreboot.org/c/coreboot/+/49867 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber Reviewed-by: Raul Rangel --- src/device/pci_rom.c | 2 +- src/soc/amd/common/block/graphics/graphics.c | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/device/pci_rom.c b/src/device/pci_rom.c index 94452433fc..663895c2ce 100644 --- a/src/device/pci_rom.c +++ b/src/device/pci_rom.c @@ -178,7 +178,7 @@ static struct rom_header *check_initialized(const struct device *dev) struct rom_header *run_rom; struct pci_data *rom_data; - if (!CONFIG(VGA_ROM_RUN)) + if (!CONFIG(VGA_ROM_RUN) && !CONFIG(RUN_FSP_GOP)) return NULL; run_rom = (struct rom_header *)(uintptr_t)PCI_VGA_RAM_IMAGE_START; diff --git a/src/soc/amd/common/block/graphics/graphics.c b/src/soc/amd/common/block/graphics/graphics.c index 550cde57e1..942a8034af 100644 --- a/src/soc/amd/common/block/graphics/graphics.c +++ b/src/soc/amd/common/block/graphics/graphics.c @@ -7,6 +7,7 @@ #include #include #include +#include #define ATIF_FUNCTION_VERIFY_INTERFACE 0x0 struct atif_verify_interface_output { @@ -129,6 +130,25 @@ void *vbt_get(void) return NULL; } +static void graphics_set_resources(struct device *const dev) +{ + struct rom_header *rom, *ram; + + pci_dev_set_resources(dev); + + if (!CONFIG(RUN_FSP_GOP)) + return; + + timestamp_add_now(TS_OPROM_INITIALIZE); + rom = pci_rom_probe(dev); + if (rom == NULL) + return; + ram = pci_rom_load(dev, rom); + if (ram == NULL) + return; + timestamp_add_now(TS_OPROM_COPY_END); +} + static void graphics_dev_init(struct device *const dev) { if (CONFIG(RUN_FSP_GOP)) { @@ -147,7 +167,7 @@ static void graphics_dev_init(struct device *const dev) static const struct device_operations graphics_ops = { .read_resources = pci_dev_read_resources, - .set_resources = pci_dev_set_resources, + .set_resources = graphics_set_resources, .enable_resources = pci_dev_enable_resources, .init = graphics_dev_init, .ops_pci = &pci_dev_ops_pci, @@ -158,6 +178,7 @@ static const struct device_operations graphics_ops = { static const unsigned short pci_device_ids[] = { PCI_DEVICE_ID_ATI_FAM17H_MODEL18H_GPU, + PCI_DEVICE_ID_ATI_FAM19H_MODEL51H_GPU, 0, }; -- cgit v1.2.3