diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2021-01-09 13:30:57 +0200 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2021-01-29 10:53:33 +0000 |
commit | e0165fbc944521171cd2776be4d3f655712079d2 (patch) | |
tree | da303ac99860420f001a843c98e547576bc4cfc8 /src/lib | |
parent | cdaddde0672643a2457b163ea1b286a4ea77c0f1 (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/lib')
-rw-r--r-- | src/lib/prog_loaders.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/lib/prog_loaders.c b/src/lib/prog_loaders.c index 93efc0a280..4722e54501 100644 --- a/src/lib/prog_loaders.c +++ b/src/lib/prog_loaders.c @@ -10,7 +10,6 @@ #include <lib.h> #include <program_loading.h> #include <reset.h> -#include <romstage_handoff.h> #include <rmodule.h> #include <stage_cache.h> #include <symbols.h> @@ -76,9 +75,6 @@ int __weak prog_locate_hook(struct prog *prog) { return 0; } static void run_ramstage_from_resume(struct prog *ramstage) { - if (!romstage_handoff_is_resume()) - return; - /* Load the cached ramstage to runtime location. */ stage_cache_load_stage(STAGE_RAMSTAGE, ramstage); @@ -119,7 +115,7 @@ void run_ramstage(void) * Only x86 systems using ramstage stage cache currently take the same * firmware path on resume. */ - if (ENV_X86 && !CONFIG(NO_STAGE_CACHE)) + if (ENV_X86 && resume_from_stage_cache()) run_ramstage_from_resume(&ramstage); vboot_run_logic(); |