diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2021-02-17 17:33:17 +0200 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2021-02-23 02:35:08 +0000 |
commit | c5c3e3c594ea14066229d260e183f298236ec8a5 (patch) | |
tree | a85dc6c18a078b1da9511444648bb98c6fb13d7b | |
parent | 6ceec167f568930d9b688194cb140c60a885dd8c (diff) |
soc/intel/baytrail: Use cbmem_recovery()
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 <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/50969
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
-rw-r--r-- | src/soc/intel/baytrail/romstage/raminit.c | 11 |
1 files changed, 6 insertions, 5 deletions
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(); } |