From 605f793af84733eda416533ccf5b220c0f5a171b Mon Sep 17 00:00:00 2001 From: Jakub Czapiga Date: Fri, 4 Nov 2022 12:18:04 +0000 Subject: vboot: Introduce handy vboot reboot functions This patch groups vboot context, recovery reason and subcode saving, and reboot calls into two handy functions: - vboot_save_and_reboot() - save context and reboot - vboot_fail_and_reboot() - store recovery reason and call function above Signed-off-by: Jakub Czapiga Change-Id: Ie29410e8985e7cf19bd8d4cccc393b050ca1f1c5 Reviewed-on: https://review.coreboot.org/c/coreboot/+/69208 Reviewed-by: Angel Pons Tested-by: build bot (Jenkins) Reviewed-by: Eric Lai Reviewed-by: Yu-Ping Wu --- src/soc/intel/common/block/cse/cse.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/soc/intel') diff --git a/src/soc/intel/common/block/cse/cse.c b/src/soc/intel/common/block/cse/cse.c index c2c94ec3cb..ceb75e2984 100644 --- a/src/soc/intel/common/block/cse/cse.c +++ b/src/soc/intel/common/block/cse/cse.c @@ -931,15 +931,10 @@ void cse_trigger_vboot_recovery(enum csme_failure_reason reason) "HFSTS3: 0x%x\n", me_read_config32(PCI_ME_HFSTS1), me_read_config32(PCI_ME_HFSTS2), me_read_config32(PCI_ME_HFSTS3)); - if (CONFIG(VBOOT)) { - struct vb2_context *ctx = vboot_get_context(); - if (ctx == NULL) - goto failure; - vb2api_fail(ctx, VB2_RECOVERY_INTEL_CSE_LITE_SKU, reason); - vboot_save_data(ctx); - vboot_reboot(); - } -failure: + if (CONFIG(VBOOT)) + vboot_fail_and_reboot(vboot_get_context(), VB2_RECOVERY_INTEL_CSE_LITE_SKU, + reason); + die("cse: Failed to trigger recovery mode(recovery subcode:%d)\n", reason); } -- cgit v1.2.3