summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/soc/intel/baytrail/refcode.c17
-rw-r--r--src/soc/intel/broadwell/refcode.c18
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");