summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Georgi <patrick.georgi@secunet.com>2012-07-20 12:37:06 +0200
committerPatrick Georgi <patrick@georgi-clan.de>2012-07-22 17:01:29 +0200
commitce6e9fed2e1e0e5a493d1133caf5c6b9f713b7fc (patch)
tree91fd69f30448aab5e7cf777374a868a49b9ec243
parenta555e55d15298da56f6752d01e4f8a04ae1a4eb8 (diff)
downloadcoreboot-ce6e9fed2e1e0e5a493d1133caf5c6b9f713b7fc.tar.xz
i945: Disable IGD if plugin VGA is preferred
It's shut down, but UMA memory is not reclaimed. A later extension could optionally do the magic register dance that allows initialization of IGD as secondary graphics device. Change-Id: I2a92bb71755005b886a8e1825325c678a9991bf2 Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com> Reviewed-on: http://review.coreboot.org/1252 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
-rw-r--r--src/northbridge/intel/i945/gma.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/northbridge/intel/i945/gma.c b/src/northbridge/intel/i945/gma.c
index b703a80e71..bf381b832b 100644
--- a/src/northbridge/intel/i945/gma.c
+++ b/src/northbridge/intel/i945/gma.c
@@ -23,6 +23,7 @@
#include <device/pci.h>
#include <device/pci_ids.h>
#include <pc80/mc146818rtc.h>
+#include "i945.h"
#define GDRST 0xc0
@@ -44,6 +45,22 @@ static void gma_func0_init(struct device *dev)
pci_dev_init(dev);
}
+/* This doesn't reclaim stolen UMA memory, but IGD could still
+ be reenabled later. */
+static void gma_func0_disable(struct device *dev)
+{
+ struct device *dev_host = dev_find_slot(0, PCI_DEVFN(0x0, 0));
+
+ pci_write_config16(dev, GCFC, 0xa00);
+ pci_write_config16(dev_host, GGC, (1 << 1));
+
+ unsigned int reg32 = pci_read_config32(dev_host, DEVEN);
+ reg32 &= ~(DEVEN_D2F0 | DEVEN_D2F1);
+ pci_write_config32(dev_host, DEVEN, reg32);
+
+ dev->enabled = 0;
+}
+
static void gma_func1_init(struct device *dev)
{
u32 reg32;
@@ -82,6 +99,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,
};