Paul Menzel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/41877 )
Change subject: Add Kconfig option for ACPI S3 support ......................................................................
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();
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41877 )
Change subject: Add Kconfig option for ACPI S3 support ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/41877/1/src/lib/hardwaremain.c File src/lib/hardwaremain.c:
https://review.coreboot.org/c/coreboot/+/41877/1/src/lib/hardwaremain.c@164 PS1, Line 164: timestamp_add_now(TS_CBMEM_POST); For some reason this still takes 250 ms, despite unselecting `DO_ACPI_RESUME`. More analysis is needed.
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41877 )
Change subject: Add Kconfig option for ACPI S3 support ......................................................................
Patch Set 1:
Michał, Krystian, once working, I guess this might also be interesting for the PC Engines APU boards.
``` $ more pcengines/apu1/4.11-2657-gbc41ccf12c/2020-05-11T06_23_33Z/coreboot_console.txt […]
BS: BS_POST_DEVICE run times (exec / console): 0 / 4 ms
APIC 00: ** Enter AmdInitLate [00020004] ASSERTION ERROR: file 'src/vendorcode/amd/agesa/f14/Proc/Common/CommonReturns.c', line 174 ASSERTION ERROR: file 'src/vendorcode/amd/agesa/f14/Proc/CPU/cpuGeneralServices.c', line 817 ASSERTION ERROR: file 'src/vendorcode/amd/agesa/f14/Proc/Common/CommonReturns.c', line 174 ASSERTION ERROR: file 'src/vendorcode/amd/agesa/f14/Proc/CPU/cpuGeneralServices.c', line 817 SB800: sb_Late_Post AmdInitLate() returned AGESA_SUCCESS APIC 00: Heap in SystemMem (4) at 0x10000014 APIC 00: ** Exit AmdInitLate [00020004]
APIC 00: ** Enter AmdS3Save [0002000b] Manufacturer: c2 SF: Detected c2 2015 with sector size 0x1000, total 0x200000 SF: Successfully erased 4096 bytes @ 0xffff1000 Manufacturer: c2 SF: Detected c2 2015 with sector size 0x1000, total 0x200000 SF: Successfully erased 4096 bytes @ 0xffff0000 AmdS3Save() returned AGESA_SUCCESS APIC 00: Heap in SystemMem (4) at 0x10000014 APIC 00: ** Exit AmdS3Save [0002000b] BS: BS_POST_DEVICE exit times (exec / console): 109 / 86 ms […] ```
Stefan Reinauer has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/41877?usp=email )
Change subject: Add Kconfig option for ACPI S3 support ......................................................................
Abandoned