Add block erase command to FuCfiDevice

This commit is contained in:
Gaël PORTAY 2021-12-15 14:51:22 +01:00 committed by Richard Hughes
parent 428f3d5b99
commit 53ed50e1c9
2 changed files with 9 additions and 0 deletions

View File

@ -51,6 +51,8 @@ fu_cfi_device_cmd_to_string(FuCfiDeviceCmd cmd)
return "CfiDeviceCmdWriteEn";
if (cmd == FU_CFI_DEVICE_CMD_WRITE_STATUS)
return "CfiDeviceCmdWriteStatus";
if (cmd == FU_CFI_DEVICE_CMD_BLOCK_ERASE)
return "CfiDeviceCmdBlockErase";
return NULL;
}
@ -383,6 +385,12 @@ fu_cfi_device_set_quirk_kv(FuDevice *device, const gchar *key, const gchar *valu
priv->cmds[FU_CFI_DEVICE_CMD_CHIP_ERASE] = tmp;
return TRUE;
}
if (g_strcmp0(key, "CfiDeviceCmdBlockErase") == 0) {
if (!fu_common_strtoull_full(value, &tmp, 0, G_MAXUINT8, error))
return FALSE;
priv->cmds[FU_CFI_DEVICE_CMD_BLOCK_ERASE] = tmp;
return TRUE;
}
if (g_strcmp0(key, "CfiDeviceCmdSectorErase") == 0) {
if (!fu_common_strtoull_full(value, &tmp, 0, G_MAXUINT8, error))
return FALSE;

View File

@ -41,6 +41,7 @@ typedef enum {
FU_CFI_DEVICE_CMD_SECTOR_ERASE,
FU_CFI_DEVICE_CMD_WRITE_EN,
FU_CFI_DEVICE_CMD_WRITE_STATUS,
FU_CFI_DEVICE_CMD_BLOCK_ERASE,
/*< private >*/
FU_CFI_DEVICE_CMD_LAST
} FuCfiDeviceCmd;