File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -1314,6 +1314,10 @@ static int fw_update(int argc, char **argv)
13141314 int ret ;
13151315 int type ;
13161316 const char * desc = "Flash the firmware with a new image" ;
1317+ int bl2 = 0 ;
1318+ int key = 0 ;
1319+ int cfg_part = 0 ;
1320+ int fw = 0 ;
13171321
13181322 enum switchtec_boot_phase phase_id ;
13191323 enum mrpc_cmd rpc_cmd = MRPC_FWDNLD ;
@@ -1405,6 +1409,27 @@ static int fw_update(int argc, char **argv)
14051409 progress_finish ();
14061410 printf ("\n" );
14071411
1412+ if ((phase_id == SWITCHTEC_BOOT_PHASE_BL2 ) && !cfg .dont_activate ) {
1413+ if (type == SWITCHTEC_FW_TYPE_BL2 )
1414+ bl2 = 1 ;
1415+ else if (type == SWITCHTEC_FW_TYPE_CFG )
1416+ cfg_part = 1 ;
1417+ else if (type == SWITCHTEC_FW_TYPE_IMG )
1418+ fw = 1 ;
1419+ else if (type == SWITCHTEC_FW_TYPE_KEY )
1420+ key = 1 ;
1421+
1422+ ret = switchtec_fw_toggle_active_partition (cfg .dev ,
1423+ bl2 ,
1424+ key ,
1425+ fw ,
1426+ cfg_part );
1427+ if (ret ) {
1428+ switchtec_perror ("firmware update" );
1429+ return ret ;
1430+ }
1431+ }
1432+
14081433 print_fw_part_info (cfg .dev );
14091434 printf ("\n" );
14101435
You can’t perform that action at this time.
0 commit comments