diff options
Diffstat (limited to 'src/northbridge')
-rw-r--r-- | src/northbridge/intel/haswell/northbridge.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/northbridge/intel/haswell/northbridge.c b/src/northbridge/intel/haswell/northbridge.c index d11eb2e54d..a803e981e0 100644 --- a/src/northbridge/intel/haswell/northbridge.c +++ b/src/northbridge/intel/haswell/northbridge.c @@ -14,6 +14,7 @@ * GNU General Public License for more details. */ +#include <commonlib/helpers.h> #include <console/console.h> #include <arch/acpi.h> #include <arch/io.h> @@ -22,7 +23,9 @@ #include <cpu/intel/haswell/haswell.h> #include <device/device.h> #include <device/pci.h> +#include <device/pci_def.h> #include <device/pci_ids.h> +#include <device/pci_ops.h> #include <stdlib.h> #include <string.h> #include <cpu/x86/smm.h> @@ -423,6 +426,47 @@ static void mc_read_resources(struct device *dev) mc_add_dram_resources(dev, &index); } +/* + * The Mini-HD audio device is disabled whenever the IGD is. This is + * because it provides audio over the integrated graphics port(s), which + * requires the IGD to be functional. + */ +static void disable_devices(void) +{ + static const struct { + const unsigned int devfn; + const u32 mask; + const char *const name; + } nb_devs[] = { + { PCI_DEVFN(1, 2), DEVEN_D1F2EN, "PEG12" }, + { PCI_DEVFN(1, 1), DEVEN_D1F1EN, "PEG11" }, + { PCI_DEVFN(1, 0), DEVEN_D1F0EN, "PEG10" }, + { PCI_DEVFN(2, 0), DEVEN_D2EN | DEVEN_D3EN, "IGD" }, + { PCI_DEVFN(3, 0), DEVEN_D3EN, "Mini-HD audio" }, + { PCI_DEVFN(4, 0), DEVEN_D4EN, "\"device 4\"" }, + { PCI_DEVFN(7, 0), DEVEN_D7EN, "\"device 7\"" }, + }; + + struct device *host_dev = dev_find_slot(0, PCI_DEVFN(0, 0)); + u32 deven; + size_t i; + + if (!host_dev) + return; + + deven = pci_read_config32(host_dev, DEVEN); + + for (i = 0; i < ARRAY_SIZE(nb_devs); i++) { + struct device *dev = dev_find_slot(0, nb_devs[i].devfn); + if (!dev || !dev->enabled) { + printk(BIOS_DEBUG, "Disabling %s.\n", nb_devs[i].name); + deven &= ~nb_devs[i].mask; + } + } + + pci_write_config32(host_dev, DEVEN, deven); +} + static void intel_set_subsystem(struct device *dev, unsigned int vendor, unsigned int device) { @@ -445,6 +489,8 @@ static void northbridge_init(struct device *dev) pair |= 0x4; /* Fixed Priority */ MCHBAR8(0x5418) = pair; + disable_devices(); + /* * Set bits 0+1 of BIOS_RESET_CPL to indicate to the CPU * that BIOS has initialized memory and power management |