Paul Menzel has uploaded this change for review.

View Change

Add Kconfig option for ACPI S3 support

Being able to disable ACPI S3 saves 150 ms on the ASRock E350M1.

Change-Id: Ie25c6ab5cd927287f0e2ff00cce042a95f7d377c
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
---
M src/Kconfig
M src/lib/hardwaremain.c
2 files changed, 20 insertions(+), 4 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/77/41877/1
diff --git a/src/Kconfig b/src/Kconfig
index 2a2a144..0e89eb6 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -135,6 +135,22 @@
every boot. Use this if you want the NVRAM configuration to
never be modified from its default values.

+config DO_ACPI_RESUME
+ bool "Enable ACPI S3 resume"
+ default y
+ depends on HAVE_ACPI_RESUME
+ help
+ Adds S3 to the available sleepstates
+
+ Enabling ACPI S3 resume support delays the boot-up on certain boards.
+ For example, the delay it 200 ms on the AMD AGESA board ASRock E350M1.
+
+ If you do not need ACPI S3 resume support, select this option.
+
+ (And why should you, with coreboot, an SSD and an optimized OS, you
+ boot as fast as with resuming from ACPI S3, and have less code paths
+ to maintain and test.)
+
config COMPRESS_RAMSTAGE
bool "Compress ramstage with LZMA"
depends on HAVE_RAMSTAGE
diff --git a/src/lib/hardwaremain.c b/src/lib/hardwaremain.c
index 935393e..20b7c25 100644
--- a/src/lib/hardwaremain.c
+++ b/src/lib/hardwaremain.c
@@ -19,7 +19,7 @@
#include <stdlib.h>
#include <boot/tables.h>
#include <program_loading.h>
-#if CONFIG(HAVE_ACPI_RESUME)
+#if CONFIG(DO_ACPI_RESUME)
#include <acpi/acpi.h>
#endif
#include <timer.h>
@@ -151,7 +151,7 @@

static boot_state_t bs_os_resume_check(void *arg)
{
-#if CONFIG(HAVE_ACPI_RESUME)
+#if CONFIG(DO_ACPI_RESUME)
void *wake_vector;

wake_vector = acpi_find_wakeup_vector();
@@ -168,7 +168,7 @@

static boot_state_t bs_os_resume(void *wake_vector)
{
-#if CONFIG(HAVE_ACPI_RESUME)
+#if CONFIG(DO_ACPI_RESUME)
arch_bootstate_coreboot_exit();
acpi_resume(wake_vector);
#endif
@@ -445,7 +445,7 @@
post_code(POST_ENTRY_RAMSTAGE);

/* Handoff sleep type from romstage. */
-#if CONFIG(HAVE_ACPI_RESUME)
+#if CONFIG(DO_ACPI_RESUME)
acpi_is_wakeup();
#endif
threads_initialize();

To view, visit change 41877. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ie25c6ab5cd927287f0e2ff00cce042a95f7d377c
Gerrit-Change-Number: 41877
Gerrit-PatchSet: 1
Gerrit-Owner: Paul Menzel <paulepanter@users.sourceforge.net>
Gerrit-MessageType: newchange