From c5c3e3c594ea14066229d260e183f298236ec8a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Wed, 17 Feb 2021 17:33:17 +0200 Subject: soc/intel/baytrail: Use cbmem_recovery() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For consistency with other soc/intel add s3resume variable, this helps towards unified chipset_power_state. Change-Id: Ida04d2292aabb5a366f3400d8596ede0dee64839 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/50969 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons --- src/soc/intel/baytrail/romstage/raminit.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/soc') diff --git a/src/soc/intel/baytrail/romstage/raminit.c b/src/soc/intel/baytrail/romstage/raminit.c index f922750a36..f62c998bd7 100644 --- a/src/soc/intel/baytrail/romstage/raminit.c +++ b/src/soc/intel/baytrail/romstage/raminit.c @@ -129,6 +129,8 @@ void raminit(struct mrc_params *mp, int prev_sleep_state) mp->prev_sleep_state = prev_sleep_state; mp->rmt_enabled = CONFIG(MRC_RMT); + int s3resume = prev_sleep_state == ACPI_S3; + /* Default to 2GiB IO hole. */ if (!mp->io_hole_mb) mp->io_hole_mb = 2048; @@ -141,7 +143,7 @@ void raminit(struct mrc_params *mp, int prev_sleep_state) &mrc_size); if (mp->saved_data) { mp->saved_data_size = mrc_size; - } else if (prev_sleep_state == ACPI_S3) { + } else if (s3resume) { /* If waking from S3 and no cache then. */ printk(BIOS_DEBUG, "No MRC cache found in S3 resume path.\n"); post_code(POST_RESUME_FAILURE); @@ -180,11 +182,10 @@ void raminit(struct mrc_params *mp, int prev_sleep_state) ret = mrc_entry(mp); - if (prev_sleep_state != 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(); } -- cgit v1.2.3