From 1f5c7b64141e2680c6babc55e09fdbcf7fcd6703 Mon Sep 17 00:00:00 2001 From: Jason Zhu Date: Mon, 4 Jan 2021 15:40:54 +0800 Subject: [PATCH] spl: fit: support decreasing 1 if verify fail when enable a/b Signed-off-by: Jason Zhu Change-Id: I922b929ac37181f61e820b6c2b2de750e816a99d --- common/spl/spl_fit.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index bfcf34e797..f76fc93cc4 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c @@ -9,9 +9,10 @@ #include #include #include -#include #include #include +#include +#include #include #ifndef CONFIG_SYS_BOOTM_LEN @@ -790,10 +791,19 @@ int spl_load_simple_fit(struct spl_image_info *spl_image, #ifdef CONFIG_SPL_KERNEL_BOOT ret = spl_load_kernel_fit(spl_image, info); #endif - return ret; + break; } } - +#ifdef CONFIG_SPL_AB + /* + * If boot fail in spl, spl must decrease 1. If boot + * successfully, it is no need to do that and U-boot will + * always to decrease 1. If in thunderboot process, + * always need to decrease 1. + */ + if (IS_ENABLED(CONFIG_SPL_KERNEL_BOOT) || ret) + spl_ab_decrease_tries(info->dev); +#endif return ret; }