spl: ab: print a/b info in spl

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I2f1b05a6e12e53988a84b8ac876e80cd722fcaff
This commit is contained in:
Jason Zhu 2020-12-28 17:20:29 +08:00 committed by Jianhong Chen
parent fb4fd3b6ad
commit c6d7f8e4f0
1 changed files with 9 additions and 0 deletions

View File

@ -202,6 +202,7 @@ static int spl_get_lastboot(AvbABData *ab_data)
int spl_get_current_slot(struct blk_desc *dev_desc, char *partition, char *slot)
{
static int last_slot_index = -1;
size_t slot_index_to_boot;
AvbABData ab_data;
int ret;
@ -238,6 +239,14 @@ int spl_get_current_slot(struct blk_desc *dev_desc, char *partition, char *slot)
else if (slot_index_to_boot == 1)
memcpy(slot, "_b", 2);
if (last_slot_index != slot_index_to_boot) {
last_slot_index = slot_index_to_boot;
printf("SPL: A/B-slot: %s, successful: %d, tries-remain: %d\n",
slot,
ab_data.slots[slot_index_to_boot].successful_boot,
ab_data.slots[slot_index_to_boot].tries_remaining);
}
out:
return 0;
}