summaryrefslogtreecommitdiff
path: root/src/soc/intel/broadwell
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2021-02-17 17:33:17 +0200
committerKyösti Mälkki <kyosti.malkki@gmail.com>2021-02-23 02:35:21 +0000
commit74cb3e78696031b191c452f12dbc278a17bffc12 (patch)
tree66657384311c41e2fadf6635a9392bbfb2cc8935 /src/soc/intel/broadwell
parentc5c3e3c594ea14066229d260e183f298236ec8a5 (diff)
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>
Diffstat (limited to 'src/soc/intel/broadwell')
-rw-r--r--src/soc/intel/broadwell/romstage.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/soc/intel/broadwell/romstage.c b/src/soc/intel/broadwell/romstage.c
index 12072a3a50..82ee73d825 100644
--- a/src/soc/intel/broadwell/romstage.c
+++ b/src/soc/intel/broadwell/romstage.c
@@ -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);
}