Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/20436
Change subject: drv/intel/gma/opregion: Add method to restore ASLS ......................................................................
drv/intel/gma/opregion: Add method to restore ASLS
Add a new method to restore ASLS on S3 resume. Use new interface introduced in last commit.
Change-Id: I254683081cbaf3a5938794dcba140ac9ee07f48a Signed-off-by: Patrick Rudolph siro@das-labor.org --- M src/drivers/intel/gma/opregion.c M src/drivers/intel/gma/opregion.h 2 files changed, 17 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/36/20436/1
diff --git a/src/drivers/intel/gma/opregion.c b/src/drivers/intel/gma/opregion.c index 7871981..503f729 100644 --- a/src/drivers/intel/gma/opregion.c +++ b/src/drivers/intel/gma/opregion.c @@ -18,6 +18,8 @@ #include <device/pci.h> #include <device/pci_ids.h> #include <device/pci_ops.h> +#include <console/console.h> +#include <cbmem.h> #include "opregion.h"
/* Write ASLS PCI register and prepare SWSCI register. */ @@ -47,3 +49,17 @@ reg16 |= SMISCISEL; pci_write_config16(igd, SWSCI, reg16); } + +/* Restore ASLS register on S3 resume and prepare SWSCI. */ +void +intel_gma_restore_opregion(void) +{ + if (acpi_is_wakeup_s3()) { + const void *const gnvs = cbmem_find(CBMEM_ID_ACPI_GNVS); + + if (gnvs && gma_get_gnvs_aslb(gnvs)) + intel_gma_opregion_register(gma_get_gnvs_aslb(gnvs)); + else + printk(BIOS_ERR, "Error: GNVS or ASLB not set.\n"); + } +} diff --git a/src/drivers/intel/gma/opregion.h b/src/drivers/intel/gma/opregion.h index ff64aec..3e9ffd3 100644 --- a/src/drivers/intel/gma/opregion.h +++ b/src/drivers/intel/gma/opregion.h @@ -246,6 +246,7 @@ } __attribute__((packed)) optionrom_vbt_t;
void intel_gma_opregion_register(uintptr_t opregion); +void intel_gma_restore_opregion(void); uintptr_t gma_get_gnvs_aslb(const void *gnvs); void gma_set_gnvs_aslb(const void *gnvs, uintptr_t aslb);