From 9aca643ccb69db959906c5c233df9cd1807f5cf0 Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Sat, 20 May 2017 11:49:22 +0200 Subject: nb/intel/haswell/gma: Use common init_igd_opregion method Use common init_igd_opregion method and remove duplicated code in acpi.c. Change-Id: I811e8bd2be68813321dc4581af02e1c21b0da076 Signed-off-by: Patrick Rudolph Reviewed-on: https://review.coreboot.org/19910 Tested-by: build bot (Jenkins) Reviewed-by: Matt DeVillier Reviewed-by: Nico Huber --- src/northbridge/intel/haswell/gma.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/northbridge/intel/haswell/gma.c') diff --git a/src/northbridge/intel/haswell/gma.c b/src/northbridge/intel/haswell/gma.c index 172aa7ed0d..fa4dec91e2 100644 --- a/src/northbridge/intel/haswell/gma.c +++ b/src/northbridge/intel/haswell/gma.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -493,6 +494,20 @@ 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(get_pmbase() + TCO1_STS); + reg16 &= DMISCI_STS; + outw(get_pmbase() + TCO1_STS, reg16); + + /* clear and enable ACPI TCO SCI */ + enable_tco_sci(); +} + static unsigned long gma_write_acpi_tables(struct device *const dev, unsigned long current, @@ -500,11 +515,13 @@ gma_write_acpi_tables(struct device *const dev, { igd_opregion_t *opregion = (igd_opregion_t *)current; - if (init_igd_opregion(opregion)) + if (init_igd_opregion(opregion) != CB_SUCCESS) return current; current += sizeof(igd_opregion_t); + gma_enable_swsci(); + current = acpi_align_current(current); return current; } -- cgit v1.2.3