summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/intel/fsp2_0/include/fsp/api.h2
-rw-r--r--src/drivers/intel/fsp2_0/silicon_init.c18
2 files changed, 18 insertions, 2 deletions
diff --git a/src/drivers/intel/fsp2_0/include/fsp/api.h b/src/drivers/intel/fsp2_0/include/fsp/api.h
index 553fc52d01..b0120400c2 100644
--- a/src/drivers/intel/fsp2_0/include/fsp/api.h
+++ b/src/drivers/intel/fsp2_0/include/fsp/api.h
@@ -38,7 +38,7 @@ enum fsp_notify_phase {
/* Main FSP stages */
void fsp_memory_init(bool s3wake);
-void fsp_silicon_init(void);
+void fsp_silicon_init(bool s3wake);
/* Callbacks for updating stage-specific parameters */
void platform_fsp_memory_init_params_cb(FSPM_UPD *mupd);
diff --git a/src/drivers/intel/fsp2_0/silicon_init.c b/src/drivers/intel/fsp2_0/silicon_init.c
index b911553c2f..e6464aa3df 100644
--- a/src/drivers/intel/fsp2_0/silicon_init.c
+++ b/src/drivers/intel/fsp2_0/silicon_init.c
@@ -18,6 +18,7 @@
#include <fsp/api.h>
#include <fsp/util.h>
#include <program_loading.h>
+#include <stage_cache.h>
#include <string.h>
#include <timestamp.h>
@@ -61,7 +62,7 @@ static void do_silicon_init(struct fsp_header *hdr)
}
}
-void fsp_silicon_init(void)
+void fsp_silicon_init(bool s3wake)
{
struct fsp_header *hdr = &fsps_hdr;
struct cbfsf file_desc;
@@ -69,6 +70,17 @@ void fsp_silicon_init(void)
const char *name = CONFIG_FSP_S_CBFS;
void *dest;
size_t size;
+ struct prog fsps = PROG_INIT(PROG_REFCODE, name);
+
+ if (s3wake && !IS_ENABLED(CONFIG_NO_STAGE_CACHE)) {
+ printk(BIOS_DEBUG, "Loading FSPS from stage_cache\n");
+ stage_cache_load_stage(STAGE_REFCODE, &fsps);
+ if (fsp_validate_component(hdr, prog_rdev(&fsps)) != CB_SUCCESS)
+ die("On resume fsps header is invalid\n");
+ do_silicon_init(hdr);
+ return;
+ }
+
if (cbfs_boot_locate(&file_desc, name, NULL)) {
printk(BIOS_ERR, "Could not locate %s in CBFS\n", name);
@@ -98,6 +110,10 @@ void fsp_silicon_init(void)
if (fsp_validate_component(hdr, &rdev) != CB_SUCCESS)
die("Invalid FSPS header!\n");
+ prog_set_area(&fsps, dest, size);
+
+ stage_cache_add(STAGE_REFCODE, &fsps);
+
/* Signal that FSP component has been loaded. */
prog_segment_loaded(hdr->image_base, hdr->image_size, SEG_FINAL);