From 2b1f8d41292013fb9d977a8cd1a39ab0b337cf98 Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Sat, 1 Jan 2022 17:20:00 +0100 Subject: [PATCH] drivers/intel/fsp2_0: Print return value when dying When coreboot goes to die because FSP returned an error, log the return value in the message printed by `die()` or `die_with_post_code()`. Change-Id: I6b9ea60534a20429f15132007c1f5770760481af Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/60637 Tested-by: build bot (Jenkins) Reviewed-by: Felix Singer Reviewed-by: Tim Wawrzynczak Reviewed-by: Subrata Banik --- src/drivers/intel/fsp2_0/memory_init.c | 3 +-- src/drivers/intel/fsp2_0/notify.c | 6 ++---- src/drivers/intel/fsp2_0/temp_ram_exit.c | 6 ++---- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/drivers/intel/fsp2_0/memory_init.c b/src/drivers/intel/fsp2_0/memory_init.c index c1a7377ed5..3c1a088bf0 100644 --- a/src/drivers/intel/fsp2_0/memory_init.c +++ b/src/drivers/intel/fsp2_0/memory_init.c @@ -309,9 +309,8 @@ static void do_fsp_memory_init(const struct fspm_context *context, bool s3wake) /* Handle any errors returned by FspMemoryInit */ fsp_handle_reset(status); if (status != FSP_SUCCESS) { - printk(BIOS_CRIT, "FspMemoryInit returned 0x%08x\n", status); die_with_post_code(POST_RAM_FAILURE, - "FspMemoryInit returned an error!\n"); + "FspMemoryInit returned with error 0x%08x!\n", status); } do_fsp_post_memory_init(s3wake, fsp_version); diff --git a/src/drivers/intel/fsp2_0/notify.c b/src/drivers/intel/fsp2_0/notify.c index 311ce46f19..9a0f23a778 100644 --- a/src/drivers/intel/fsp2_0/notify.c +++ b/src/drivers/intel/fsp2_0/notify.c @@ -50,10 +50,8 @@ static void fsp_notify(enum fsp_notify_phase phase) /* Handle any errors returned by FspNotify */ fsp_handle_reset(ret); - if (ret != FSP_SUCCESS) { - printk(BIOS_SPEW, "FspNotify returned 0x%08x\n", ret); - die("FspNotify returned an error!\n"); - } + if (ret != FSP_SUCCESS) + die("FspNotify returned with error 0x%08x!\n", ret); /* Allow the platform to run something after FspNotify */ platform_fsp_notify_status(phase); diff --git a/src/drivers/intel/fsp2_0/temp_ram_exit.c b/src/drivers/intel/fsp2_0/temp_ram_exit.c index 5d7cbd4ebb..2192543575 100644 --- a/src/drivers/intel/fsp2_0/temp_ram_exit.c +++ b/src/drivers/intel/fsp2_0/temp_ram_exit.c @@ -29,10 +29,8 @@ static void fsp_temp_ram_exit(void) printk(BIOS_DEBUG, "Calling TempRamExit: %p\n", temp_ram_exit); status = temp_ram_exit(NULL); - if (status != FSP_SUCCESS) { - printk(BIOS_CRIT, "TempRamExit returned 0x%08x\n", status); - die("TempRamExit returned an error!\n"); - } + if (status != FSP_SUCCESS) + die("TempRamExit returned with error 0x%08x!\n", status); cbfs_unmap(mapping); }