dsmi_upgrade_start
Prototype
int dsmi_upgrade_start(int device_id,DSMI_COMPONENT_TYPE component_type,const char *file_name)
Description
Starts the the Ascend AI Processor upgrade with specified Firmware type and file name.
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. The struct is defined as follows. 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; |
file_name |
Input |
Firmware file name (including the path) |
Returns
Type |
Description |
---|---|
int |
0 on success; else, failure |
Restrictions
- Upgrade is not supported in non-host environments.
- If DSMI_COMPONENT_TYPE_AICPU is passed to component_type, run the caller application as the root user on a physical or virtual machine. Otherwise, a permission error is returned. To pass other arguments, run the caller application as the root user on a physical machine. Otherwise, a permission error is returned.
- Since the flash memory has a limited number of program/erase cycles, avoid unnecessary calls to this API.
- For the same device_id, concurrent execution is not supported.
Example
int ret = 0; ret = dsmi_upgrade_start(0, DSMI_COMPONENT_TYPE_XLOADER , "./xloader.bin"); if(ret != 0) { //To-do: records logs. return ret; } ...