summaryrefslogtreecommitdiff
path: root/src/soc/amd
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2021-01-09 13:30:57 +0200
committerKyösti Mälkki <kyosti.malkki@gmail.com>2021-01-29 10:53:33 +0000
commite0165fbc944521171cd2776be4d3f655712079d2 (patch)
treeda303ac99860420f001a843c98e547576bc4cfc8 /src/soc/amd
parentcdaddde0672643a2457b163ea1b286a4ea77c0f1 (diff)
stage_cache: Add resume_from_stage_cache()
Factor out the condition when an attempt to load stage from cache can be tried. Change-Id: I936f07bed6fc82f46118d217f1fd233e2e041405 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/50000 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/soc/amd')
-rw-r--r--src/soc/amd/common/block/pi/refcode_loader.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/soc/amd/common/block/pi/refcode_loader.c b/src/soc/amd/common/block/pi/refcode_loader.c
index 2fdbe83347..274291de56 100644
--- a/src/soc/amd/common/block/pi/refcode_loader.c
+++ b/src/soc/amd/common/block/pi/refcode_loader.c
@@ -48,9 +48,7 @@ static int agesa_locate_stage_file_ramstage(const char *name,
.prog = &prog,
};
- if (acpi_is_wakeup_s3() && !CONFIG(NO_STAGE_CACHE)) {
- printk(BIOS_INFO, "AGESA: Loading stage from cache\n");
- // There is no way to tell if this succeeded.
+ if (resume_from_stage_cache()) {
stage_cache_load_stage(STAGE_REFCODE, &prog);
} else {
if (prog_locate(&prog))
@@ -59,10 +57,7 @@ static int agesa_locate_stage_file_ramstage(const char *name,
if (rmodule_stage_load(&rmod_agesa) < 0)
return -1;
- if (!CONFIG(NO_STAGE_CACHE)) {
- printk(BIOS_INFO, "AGESA: Saving stage to cache\n");
- stage_cache_add(STAGE_REFCODE, &prog);
- }
+ stage_cache_add(STAGE_REFCODE, &prog);
}
return rdev_chain(rdev, prog_rdev(&prog), 0,