diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/soc/amd/common/block/graphics/graphics.c | 14 | ||||
-rw-r--r-- | src/soc/amd/common/block/include/amdblocks/graphics.h | 10 | ||||
-rw-r--r-- | src/soc/amd/common/fsp/Makefile.inc | 1 | ||||
-rw-r--r-- | src/soc/amd/common/fsp/fsp_graphics.c | 19 |
4 files changed, 34 insertions, 10 deletions
diff --git a/src/soc/amd/common/block/graphics/graphics.c b/src/soc/amd/common/block/graphics/graphics.c index 4d33cadf942a..9dff18dd73bd 100644 --- a/src/soc/amd/common/block/graphics/graphics.c +++ b/src/soc/amd/common/block/graphics/graphics.c @@ -2,14 +2,15 @@ #include <acpi/acpi_device.h> #include <acpi/acpigen.h> +#include <amdblocks/graphics.h> #include <amdblocks/vbios_cache.h> #include <boot/coreboot_tables.h> #include <bootmode.h> #include <bootstate.h> #include <console/console.h> +#include <device/device.h> #include <device/pci.h> #include <fmap.h> -#include <fsp/graphics.h> #include <security/vboot/vbios_cache_hash_tpm.h> #include <soc/intel/common/vbt.h> #include <timestamp.h> @@ -177,15 +178,8 @@ static void graphics_set_resources(struct device *const dev) static void graphics_dev_init(struct device *const dev) { - if (CONFIG(RUN_FSP_GOP)) { - struct resource *res = probe_resource(dev, PCI_BASE_ADDRESS_0); - - if (res && res->base) - fsp_report_framebuffer_info(res->base, LB_FB_ORIENTATION_NORMAL); - else - printk(BIOS_ERR, "%s: Unable to find resource for %s\n", - __func__, dev_path(dev)); - } + if (CONFIG(RUN_FSP_GOP)) + fsp_graphics_init(dev); /* Initialize PCI device, load/execute BIOS Option ROM */ pci_dev_init(dev); diff --git a/src/soc/amd/common/block/include/amdblocks/graphics.h b/src/soc/amd/common/block/include/amdblocks/graphics.h new file mode 100644 index 000000000000..f8811e8bf8e9 --- /dev/null +++ b/src/soc/amd/common/block/include/amdblocks/graphics.h @@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef AMD_BLOCK_GRAPHICS_H +#define AMD_BLOCK_GRAPHICS_H + +#include <device/device.h> + +void fsp_graphics_init(struct device *const dev); + +#endif /* AMD_BLOCK_GRAPHICS_H */ diff --git a/src/soc/amd/common/fsp/Makefile.inc b/src/soc/amd/common/fsp/Makefile.inc index f26fe8f884a5..14f1f8510b77 100644 --- a/src/soc/amd/common/fsp/Makefile.inc +++ b/src/soc/amd/common/fsp/Makefile.inc @@ -3,6 +3,7 @@ ifeq ($(CONFIG_PLATFORM_USES_FSP2_0),y) romstage-y += fsp_memmap.c romstage-y += fsp_reset.c romstage-y += fsp_validate.c +ramstage-y += fsp_graphics.c ramstage-y += fsp_memmap.c ramstage-y += fsp_report_resources.c ramstage-y += fsp_reset.c diff --git a/src/soc/amd/common/fsp/fsp_graphics.c b/src/soc/amd/common/fsp/fsp_graphics.c new file mode 100644 index 000000000000..4847e3c253ca --- /dev/null +++ b/src/soc/amd/common/fsp/fsp_graphics.c @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include <amdblocks/graphics.h> +#include <console/console.h> +#include <device/device.h> +#include <device/pci.h> +#include <device/resource.h> +#include <fsp/graphics.h> + +void fsp_graphics_init(struct device *const dev) +{ + struct resource *res = probe_resource(dev, PCI_BASE_ADDRESS_0); + + if (res && res->base) + fsp_report_framebuffer_info(res->base, LB_FB_ORIENTATION_NORMAL); + else + printk(BIOS_ERR, "%s: Unable to find resource for %s\n", + __func__, dev_path(dev)); +} |