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 <siro@das-labor.org>
Reviewed-on: http://review.coreboot.org/11919
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h@gmx.de>
diff --git a/src/northbridge/intel/sandybridge/gma.c b/src/northbridge/intel/sandybridge/gma.c
index d1779db..bf340e9 100644
--- a/src/northbridge/intel/sandybridge/gma.c
+++ b/src/northbridge/intel/sandybridge/gma.c
@@ -634,6 +634,19 @@
 	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 @@
 	.init			= gma_func0_init,
 	.scan_bus		= 0,
 	.enable			= 0,
+	.disable		= gma_func0_disable,
 	.ops_pci		= &gma_pci_ops,
 };