asrock/e350m1: Add ACPI S3 support

To store memory configuration in SPI flash currently adds
some 150 ms delay in ramstage, visible in timestamps listing
at 75:cbmem post.

Change-Id: I1160259054b58e9a8df2a105c730e0f4140be1f5
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/12215
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: build bot (Jenkins)
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
Kyösti Mälkki 2015-10-27 14:31:18 +02:00
parent d28474b46d
commit 6882574093
3 changed files with 24 additions and 7 deletions

View File

@ -25,6 +25,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select HAVE_OPTION_TABLE select HAVE_OPTION_TABLE
select HAVE_PIRQ_TABLE select HAVE_PIRQ_TABLE
select HAVE_MP_TABLE select HAVE_MP_TABLE
select HAVE_ACPI_RESUME
select HAVE_ACPI_TABLES select HAVE_ACPI_TABLES
select BOARD_ROMSIZE_KB_4096 select BOARD_ROMSIZE_KB_4096
select GFXUMA select GFXUMA

View File

@ -115,7 +115,7 @@
#define AGESA_ENTRY_INIT_LATE TRUE #define AGESA_ENTRY_INIT_LATE TRUE
#define AGESA_ENTRY_INIT_S3SAVE TRUE #define AGESA_ENTRY_INIT_S3SAVE TRUE
#define AGESA_ENTRY_INIT_RESUME TRUE #define AGESA_ENTRY_INIT_RESUME TRUE
#define AGESA_ENTRY_INIT_LATE_RESTORE FALSE #define AGESA_ENTRY_INIT_LATE_RESTORE TRUE
#define AGESA_ENTRY_INIT_GENERAL_SERVICES FALSE #define AGESA_ENTRY_INIT_GENERAL_SERVICES FALSE
/* /*
@ -187,7 +187,7 @@ CONST AP_MTRR_SETTINGS ROMDATA OntarioApMtrrSettingsList[] =
//#define BLDCFG_USE_HT_ASSIST TRUE //#define BLDCFG_USE_HT_ASSIST TRUE
//#define BLDCFG_USE_ATM_MODE TRUE //#define BLDCFG_USE_ATM_MODE TRUE
//#define BLDCFG_PLATFORM_CONTROL_FLOW_MODE Nfcm //#define BLDCFG_PLATFORM_CONTROL_FLOW_MODE Nfcm
#define BLDCFG_S3_LATE_RESTORE FALSE #define BLDCFG_S3_LATE_RESTORE TRUE
//#define BLDCFG_USE_32_BYTE_REFRESH FALSE //#define BLDCFG_USE_32_BYTE_REFRESH FALSE
//#define BLDCFG_USE_VARIABLE_MCT_ISOC_PRIORITY FALSE //#define BLDCFG_USE_VARIABLE_MCT_ISOC_PRIORITY FALSE
//#define BLDCFG_PLATFORM_POWER_POLICY_MODE Performance //#define BLDCFG_PLATFORM_POWER_POLICY_MODE Performance

View File

@ -17,6 +17,7 @@
#include <string.h> #include <string.h>
#include <device/pci_def.h> #include <device/pci_def.h>
#include <device/pci_ids.h> #include <device/pci_ids.h>
#include <arch/acpi.h>
#include <arch/io.h> #include <arch/io.h>
#include <arch/stages.h> #include <arch/stages.h>
#include <device/pnp_def.h> #include <device/pnp_def.h>
@ -33,6 +34,7 @@
#include <cpu/x86/lapic.h> #include <cpu/x86/lapic.h>
#include <sb_cimx.h> #include <sb_cimx.h>
#include "SBPLATFORM.h" #include "SBPLATFORM.h"
#include <cpu/amd/agesa/s3_resume.h>
#define SERIAL_DEV PNP_DEV(0x2e, NCT5572D_SP1) #define SERIAL_DEV PNP_DEV(0x2e, NCT5572D_SP1)
@ -77,13 +79,27 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
post_code(0x39); post_code(0x39);
agesawrapper_amdinitearly(); agesawrapper_amdinitearly();
int s3resume = acpi_is_wakeup_s3();
if (!s3resume) {
post_code(0x40); post_code(0x40);
agesawrapper_amdinitpost(); agesawrapper_amdinitpost();
post_code(0x41); post_code(0x42);
agesawrapper_amdinitenv(); agesawrapper_amdinitenv();
amd_initenv(); amd_initenv();
} else { /* S3 detect */
printk(BIOS_INFO, "S3 detected\n");
post_code(0x60);
agesawrapper_amdinitresume();
agesawrapper_amds3laterestore();
post_code(0x61);
prepare_for_resume();
}
post_code(0x50); post_code(0x50);
copy_and_run(); copy_and_run();
printk(BIOS_ERR, "Error: copy_and_run() returned!\n"); printk(BIOS_ERR, "Error: copy_and_run() returned!\n");