[coreboot-gerrit] Patch set updated for coreboot: nb/x4x/gma.c: Add disable function
Arthur Heymans (arthur@aheymans.xyz)
gerrit at coreboot.org
Mon Feb 27 10:01:17 CET 2017
Arthur Heymans (arthur at aheymans.xyz) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18504
-gerrit
commit 9b6ff3ece9e283fb8a60e3969673be7ffde73139
Author: Arthur Heymans <arthur at aheymans.xyz>
Date: Sun Feb 26 23:04:51 2017 +0100
nb/x4x/gma.c: Add disable function
This should allow set_vga_bridge_bits() in device.c to disable the
integrated GPU when an external GPU is detected.
UNTESTED
Change-Id: I74890918feb0f1ff6b971c4aaa96f1f7b75266ac
Signed-off-by: Arthur Heymans <arthur at aheymans.xyz>
---
src/northbridge/intel/x4x/gma.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/northbridge/intel/x4x/gma.c b/src/northbridge/intel/x4x/gma.c
index 74250fe..0d41afe 100644
--- a/src/northbridge/intel/x4x/gma.c
+++ b/src/northbridge/intel/x4x/gma.c
@@ -376,6 +376,19 @@ static void gma_func0_init(struct device *dev)
pci_dev_init(dev);
}
+static void gma_func0_disable(struct device *dev)
+{
+ struct device *dev_host = dev_find_slot(0, PCI_DEVFN(0x0, 0));
+
+ pci_write_config16(dev_host, D0F0_GGC, (1 << 1));
+
+ unsigned int reg32 = pci_read_config32(dev_host, D0F0_DEVEN);
+ reg32 &= ~(IGD0EN | IGD1EN);
+ pci_write_config32(dev_host, D0F0_DEVEN, reg32);
+
+ dev->enabled = 0;
+}
+
static void gma_set_subsystem(device_t dev, unsigned vendor, unsigned device)
{
if (!vendor || !device) {
@@ -420,6 +433,7 @@ static struct device_operations gma_func0_ops = {
.acpi_fill_ssdt_generator = gma_ssdt,
.init = gma_func0_init,
.ops_pci = &gma_pci_ops,
+ .disable = gma_func0_disable,
};
static const unsigned short pci_device_ids[] =
More information about the coreboot-gerrit
mailing list