@@ -1799,6 +1799,8 @@ static int print_fw_part_info(struct switchtec_dev *dev)
1799
1799
print_fw_part_line ("BOOT" , sum -> boot .active );
1800
1800
print_fw_part_line ("MAP" , sum -> map .active );
1801
1801
print_fw_part_line ("KEY" , sum -> key .active );
1802
+ if (switchtec_is_gen5 (dev ))
1803
+ print_fw_part_line ("RIOT" , sum -> riot .active );
1802
1804
print_fw_part_line ("BL2" , sum -> bl2 .active );
1803
1805
print_fw_part_line ("IMG" , sum -> img .active );
1804
1806
print_fw_part_line ("CFG" , sum -> cfg .active );
@@ -1809,6 +1811,8 @@ static int print_fw_part_info(struct switchtec_dev *dev)
1809
1811
printf ("Inactive Partitions:\n" );
1810
1812
print_fw_part_line ("MAP" , sum -> map .inactive );
1811
1813
print_fw_part_line ("KEY" , sum -> key .inactive );
1814
+ if (switchtec_is_gen5 (dev ))
1815
+ print_fw_part_line ("RIOT" , sum -> riot .inactive );
1812
1816
print_fw_part_line ("BL2" , sum -> bl2 .inactive );
1813
1817
print_fw_part_line ("IMG" , sum -> img .inactive );
1814
1818
print_fw_part_line ("CFG" , sum -> cfg .inactive );
@@ -2019,6 +2023,7 @@ static int fw_toggle(int argc, char **argv)
2019
2023
int key ;
2020
2024
int firmware ;
2021
2025
int config ;
2026
+ int riotcore ;
2022
2027
} cfg = {};
2023
2028
const struct argconfig_options opts [] = {
2024
2029
DEVICE_OPTION ,
@@ -2030,23 +2035,29 @@ static int fw_toggle(int argc, char **argv)
2030
2035
"toggle IMG firmware" },
2031
2036
{"config" , 'c' , "" , CFG_NONE , & cfg .config , no_argument ,
2032
2037
"toggle CFG data" },
2038
+ {"riotcore" , 'r' , "" , CFG_NONE , & cfg .riotcore , no_argument ,
2039
+ "toggle RIOTCORE - Gen5 switch only" },
2033
2040
{NULL }};
2034
2041
2035
2042
argconfig_parse (argc , argv , CMD_DESC_FW_TOGGLE , opts , & cfg , sizeof (cfg ));
2036
2043
2037
- if (!cfg .bl2 && !cfg .key && !cfg .firmware && !cfg .config ) {
2044
+ if (!cfg .bl2 && !cfg .key && !cfg .firmware && !cfg .config && ! cfg . riotcore ) {
2038
2045
fprintf (stderr , "NOTE: Not toggling images as no "
2039
2046
"partition type options were specified\n\n" );
2040
- } else if ((cfg .bl2 || cfg .key ) && switchtec_is_gen3 (cfg .dev )) {
2041
- fprintf (stderr , "Firmware type BL2 and Key manifest"
2047
+ } else if ((cfg .bl2 || cfg .key || cfg . riotcore ) && switchtec_is_gen3 (cfg .dev )) {
2048
+ fprintf (stderr , "Firmware type BL2, Key manifest, or RIORCORE "
2042
2049
"are not supported by Gen3 switches\n" );
2043
2050
return 1 ;
2051
+ } else if (cfg .riotcore && switchtec_is_gen4 (cfg .dev )){
2052
+ fprintf (stderr , "Firmware type RIOTCORE is not supported by Gen4 switchtes\n" );
2053
+ return 1 ;
2044
2054
} else {
2045
2055
ret = switchtec_fw_toggle_active_partition (cfg .dev ,
2046
2056
cfg .bl2 ,
2047
2057
cfg .key ,
2048
2058
cfg .firmware ,
2049
- cfg .config );
2059
+ cfg .config ,
2060
+ cfg .riotcore );
2050
2061
if (ret )
2051
2062
err = errno ;
2052
2063
}
0 commit comments