haswell: use s3_resume field in romstage_handoff
Now that there is a way to disseminate the presence of s3 wake more formally use that instead of hard coded pointers in memory and stashing magic values in device registers. The northbridge code picks up the field's presence in the romstage_handoff structure and sets up the acpi_slp_type variable accordingly. Change-Id: Ida786728ce2950bd64610a99b7ad4f1ca6917a99 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/2799 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
committed by
Ronald G. Minnich
parent
605ca1bb9c
commit
bf396ff21c
@@ -35,6 +35,7 @@
|
||||
#include <cpu/x86/smm.h>
|
||||
#include <boot/tables.h>
|
||||
#include <cbmem.h>
|
||||
#include <romstage_handoff.h>
|
||||
#include "chip.h"
|
||||
#include "haswell.h"
|
||||
|
||||
@@ -560,19 +561,19 @@ int cbmem_get_table_location(uint64_t *tables_base, uint64_t *tables_size)
|
||||
static void northbridge_enable(device_t dev)
|
||||
{
|
||||
#if CONFIG_HAVE_ACPI_RESUME
|
||||
switch (pci_read_config32(dev, SKPAD)) {
|
||||
case 0xcafebabe:
|
||||
printk(BIOS_DEBUG, "Normal boot.\n");
|
||||
acpi_slp_type=0;
|
||||
break;
|
||||
case 0xcafed00d:
|
||||
printk(BIOS_DEBUG, "S3 Resume.\n");
|
||||
acpi_slp_type=3;
|
||||
break;
|
||||
default:
|
||||
struct romstage_handoff *handoff;
|
||||
|
||||
handoff = cbmem_find(CBMEM_ID_ROMSTAGE_INFO);
|
||||
|
||||
if (handoff == NULL) {
|
||||
printk(BIOS_DEBUG, "Unknown boot method, assuming normal.\n");
|
||||
acpi_slp_type=0;
|
||||
break;
|
||||
acpi_slp_type = 0;
|
||||
} else if (handoff->s3_resume) {
|
||||
printk(BIOS_DEBUG, "S3 Resume.\n");
|
||||
acpi_slp_type = 3;
|
||||
} else {
|
||||
printk(BIOS_DEBUG, "Normal boot.\n");
|
||||
acpi_slp_type = 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user