nb/intel/*/gma.c: Skip NGI when VGA decode is not enabled

Writes to VGA MEM and IO by NGI are invalid if the IGD is not decoding
them.

Change-Id: I4b9329d14105eb563a0d4aea6ef75ff11febf6df
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/27984
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
This commit is contained in:
Arthur Heymans
2018-08-09 11:31:51 +02:00
committed by Felix Held
parent db2f91b1f7
commit e6c8f7ec20
6 changed files with 81 additions and 37 deletions

View File

@@ -700,12 +700,20 @@ static void gma_func0_init(struct device *dev)
pci_write_config32(dev, PCI_COMMAND, reg32 | PCI_COMMAND_MASTER
| PCI_COMMAND_IO | PCI_COMMAND_MEMORY);
int vga_disable = (pci_read_config16(dev, GGC) & 2) >> 1;
if (IS_ENABLED(CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT)) {
if (acpi_is_wakeup_s3())
if (acpi_is_wakeup_s3()) {
printk(BIOS_INFO,
"Skipping native VGA initialization when resuming from ACPI S3.\n");
else
gma_ngi(dev);
} else {
if (vga_disable) {
printk(BIOS_INFO,
"IGD is not decoding legacy VGA MEM and IO: skipping NATIVE graphic init\n");
} else {
gma_ngi(dev);
}
}
} else {
/* PCI Init, will run VBIOS */
pci_dev_init(dev);