From 916b331a8dbe90a2810d253a8b286ca9ee804fc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Mon, 4 Sep 2017 23:43:30 +0300 Subject: ACPI S3: Handle LATE_CBMEM_INIT boards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup removes inlined acpi_is_wakeup_s3() from PRE_RAM, and new implementation depends of CAR_GLOBAL. Change-Id: Iea1c5ab2175f8d496baa09bd6137cacc912df2cb Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/21398 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin Reviewed-by: Arthur Heymans --- src/cpu/amd/car/post_cache_as_ram.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/cpu/amd/car') diff --git a/src/cpu/amd/car/post_cache_as_ram.c b/src/cpu/amd/car/post_cache_as_ram.c index d51e431560..baf4725dfd 100644 --- a/src/cpu/amd/car/post_cache_as_ram.c +++ b/src/cpu/amd/car/post_cache_as_ram.c @@ -128,6 +128,7 @@ static void vErrata343(void) asmlinkage void * post_cache_as_ram(void) { uint32_t family = amd_fam1x_cpu_family(); + int s3resume = 0; /* Verify that the BSP didn't overrun the lower stack * boundary during romstage execution @@ -139,12 +140,17 @@ asmlinkage void * post_cache_as_ram(void) if ((*lower_stack_boundary) != 0xdeadbeef) printk(BIOS_WARNING, "BSP overran lower stack boundary. Undefined behaviour may result!\n"); - int s3resume = acpi_is_wakeup_s3(); - - /* Boards with EARLY_CBMEM_INIT need to do this in cache_as_ram_main(). - */ - if (s3resume && !IS_ENABLED(CONFIG_EARLY_CBMEM_INIT)) - cbmem_recovery(s3resume); + if (IS_ENABLED(CONFIG_EARLY_CBMEM_INIT)) { + s3resume = acpi_is_wakeup_s3(); + } else { + if (IS_ENABLED(CONFIG_HAVE_ACPI_RESUME)) + s3resume = (acpi_get_sleep_type() == ACPI_S3); + /* For normal boot path, boards with LATE_CBMEM_INIT will do + * cbmem_initialize_empty() late in ramstage. + */ + if (s3resume) + cbmem_recovery(s3resume); + } prepare_romstage_ramstack(s3resume); -- cgit v1.2.3