dsmi_upgrade_get_component_static_version
Prototype
int dsmi_upgrade_get_component_static_version(int device_id, DSMI_COMPONENT_TYPE component_type, unsigned char* version_str, unsigned int version_len, unsigned int *ret_len)
Description
Obtains the flash Firmware version.
For the Ascend 310 AI Processor, this API supports mini modules (EP) and standard PCIe cards.
Parameters
Parameter |
Input/Output |
Description |
---|---|---|
device_id |
Input |
Device ID For the Ascend 310 AI Processor, the value range is 0–63. Obtain the actual device ID by calling dsmi_list_device. |
component_type |
Input |
Firmware type For Ascend 310 AI Processors, DSMI_COMPONENT_TYPE_NVE, DSMI_COMPONENT_TYPE_XLOADER, DSMI_COMPONENT_TYPE_M3FW, DSMI_COMPONENT_TYPE_UEFI, DSMI_COMPONENT_TYPE_TEE, and DSMI_COMPONENT_TYPE_AICPU are supported. typedef enum dsmi_component_type { DSMI_COMPONENT_TYPE_NVE, DSMI_COMPONENT_TYPE_XLOADER, DSMI_COMPONENT_TYPE_M3FW, DSMI_COMPONENT_TYPE_UEFI, DSMI_COMPONENT_TYPE_TEE, DSMI_COMPONENT_TYPE_KERNEL, DSMI_COMPONENT_TYPE_DTB, DSMI_COMPONENT_TYPE_ROOTFS, DSMI_COMPONENT_TYPE_IMU, DSMI_COMPONENT_TYPE_IMP, DSMI_COMPONENT_TYPE_AICPU, DSMI_COMPONENT_TYPE_NONE, UPGRADE_AND_RESET_ALL_COMPONENT = 0xFFFFFFF7, UPGRADE_ALL_COMPONENT = 0xFFFFFFFF } DSMI_COMPONENT_TYPE; |
version_str |
Output |
Space allocated by the user for storing the Firmware version number |
version_len |
Input |
Length of version_str, in bytes |
ret_len |
Output |
Length of the version number |
Returns
Type |
Description |
---|---|
int |
0 on success; else, failure |
Restrictions
Run the caller application as the root user. Otherwise, a permission error is returned.
Example
int ret = 0; unsigned int len = 0; unsigned char version_str[64] = {0}; ret = dsmi_upgrade_get_component_static_version(0, DSMI_COMPONENT_TYPE_XLOADER,version_str, 64, &len); if(ret != 0) { //To-do: records logs. return ret; } ...