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>
This commit is contained in:
Kyösti Mälkki 2017-09-04 23:43:30 +03:00
parent d35c06d09e
commit 916b331a8d
1 changed files with 12 additions and 6 deletions

View File

@ -128,6 +128,7 @@ static void vErrata343(void)
asmlinkage void * post_cache_as_ram(void) asmlinkage void * post_cache_as_ram(void)
{ {
uint32_t family = amd_fam1x_cpu_family(); uint32_t family = amd_fam1x_cpu_family();
int s3resume = 0;
/* Verify that the BSP didn't overrun the lower stack /* Verify that the BSP didn't overrun the lower stack
* boundary during romstage execution * boundary during romstage execution
@ -139,12 +140,17 @@ asmlinkage void * post_cache_as_ram(void)
if ((*lower_stack_boundary) != 0xdeadbeef) if ((*lower_stack_boundary) != 0xdeadbeef)
printk(BIOS_WARNING, "BSP overran lower stack boundary. Undefined behaviour may result!\n"); printk(BIOS_WARNING, "BSP overran lower stack boundary. Undefined behaviour may result!\n");
int s3resume = acpi_is_wakeup_s3(); if (IS_ENABLED(CONFIG_EARLY_CBMEM_INIT)) {
s3resume = acpi_is_wakeup_s3();
/* Boards with EARLY_CBMEM_INIT need to do this in cache_as_ram_main(). } else {
*/ if (IS_ENABLED(CONFIG_HAVE_ACPI_RESUME))
if (s3resume && !IS_ENABLED(CONFIG_EARLY_CBMEM_INIT)) s3resume = (acpi_get_sleep_type() == ACPI_S3);
cbmem_recovery(s3resume); /* 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); prepare_romstage_ramstack(s3resume);