mb/prodrive/hermes: Allow using the Intel iGPU as primary

Configure the Intel iGPU as primary video adapter if enabled according
to EEPROM settings. The default is to use the ASPEED BMC as primary
video adapter, which only has a VGA output and the remote KVM output.

For now, use the FSP GOP driver to light up the iGPU. There are several
issues with libgfxinit on the Hermes, probably due to the unusual setup
of the iGPU's display outputs. They are routed to a mezzanine connector
for a piggy-back sub-board, of which there are two models. The Poseidon
piggy-back has two DisplayPort outputs and an HDMI output coming from a
MegaChips LSPCON. The Avalanche piggy-back routes all three DisplayPort
outputs from the iGPU into a FPGA, which acts as a DisplayPort sink.

Note that the FSP GOP only initializes at most 2 iGPU display outputs.
However, all three outputs function properly once OS (Windows, Linux)
graphics drivers take over.

Additionally, update the config file that Prodrive uses to build
coreboot images so that the iGPU can be used as primary.

TEST=Verify that the iGPU's outputs work properly in pre-OS, Windows and
     Linux, on both the Poseidon and Avalanche piggy-backs.

Change-Id: I24d9ebc2055dc246e7f257aa2f3853b22c8af370
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62649
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Arthur Heymans 2022-03-07 17:39:53 +01:00 committed by Felix Held
parent bf71c7292a
commit f5575315fd
4 changed files with 35 additions and 0 deletions

View File

@ -13,3 +13,4 @@ CONFIG_POST_DEVICE_LPC=y
CONFIG_MAINBOARD_SERIAL_NUMBER="N/A" CONFIG_MAINBOARD_SERIAL_NUMBER="N/A"
CONFIG_PCIEXP_SUPPORT_RESIZABLE_BARS=y CONFIG_PCIEXP_SUPPORT_RESIZABLE_BARS=y
CONFIG_PCIEXP_DEFAULT_MAX_RESIZABLE_BAR_BITS=36 CONFIG_PCIEXP_DEFAULT_MAX_RESIZABLE_BAR_BITS=36
CONFIG_RUN_FSP_GOP=y

View File

@ -65,6 +65,11 @@ struct __packed eeprom_board_settings {
}; };
}; };
enum {
PRIMARY_VIDEO_ASPEED = 0,
PRIMARY_VIDEO_INTEL = 1,
};
_Static_assert(sizeof(struct eeprom_board_settings) == (12 + sizeof(uint32_t)), _Static_assert(sizeof(struct eeprom_board_settings) == (12 + sizeof(uint32_t)),
"struct eeprom_board_settings has invalid size!"); "struct eeprom_board_settings has invalid size!");

View File

@ -8,6 +8,7 @@
#include <crc_byte.h> #include <crc_byte.h>
#include <device/device.h> #include <device/device.h>
#include <device/dram/spd.h> #include <device/dram/spd.h>
#include <device/pci_ids.h>
#include <drivers/intel/gma/opregion.h> #include <drivers/intel/gma/opregion.h>
#include <gpio.h> #include <gpio.h>
#include <intelblocks/gpio.h> #include <intelblocks/gpio.h>
@ -302,3 +303,26 @@ static void mainboard_early(void *unused)
} }
BOOT_STATE_INIT_ENTRY(BS_PRE_DEVICE, BS_ON_EXIT, mainboard_early, NULL); BOOT_STATE_INIT_ENTRY(BS_PRE_DEVICE, BS_ON_EXIT, mainboard_early, NULL);
/*
* coreboot only exposes the last framebuffer that is set up.
* The ASPEED BMC will always be initialized after the IGD due to its higher
* bus number. To have coreboot only expose the IGD framebuffer skip the init
* function on the ASPEED.
*/
static void mainboard_configure_internal_gfx(void *unused)
{
struct device *dev;
const struct eeprom_board_settings *board_cfg = get_board_settings();
if (!board_cfg)
return;
if (board_cfg->primary_video == PRIMARY_VIDEO_INTEL) {
dev = dev_find_device(PCI_VID_ASPEED, PCI_DID_ASPEED_AST2050_VGA, NULL);
dev->on_mainboard = false;
dev->enabled = false;
dev->ops->init = NULL;
}
}
BOOT_STATE_INIT_ENTRY(BS_DEV_RESOURCES, BS_ON_ENTRY, mainboard_configure_internal_gfx, NULL)

View File

@ -46,6 +46,11 @@ void mainboard_memory_init_params(FSPM_UPD *memupd)
memupd->FspmTestConfig.SmbusSpdWriteDisable = 0; memupd->FspmTestConfig.SmbusSpdWriteDisable = 0;
cannonlake_memcfg_init(&memupd->FspmConfig, &baseboard_mem_cfg); cannonlake_memcfg_init(&memupd->FspmConfig, &baseboard_mem_cfg);
/* Tell FSP-M about the desired primary video adapter so that GGC is set up properly */
const struct eeprom_board_settings *board_cfg = get_board_settings();
if (board_cfg && board_cfg->primary_video == PRIMARY_VIDEO_INTEL)
memupd->FspmConfig.PrimaryDisplay = 0; /* iGPU is primary */
/* Overwrite memupd */ /* Overwrite memupd */
if (!check_signature(offsetof(struct eeprom_layout, mupd), FSPM_UPD_SIGNATURE)) if (!check_signature(offsetof(struct eeprom_layout, mupd), FSPM_UPD_SIGNATURE))
return; return;