From 06b68d1097b31f55883b4f8ad9503783dfff239a Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Mon, 6 Jul 2020 11:02:53 +0200 Subject: prog_loaders: Fix ramstage loading on x86 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A regression sneaked in with 18a8ba41cc (arch/x86: Remove RELOCATABLE_ RAMSTAGE). We want to call load_relocatable_ramstage() on x86, and cbfs_prog_stage_load() on other architectures. But with the current code the latter is also called on x86 if the former succeeded. Fix that and also balance the if structure to make it more obvious. TEST=qemu-system-x86_64 boots to payload again. Change-Id: I5b1db5aac772b9b3a388a1a8ae490fa627334320 Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/c/coreboot/+/43142 Reviewed-by: Arthur Heymans Reviewed-by: Kyösti Mälkki Reviewed-by: Mario Scheithauer Reviewed-by: Werner Zeh Tested-by: build bot (Jenkins) --- src/lib/prog_loaders.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/lib/prog_loaders.c b/src/lib/prog_loaders.c index 419f4cd834..93efc0a280 100644 --- a/src/lib/prog_loaders.c +++ b/src/lib/prog_loaders.c @@ -129,10 +129,13 @@ void run_ramstage(void) timestamp_add_now(TS_START_COPYRAM); - if (ENV_X86 && load_relocatable_ramstage(&ramstage)) - goto fail; - else if (cbfs_prog_stage_load(&ramstage)) - goto fail; + if (ENV_X86) { + if (load_relocatable_ramstage(&ramstage)) + goto fail; + } else { + if (cbfs_prog_stage_load(&ramstage)) + goto fail; + } stage_cache_add(STAGE_RAMSTAGE, &ramstage); -- cgit v1.2.3