From e11f6c3be168b1efde7fa1b5fd8754b9b8057dc9 Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Thu, 15 Oct 2015 15:35:12 +0200 Subject: nb/intel/sandybridge/gma: add disable function Issue observed: In a multi GPU setup (IGD and PEG) the system still uses the IGD. CONFIG_ONBOARD_VGA_IS_PRIMARY has no effect on Sandy/Ivy Bridge. Test system: * Gigabyte GA-B75M-D3H * Intel Pentium CPU G2130 * ATI Radeon HD4780 Problem description: The GMA is missing a disable function. Problem solution: Add a GMA disable function. Deactivate PCI device until remaining multi GPU issues are resolved. Do not claim VGA decode any more. Final testing results: The system is able to boot using the PEG device as primary VGA device. Change-Id: I52af32df41ca22f808b119f3a4099849c74068b3 Signed-off-by: Patrick Rudolph Reviewed-on: http://review.coreboot.org/11919 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- src/northbridge/intel/sandybridge/gma.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') diff --git a/src/northbridge/intel/sandybridge/gma.c b/src/northbridge/intel/sandybridge/gma.c index d1779db8da..bf340e9f61 100644 --- a/src/northbridge/intel/sandybridge/gma.c +++ b/src/northbridge/intel/sandybridge/gma.c @@ -634,6 +634,19 @@ static void gma_ssdt(device_t device) drivers_intel_gma_displays_ssdt_generate(gfx); } +/* called by pci set_vga_bridge function */ +static void gma_func0_disable(struct device *dev) +{ + u16 reg16; + device_t dev_host = dev_find_slot(0, PCI_DEVFN(0,0)); + + reg16 = pci_read_config16(dev_host, GGC); + reg16 |= (1 << 1); /* disable VGA decode */ + pci_write_config16(dev_host, GGC, reg16); + + dev->enabled = 0; +} + static struct pci_operations gma_pci_ops = { .set_subsystem = gma_set_subsystem, }; @@ -646,6 +659,7 @@ static struct device_operations gma_func0_ops = { .init = gma_func0_init, .scan_bus = 0, .enable = 0, + .disable = gma_func0_disable, .ops_pci = &gma_pci_ops, }; -- cgit v1.2.3