summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2017-09-04 23:43:30 +0300
committerKyösti Mälkki <kyosti.malkki@gmail.com>2017-09-09 11:18:10 +0000
commit916b331a8dbe90a2810d253a8b286ca9ee804fc5 (patch)
treebb2c0ec2be30557598b0f6cebf6992c3fcd86bfc /src
parentd35c06d09ee79eb76ec491431b3df4149100ad52 (diff)
downloadcoreboot-916b331a8dbe90a2810d253a8b286ca9ee804fc5.tar.xz
ACPI S3: Handle LATE_CBMEM_INIT boards
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 <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/21398 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'src')
-rw-r--r--src/cpu/amd/car/post_cache_as_ram.c18
1 files changed, 12 insertions, 6 deletions
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);