diff options
author | Patrick Rudolph <siro@das-labor.org> | 2017-05-18 18:26:30 +0200 |
---|---|---|
committer | Nico Huber <nico.h@gmx.de> | 2017-06-15 01:12:19 +0200 |
commit | 402e9c18dd88b2b91db56e452075f1be6173d588 (patch) | |
tree | 562e493f2fa2fd7c8980aaed2cd7ae0fb3307265 /src/northbridge/intel/sandybridge/gma.c | |
parent | 5c82026ca6d78e60b5b400166325699ccf774610 (diff) | |
download | coreboot-402e9c18dd88b2b91db56e452075f1be6173d588.tar.xz |
nb/intel/sandybridge/gma: Use common init_igd_opregion method
Use common init_igd_opregion method.
Change-Id: Ia10a28d05b611a59f787b53f9736b3b76a19ea4a
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-on: https://review.coreboot.org/19908
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/northbridge/intel/sandybridge/gma.c')
-rw-r--r-- | src/northbridge/intel/sandybridge/gma.c | 48 |
1 files changed, 36 insertions, 12 deletions
diff --git a/src/northbridge/intel/sandybridge/gma.c b/src/northbridge/intel/sandybridge/gma.c index bc64fe695b..f53493096f 100644 --- a/src/northbridge/intel/sandybridge/gma.c +++ b/src/northbridge/intel/sandybridge/gma.c @@ -25,6 +25,7 @@ #include <cpu/x86/msr.h> #include <cpu/x86/mtrr.h> #include <southbridge/intel/bd82x6x/nvs.h> +#include <northbridge/intel/common/gma_opregion.h> #include <cbmem.h> #include "chip.h" @@ -652,27 +653,50 @@ static void gma_ssdt(device_t device) drivers_intel_gma_displays_ssdt_generate(gfx); } +/* Enable SCI to ACPI _GPE._L06 */ +static void gma_enable_swsci(void) +{ + u16 reg16; + + /* clear DMISCI status */ + reg16 = inw(DEFAULT_PMBASE + TCO1_STS); + reg16 &= DMISCI_STS; + outw(DEFAULT_PMBASE + TCO1_STS, reg16); + + /* clear acpi tco status */ + outl(DEFAULT_PMBASE + GPE0_STS, TCOSCI_STS); + + /* enable acpi tco scis */ + reg16 = inw(DEFAULT_PMBASE + GPE0_EN); + reg16 |= TCOSCI_EN; + outw(DEFAULT_PMBASE + GPE0_EN, reg16); +} + static unsigned long gma_write_acpi_tables(struct device *const dev, unsigned long current, struct acpi_rsdp *const rsdp) { - igd_opregion_t *opregion; + igd_opregion_t *opregion = (igd_opregion_t *)current; global_nvs_t *gnvs; - // FIXME: Replace by common VBT implementation writing to current - opregion = igd_make_opregion(); - if (opregion) { - /* GNVS has been already set up */ - gnvs = cbmem_find(CBMEM_ID_ACPI_GNVS); - if (gnvs) { - /* IGD OpRegion Base Address */ - gnvs->aslb = (u32)(uintptr_t)opregion; - } else { - printk(BIOS_ERR, "Error: GNVS table not found.\n"); - } + if (init_igd_opregion(opregion) != CB_SUCCESS) + return current; + + current += sizeof(igd_opregion_t); + + /* GNVS has been already set up */ + gnvs = cbmem_find(CBMEM_ID_ACPI_GNVS); + if (gnvs) { + /* IGD OpRegion Base Address */ + gnvs->aslb = (u32)(uintptr_t)opregion; + } else { + printk(BIOS_ERR, "Error: GNVS table not found.\n"); } + gma_enable_swsci(); + + current = acpi_align_current(current); return current; } |