From 99b65668f990a04ef524c2303e2894d783aa1730 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Thu, 8 Jun 2017 16:46:51 +0200 Subject: [PATCH] soc/intel/skylake: Hook up libgfxinit Also base the FSP/GOP related bail-out on the correct Kconfig option to allow adding a VBT along with libgfxinit. Most things should work, what doesn't is backlight control because coreboot misses the settings (moved to FSP and need backporting). Also, Kaby Lake is still unsupported. TEST=Booted yet to be upstreamed Skylake-S port (Kontron/bSL6) both with text and linear framebuffer mode and viewed a FILO menu. Change-Id: I79fbfed7732cf02d054530ea7ec0d34de32836ba Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/20113 Tested-by: build bot (Jenkins) Reviewed-by: Subrata Banik --- src/soc/intel/skylake/graphics.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/soc/intel/skylake/graphics.c b/src/soc/intel/skylake/graphics.c index bda08c54c0..8991fa30b8 100644 --- a/src/soc/intel/skylake/graphics.c +++ b/src/soc/intel/skylake/graphics.c @@ -14,10 +14,12 @@ * GNU General Public License for more details. */ +#include #include #include #include #include +#include #include #include #include @@ -45,14 +47,13 @@ void graphics_soc_init(struct device *dev) /* * GFX PEIM module inside FSP binary is taking care of graphics - * initialization based on INTEL_GMA_ADD_VBT_DATA_FILE Kconfig - * option and input VBT file. Hence no need to load/execute legacy VGA - * OpROM in order to initialize GFX. + * initialization based on RUN_FSP_GOP Kconfig option and input + * VBT file. * - * In case of non-FSP solution, SoC need to select VGA_ROM_RUN - * Kconfig to perform GFX initialization through VGA OpRom. + * In case of non-FSP solution, SoC need to select another + * Kconfig to perform GFX initialization. */ - if (IS_ENABLED(CONFIG_INTEL_GMA_ADD_VBT_DATA_FILE)) + if (IS_ENABLED(CONFIG_RUN_FSP_GOP)) return; /* IGD needs to Bus Master */ @@ -60,8 +61,16 @@ void graphics_soc_init(struct device *dev) reg32 |= PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY | PCI_COMMAND_IO; pci_write_config32(dev, PCI_COMMAND, reg32); - /* Initialize PCI device, load/execute BIOS Option ROM */ - pci_dev_init(dev); + if (IS_ENABLED(CONFIG_MAINBOARD_USE_LIBGFXINIT)) { + if (!acpi_is_wakeup_s3() && display_init_required()) { + int lightup_ok; + gma_gfxinit(&lightup_ok); + gfx_set_init_done(lightup_ok); + } + } else { + /* Initialize PCI device, load/execute BIOS Option ROM */ + pci_dev_init(dev); + } intel_gma_restore_opregion(); }