Skip to content

Commit

Permalink
Merge branch 'recovery-RC3' into secure_boot
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvin-cao committed Oct 16, 2019
2 parents fe90fe1 + 162e2eb commit 43f9776
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions cli/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1314,6 +1314,10 @@ static int fw_update(int argc, char **argv)
int ret;
int type;
const char *desc = "Flash the firmware with a new image";
int bl2 = 0;
int key = 0;
int cfg_part = 0;
int fw = 0;

enum switchtec_boot_phase phase_id;
enum mrpc_cmd rpc_cmd = MRPC_FWDNLD;
Expand Down Expand Up @@ -1405,6 +1409,27 @@ static int fw_update(int argc, char **argv)
progress_finish();
printf("\n");

if ((phase_id == SWITCHTEC_BOOT_PHASE_BL2) && !cfg.dont_activate) {
if (type == SWITCHTEC_FW_TYPE_BL2)
bl2 = 1;
else if (type == SWITCHTEC_FW_TYPE_CFG)
cfg_part = 1;
else if (type == SWITCHTEC_FW_TYPE_IMG)
fw = 1;
else if (type == SWITCHTEC_FW_TYPE_KEY)
key = 1;

ret = switchtec_fw_toggle_active_partition(cfg.dev,
bl2,
key,
fw,
cfg_part);
if (ret) {
switchtec_perror("firmware update");
return ret;
}
}

print_fw_part_info(cfg.dev);
printf("\n");

Expand Down

0 comments on commit 43f9776

Please sign in to comment.