mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-05-05 04:36:13 +02:00
fwu: Mark failed bank as invalid during rollback
When boot_idx differs from active_idx at boot time, it indicates a rollback scenario where the firmware update failed and the system reverted to the previous working bank. In this case, mark the failed bank (active_idx) as invalid to prevent future boot attempts from that bank. Signed-off-by: Kory Maincent <kory.maincent@bootlin.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
This commit is contained in:
parent
e8d9ad18f0
commit
9367b8d933
@ -766,6 +766,12 @@ static int fwu_boottime_checks(void)
|
||||
if (boot_idx != active_idx) {
|
||||
log_info("Boot idx %u is not matching active idx %u, changing active_idx\n",
|
||||
boot_idx, active_idx);
|
||||
|
||||
ret = fwu_state_machine_updates(FWU_BANK_INVALID, active_idx);
|
||||
if (ret)
|
||||
log_err("Unable to set bank %u state as invalid",
|
||||
active_idx);
|
||||
|
||||
ret = fwu_set_active_index(boot_idx);
|
||||
if (!ret)
|
||||
boottime_check = 1;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user