From 67df3ff8003bf3f78e5168245a727e10752e2062 Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Fri, 29 Jan 2021 18:20:11 +0100 Subject: soc/intel/{baytrail,broadwell} Fix building with refcode blobs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Because the refcode blobs are not redistributable, refcode.c is not build-tested. Commit 6271dd8459 (soc/intel/baytrail,broadwell: Use resume_from_stage_cache()) broke building with refcode blobs. Fix a variable redeclaration error by swapping the order of the code, and use consistent names for the variables. Change-Id: Ic8dda8d35086d977b536686e8c80b7961c37860c Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/50134 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki Reviewed-by: Nico Huber --- src/soc/intel/baytrail/refcode.c | 12 ++++++------ src/soc/intel/broadwell/refcode.c | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/soc/intel/baytrail/refcode.c b/src/soc/intel/baytrail/refcode.c index adc69d42b5..8cd7336a62 100644 --- a/src/soc/intel/baytrail/refcode.c +++ b/src/soc/intel/baytrail/refcode.c @@ -19,6 +19,12 @@ static void ABI_X86 send_to_console(unsigned char b) static efi_wrapper_entry_t load_reference_code(void) { + if (resume_from_stage_cache()) { + struct prog prog; + stage_cache_load_stage(STAGE_REFCODE, &prog); + return prog_entry(&prog); + } + struct prog prog = PROG_INIT(PROG_REFCODE, CONFIG_CBFS_PREFIX "/refcode"); struct rmod_stage_load refcode = { @@ -26,12 +32,6 @@ static efi_wrapper_entry_t load_reference_code(void) .prog = &prog, }; - if (resume_from_stage_cache()) { - struct prog refcode; - stage_cache_load_stage(STAGE_REFCODE, &refcode); - return prog_entry(&refcode); - } - if (prog_locate(&prog)) { printk(BIOS_DEBUG, "Couldn't locate reference code.\n"); return NULL; diff --git a/src/soc/intel/broadwell/refcode.c b/src/soc/intel/broadwell/refcode.c index 36b41779c4..31d6ad8482 100644 --- a/src/soc/intel/broadwell/refcode.c +++ b/src/soc/intel/broadwell/refcode.c @@ -15,6 +15,12 @@ static pei_wrapper_entry_t load_reference_code(void) { + if (resume_from_stage_cache()) { + struct prog prog; + stage_cache_load_stage(STAGE_REFCODE, &prog); + return prog_entry(&prog); + } + struct prog prog = PROG_INIT(PROG_REFCODE, CONFIG_CBFS_PREFIX "/refcode"); struct rmod_stage_load refcode = { @@ -22,12 +28,6 @@ static pei_wrapper_entry_t load_reference_code(void) .prog = &prog, }; - 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"); return NULL; -- cgit v1.2.3