2
0

[SWDEV-554587] Added IFWI Version and boot_firmware API

- Changed amd-smi static --vbios to accept ifwi
- Change population logic for vbios version API
- Added IFWI boot_firmware to the CLI, C++, Rust, and Python API

Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: I4ea504d40a43cfb011ab38fc9a664ecf12d39c8a
Este cometimento está contido em:
Maisam Arif
2025-09-16 19:51:13 -05:00
cometido por Arif, Maisam
ascendente c708a7e11f
cometimento cd21b5edcc
20 ficheiros modificados com 185 adições e 72 eliminações
+20 -6
Ver ficheiro
@@ -3931,28 +3931,42 @@ amdsmi_get_gpu_vbios_info(amdsmi_processor_handle processor_handle, amdsmi_vbios
info->build_date[AMDSMI_MAX_STRING_LENGTH - 1] = '\0';
strncpy(info->part_number, reinterpret_cast<char *>(vbios.vbios_pn),
AMDSMI_MAX_STRING_LENGTH);
// Navi devices still interpret vbios version from drm vbios_ver_str
strncpy(info->version, reinterpret_cast<char *>(vbios.vbios_ver_str),
AMDSMI_MAX_STRING_LENGTH);
} else {
// get vbios version string from rocm_smi
// get sysfs vbios_version string which is known as the part number
char vbios_version[AMDSMI_MAX_STRING_LENGTH];
status = rsmi_wrapper(rsmi_dev_vbios_version_get, processor_handle, 0,
vbios_version,
AMDSMI_MAX_STRING_LENGTH);
vbios_version, AMDSMI_MAX_STRING_LENGTH);
// ignore the errors so that it can populate as many fields as possible.
// fail if cannot get vbios version from sysfs
if (status == AMDSMI_STATUS_SUCCESS) {
strncpy(info->version,
vbios_version, AMDSMI_MAX_STRING_LENGTH);
strncpy(info->part_number, vbios_version, AMDSMI_MAX_STRING_LENGTH);
}
}
libdrm.unload();
// get vbios build string from rocm_smi which translates to ifwi version
char vbios_build_number[AMDSMI_MAX_STRING_LENGTH];
amdsmi_status_t build_status;
build_status = rsmi_wrapper(rsmi_dev_vbios_build_number_get, processor_handle, 0,
vbios_build_number, AMDSMI_MAX_STRING_LENGTH);
// Continue if sysfs doesn't exist
if (build_status == AMDSMI_STATUS_SUCCESS) {
// This device has an ifwi version so swap the version and boot_firmware
strncpy(info->boot_firmware, info->version, AMDSMI_MAX_STRING_LENGTH);
strncpy(info->version, vbios_build_number, AMDSMI_MAX_STRING_LENGTH);
}
ss << __PRETTY_FUNCTION__
<< " | drmCommandWrite returned: " << strerror(errno) << "\n"
<< " | vbios name: " << info->name << "\n"
<< " | vbios build date: " << info->build_date << "\n"
<< " | vbios part number: " << info->part_number << "\n"
<< " | vbios version: " << info->version << "\n"
<< " | vbios boot_firmware: " << info->boot_firmware<< "\n"
<< " | Returning: " << smi_amdgpu_get_status_string(status, false);
LOG_INFO(ss);
return status;