soc/intel/broadwell: Use cbmem_recovery()

For consistency with other soc/intel add s3resume variable,
this helps towards unified chipset_power_state.

Change-Id: I34a123f9fc13bd86264317c7762bf6e9ffd0f842
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/50970
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Kyösti Mälkki 2021-02-17 17:33:17 +02:00
parent c5c3e3c594
commit 74cb3e7869
1 changed files with 8 additions and 7 deletions

View File

@ -41,7 +41,9 @@ void mainboard_romstage_entry(void)
/* Get power state */
struct chipset_power_state *const power_state = fill_power_state();
elog_boot_notify(power_state->prev_sleep_state == ACPI_S3);
int s3resume = power_state->prev_sleep_state == ACPI_S3;
elog_boot_notify(s3resume);
/* Print useful platform information */
report_platform_info();
@ -73,11 +75,10 @@ void mainboard_romstage_entry(void)
timestamp_add_now(TS_AFTER_INITRAM);
if (pei_data.boot_mode != ACPI_S3) {
cbmem_initialize_empty();
} else if (cbmem_initialize()) {
printk(BIOS_DEBUG, "Failed to recover CBMEM in S3 resume.\n");
int cbmem_was_initted = !cbmem_recovery(s3resume);
if (s3resume && !cbmem_was_initted) {
/* Failed S3 resume, reset to come up cleanly */
printk(BIOS_CRIT, "Failed to recover CBMEM in S3 resume.\n");
system_reset();
}
@ -85,7 +86,7 @@ void mainboard_romstage_entry(void)
setup_sdram_meminfo(&pei_data);
romstage_handoff_init(power_state->prev_sleep_state == ACPI_S3);
romstage_handoff_init(s3resume);
mainboard_post_raminit(power_state->prev_sleep_state == ACPI_S3);
mainboard_post_raminit(s3resume);
}