Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lib/fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2211,6 +2211,7 @@ int switchtec_get_device_id_bl2(struct switchtec_dev *dev,
uint8_t subcmd = MRPC_PART_INFO_GET_ALL_INFO;
struct switchtec_flash_info_gen4 all_info;
struct switchtec_flash_info_gen5 all_info_gen5;
struct switchtec_flash_info_gen6 all_info_gen6;

if (dev->gen != SWITCHTEC_GEN_UNKNOWN)
return -EINVAL;
Expand All @@ -2229,6 +2230,15 @@ int switchtec_get_device_id_bl2(struct switchtec_dev *dev,
*device_id = le16toh(all_info_gen5.device_id);
}

if (ret == ERR_SUBCMD_INVALID) {
subcmd = MRPC_PART_INFO_GET_ALL_INFO_GEN6;
ret = switchtec_cmd(dev, MRPC_PART_INFO, &subcmd,
sizeof(subcmd), &all_info_gen6,
sizeof(all_info_gen6));
if (!ret)
*device_id = le16toh(all_info_gen6.device_id);
}

return ret;
}

Expand Down