Arthur Heymans (arthur@aheymans.xyz) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18504
-gerrit
commit 29c538b2f7d29c55dc8187320f3b3c1023b3e314 Author: Arthur Heymans arthur@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@aheymans.xyz --- src/northbridge/intel/x4x/gma.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/src/northbridge/intel/x4x/gma.c b/src/northbridge/intel/x4x/gma.c index 74250fe..fb49af5 100644 --- a/src/northbridge/intel/x4x/gma.c +++ b/src/northbridge/intel/x4x/gma.c @@ -376,6 +376,23 @@ 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)); + u16 gcc; + + gcc = pci_read_config(dev_host, D0F0_GGC); + gcc &= 0xff0f; + ggc |= (1 << 1); + pci_write_config16(dev_host, D0F0_GGC, gcc); + + 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 +437,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[] =