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:54:13 +0000 |
commit | 6271dd8459a4dc717f920ba1997db6ad510dfcb7 (patch) | |
tree | 00d9f1ff59e2aa5af9e4f63368501b1fe2a988f9 /src | |
parent | e0165fbc944521171cd2776be4d3f655712079d2 (diff) |
soc/intel/baytrail,broadwell: Use resume_from_stage_cache()
Change-Id: Ie7b8bd02c3bb92c6ab9071941abbd90afef82601
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/50001
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/soc/intel/baytrail/refcode.c | 17 | ||||
-rw-r--r-- | src/soc/intel/broadwell/refcode.c | 18 |
2 files changed, 9 insertions, 26 deletions
diff --git a/src/soc/intel/baytrail/refcode.c b/src/soc/intel/baytrail/refcode.c index 297ed9cb8a..adc69d42b5 100644 --- a/src/soc/intel/baytrail/refcode.c +++ b/src/soc/intel/baytrail/refcode.c @@ -17,17 +17,6 @@ static void ABI_X86 send_to_console(unsigned char b) console_tx_byte(b); } -static efi_wrapper_entry_t load_refcode_from_cache(void) -{ - struct prog refcode; - - printk(BIOS_DEBUG, "refcode loading from cache.\n"); - - stage_cache_load_stage(STAGE_REFCODE, &refcode); - - return (efi_wrapper_entry_t)prog_entry(&refcode); -} - static efi_wrapper_entry_t load_reference_code(void) { struct prog prog = @@ -37,8 +26,10 @@ static efi_wrapper_entry_t load_reference_code(void) .prog = &prog, }; - if (acpi_is_wakeup_s3()) { - return load_refcode_from_cache(); + if (resume_from_stage_cache()) { + struct prog refcode; + stage_cache_load_stage(STAGE_REFCODE, &refcode); + return prog_entry(&refcode); } if (prog_locate(&prog)) { diff --git a/src/soc/intel/broadwell/refcode.c b/src/soc/intel/broadwell/refcode.c index 882f888af9..36b41779c4 100644 --- a/src/soc/intel/broadwell/refcode.c +++ b/src/soc/intel/broadwell/refcode.c @@ -13,17 +13,6 @@ #include <soc/pm.h> #include <soc/ramstage.h> -static pei_wrapper_entry_t load_refcode_from_cache(void) -{ - struct prog refcode; - - printk(BIOS_DEBUG, "refcode loading from cache.\n"); - - stage_cache_load_stage(STAGE_REFCODE, &refcode); - - return (pei_wrapper_entry_t)prog_entry(&refcode); -} - static pei_wrapper_entry_t load_reference_code(void) { struct prog prog = @@ -33,8 +22,11 @@ static pei_wrapper_entry_t load_reference_code(void) .prog = &prog, }; - if (acpi_is_wakeup_s3()) - return load_refcode_from_cache(); + if (resume_from_stage_cache()) { + struct prog refcode; + stage_cache_load_stage(STAGE_REFCODE, &refcode); + return prog_entry(&prog); + } if (prog_locate(&prog)) { printk(BIOS_DEBUG, "Couldn't locate reference code.\n"); |