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 e51349b01de833d96b86cbaf13f6c34577389da1 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..a55eee4 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 ggc; + + ggc = pci_read_config16(dev_host, D0F0_GGC); + ggc &= 0xff0f; + ggc |= (1 << 1); + pci_write_config16(dev_host, D0F0_GGC, ggc); + + 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[] =