From 33f6375ca534747a50a6ca0f3958acbf6df50f44 Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Thu, 6 Feb 2025 11:21:08 +0100 Subject: [PATCH] soc/amd/common/block/graphics: Support non VGA IGDs On glinda the IGD is no longer VGA compatible. It doesn't advertise itself as a VGA compatible devices and doesn't decode the legacy VGA ranges 0x3C0-0x3CF, 0x3D4. Introduce a new Kconfig and select it where necessary to keep existing behaviour on older SoC while fixing FSP GOP init on glinda. The VBIOS will get loaded into the D-segment instead the C-segment, which is typically used by VGA. TEST: FSP GOP on amd/birman+ is able to find the VBIOS. amdgpu driver still doesn't work as the VFCT table isn't generated on amd/glinda. Change-Id: I6ab28aab74f3169d45d7d852a37ddfcfc75b7c88 Signed-off-by: Patrick Rudolph Reviewed-on: https://review.coreboot.org/c/coreboot/+/86300 Reviewed-by: Felix Held Reviewed-by: Ana Carolina Cabral Tested-by: build bot (Jenkins) --- src/soc/amd/common/block/graphics/Kconfig | 8 ++++++++ src/soc/amd/common/block/graphics/graphics.c | 9 ++++++--- src/soc/amd/glinda/Kconfig | 3 ++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/soc/amd/common/block/graphics/Kconfig b/src/soc/amd/common/block/graphics/Kconfig index 3b2eaed565..b7401fbcdf 100644 --- a/src/soc/amd/common/block/graphics/Kconfig +++ b/src/soc/amd/common/block/graphics/Kconfig @@ -35,3 +35,11 @@ config SOC_AMD_COMMON_BLOCK_GRAPHICS_ACP help Select this option to provide Audio CoProcessor ACPI device for pre-Ryzen APUs for use by custom Windows drivers. + +config SOC_AMD_COMMON_BLOCK_GRAPHICS_NO_VGA + bool + depends on SOC_AMD_COMMON_BLOCK_GRAPHICS + help + Select this option when the IGD is not VGA compatible. On newer platforms the IGD + advertises itself as a Display device, but not as a VGA Display controller. + The IGD does not decode the legacy I/O ranges 0x3C0-0x3CF, 0x3D4. diff --git a/src/soc/amd/common/block/graphics/graphics.c b/src/soc/amd/common/block/graphics/graphics.c index f80484da8f..369fd85192 100644 --- a/src/soc/amd/common/block/graphics/graphics.c +++ b/src/soc/amd/common/block/graphics/graphics.c @@ -148,10 +148,13 @@ static const char *graphics_acpi_name(const struct device *dev) void *vbt_get(void) { - if (CONFIG(RUN_FSP_GOP)) - return (void *)(uintptr_t)PCI_VGA_RAM_IMAGE_START; + if (!CONFIG(RUN_FSP_GOP)) + return NULL; - return NULL; + if (CONFIG(SOC_AMD_COMMON_BLOCK_GRAPHICS_NO_VGA)) + return (void *)(uintptr_t)PCI_RAM_IMAGE_START; + + return (void *)(uintptr_t)PCI_VGA_RAM_IMAGE_START; } static void graphics_set_resources(struct device *const dev) diff --git a/src/soc/amd/glinda/Kconfig b/src/soc/amd/glinda/Kconfig index aa8c85e3e5..39fb785691 100644 --- a/src/soc/amd/glinda/Kconfig +++ b/src/soc/amd/glinda/Kconfig @@ -47,7 +47,8 @@ config SOC_AMD_GLINDA select SOC_AMD_COMMON_BLOCK_DATA_FABRIC_MULTI_PCI_SEGMENT select SOC_AMD_COMMON_BLOCK_ESPI_EXTENDED_DECODE_RANGES # TODO: Check if this is still correct select SOC_AMD_COMMON_BLOCK_GPP_CLK - select SOC_AMD_COMMON_BLOCK_GRAPHICS # TODO: Check if this is still correct + select SOC_AMD_COMMON_BLOCK_GRAPHICS + select SOC_AMD_COMMON_BLOCK_GRAPHICS_NO_VGA select SOC_AMD_COMMON_BLOCK_HAS_ESPI # TODO: Check if this is still correct select SOC_AMD_COMMON_BLOCK_HAS_ESPI_ALERT_ENABLE # TODO: Check if this is still correct select SOC_AMD_COMMON_BLOCK_I2C # TODO: Check if this is still correct