nb/intel/x4x: Don't run NGI if IGD has not been assigned VGA cycles

The NGI writes to legacy VGA registers which should not happen when
VGA cycles are assigned to a different device.

TESTED on ga-g41m-es2l

Change-Id: I0a03e35c0d7f2532edd6cc5e62d1cf07dab57f60
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/19607
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
Arthur Heymans 2017-05-06 18:05:57 +02:00 committed by Nico Huber
parent c80748c2d0
commit 2e7efe65a2
1 changed files with 11 additions and 3 deletions

View File

@ -356,7 +356,7 @@ static void native_init(struct device *dev)
static void gma_func0_init(struct device *dev) static void gma_func0_init(struct device *dev)
{ {
u16 reg16; u16 reg16, ggc;
u32 reg32; u32 reg32;
/* IGD needs to be Bus Master */ /* IGD needs to be Bus Master */
@ -370,10 +370,18 @@ static void gma_func0_init(struct device *dev)
reg16 |= 0xbc; reg16 |= 0xbc;
pci_write_config16(dev_find_slot(0, PCI_DEVFN(0x2, 0)), 0xcc, reg16); pci_write_config16(dev_find_slot(0, PCI_DEVFN(0x2, 0)), 0xcc, reg16);
if (IS_ENABLED(CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT)) ggc = pci_read_config16(dev_find_slot(0, PCI_DEVFN(0, 0)), D0F0_GGC);
if (IS_ENABLED(CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT)) {
if (ggc & (1 << 1)) {
printk(BIOS_DEBUG, "VGA cycles not assigned to IGD. "
"Not running native graphic init.\n");
return;
}
native_init(dev); native_init(dev);
else } else {
pci_dev_init(dev); pci_dev_init(dev);
}
} }
static void gma_func0_disable(struct device *dev) static void gma_func0_disable(struct device *dev)