From e98b4563c95dafb93bc69ef92b074088d94add04 Mon Sep 17 00:00:00 2001 From: BenReed161 Date: Mon, 31 Aug 2026 14:43:22 -0700 Subject: [PATCH] Add Gen6 support for device id get in BL2 Device id get default fall back was the Gen5 version of the Part info command. Added an additional fallback if that one fails to use the Gen6 version of the command. --- lib/fw.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/fw.c b/lib/fw.c index dd760c7c..e8301a91 100644 --- a/lib/fw.c +++ b/lib/fw.c @@ -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; @@ -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; }