vli: Use a plugin prefix for quirk keys

This commit is contained in:
Richard Hughes 2021-03-02 10:25:10 +00:00
parent 707331e90b
commit 2bae97c6c2
4 changed files with 59 additions and 59 deletions

View File

@ -59,27 +59,27 @@ This plugin uses the following plugin-specific quirks:
| Quirk | Description | Minimum fwupd version |
|----------------------------|----------------------------------|-----------------------|
| `DeviceKind` | Device kind, e.g. `VL102` | 1.3.7 |
| `SpiAutoDetect` | SPI autodetect (default 0x1) | 1.3.7 |
| `SpiCmdChipErase` | Flash command to erase chip | 1.3.3 |
| `SpiCmdChipErase` | Flash command to erase sector | 1.3.3 |
| `SpiCmdReadId` | Flash command to read the ID | 1.3.3 |
| `SpiCmdReadIdSz` | Size of the ReadId response | 1.3.3 |
| `VliDeviceKind` | Device kind, e.g. `VL102` | 1.3.7 |
| `VliSpiAutoDetect` | SPI autodetect (default 0x1) | 1.3.7 |
| `VliSpiCmdChipErase` | Flash command to erase chip | 1.3.3 |
| `VliSpiCmdChipErase` | Flash command to erase sector | 1.3.3 |
| `VliSpiCmdReadId` | Flash command to read the ID | 1.3.3 |
| `VliSpiCmdReadIdSz` | Size of the ReadId response | 1.3.3 |
The `SpiCmdReadId` and `SpiCmdReadIdSz` quirks have to be assigned to the device
The `VliSpiCmdReadId` and `VliSpiCmdReadIdSz` quirks have to be assigned to the device
instance attribute, rather then the flash part as the ID is required to query
the other flash chip parameters. For example:
[DeviceInstanceId=USB\VID_2109&PID_0210]
Plugin = vli
GType = FuVliUsbhubDevice
SpiCmdReadId = 0xf8
SpiCmdReadIdSz = 4
VliSpiCmdReadId = 0xf8
VliSpiCmdReadIdSz = 4
# W3IRDFLASHxxx
[Guid=VLI_USBHUB\\SPI_37303840]
SpiCmdChipErase = 0xc7
SpiCmdSectorErase = 0x20
VliSpiCmdChipErase = 0xc7
VliSpiCmdSectorErase = 0x20
External interface access
-------------------------

View File

@ -605,34 +605,34 @@ fu_vli_device_set_quirk_kv (FuDevice *device,
{
FuVliDevice *self = FU_VLI_DEVICE (device);
FuVliDevicePrivate *priv = GET_PRIVATE (self);
if (g_strcmp0 (key, "SpiCmdReadId") == 0) {
if (g_strcmp0 (key, "VliSpiCmdReadId") == 0) {
priv->spi_cmds[FU_VLI_DEVICE_SPI_REQ_READ_ID] = fu_common_strtoull (value);
return TRUE;
}
if (g_strcmp0 (key, "SpiCmdReadIdSz") == 0) {
if (g_strcmp0 (key, "VliSpiCmdReadIdSz") == 0) {
priv->spi_cmd_read_id_sz = fu_common_strtoull (value);
return TRUE;
}
if (g_strcmp0 (key, "SpiCmdChipErase") == 0) {
if (g_strcmp0 (key, "VliSpiCmdChipErase") == 0) {
priv->spi_cmds[FU_VLI_DEVICE_SPI_REQ_CHIP_ERASE] = fu_common_strtoull (value);
return TRUE;
}
if (g_strcmp0 (key, "SpiCmdSectorErase") == 0) {
if (g_strcmp0 (key, "VliSpiCmdSectorErase") == 0) {
priv->spi_cmds[FU_VLI_DEVICE_SPI_REQ_SECTOR_ERASE] = fu_common_strtoull (value);
return TRUE;
}
if (g_strcmp0 (key, "SpiAutoDetect") == 0) {
if (g_strcmp0 (key, "VliSpiAutoDetect") == 0) {
priv->spi_auto_detect = fu_common_strtoull (value) > 0;
return TRUE;
}
if (g_strcmp0 (key, "DeviceKind") == 0) {
if (g_strcmp0 (key, "VliDeviceKind") == 0) {
FuVliDeviceKind device_kind;
device_kind = fu_vli_common_device_kind_from_string (value);
if (device_kind == FU_VLI_DEVICE_KIND_UNKNOWN) {
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
"DeviceKind %s is not supported",
"VliDeviceKind %s is not supported",
value);
return FALSE;
}

View File

@ -2,40 +2,40 @@
[DeviceInstanceId=USB\VID_0800&PID_0800]
Plugin = vli
GType = FuVliPdDevice
DeviceKind = VL100
VliDeviceKind = VL100
[DeviceInstanceId=USB\VID_2109&PID_0100]
Plugin = vli
GType = FuVliPdDevice
DeviceKind = VL100
VliDeviceKind = VL100
[DeviceInstanceId=USB\VID_2109&PID_0101]
Plugin = vli
GType = FuVliPdDevice
DeviceKind = VL101
VliDeviceKind = VL101
[DeviceInstanceId=USB\VID_2109&PID_0102]
Plugin = vli
GType = FuVliPdDevice
DeviceKind = VL102
VliDeviceKind = VL102
[DeviceInstanceId=USB\VID_2109&PID_0103]
Plugin = vli
GType = FuVliPdDevice
Flags = dual-image
DeviceKind = VL103
VliDeviceKind = VL103
[DeviceInstanceId=USB\VID_2109&PID_0104]
Plugin = vli
GType = FuVliPdDevice
DeviceKind = VL104
VliDeviceKind = VL104
[DeviceInstanceId=USB\VID_2109&PID_0105]
Plugin = vli
GType = FuVliPdDevice
DeviceKind = VL105
VliDeviceKind = VL105
[DeviceInstanceId=USB\VID_2109&PID_0106]
Plugin = vli
GType = FuVliPdDevice
DeviceKind = VL106
VliDeviceKind = VL106
[DeviceInstanceId=USB\VID_2109&PID_0107]
Plugin = vli
GType = FuVliPdDevice
DeviceKind = VL107
VliDeviceKind = VL107
[DeviceInstanceId=USB\VID_2109&PID_D101]
Plugin = vli

View File

@ -60,74 +60,74 @@ Flags = usb2,has-shared-spi-pd
# A25Lxxx
[Guid=VLI_USBHUB\\SPI_3730]
SpiCmdChipErase = 0xc7
SpiCmdSectorErase = 0x20
VliSpiCmdChipErase = 0xc7
VliSpiCmdSectorErase = 0x20
# AT25F512A/B
[Guid=VLI_USBHUB\\SPI_1F65]
# SpiCmdReadId = 0x15
SpiCmdChipErase = 0x62
SpiCmdSectorErase = 0x00
# VliSpiCmdReadId = 0x15
VliSpiCmdChipErase = 0x62
VliSpiCmdSectorErase = 0x00
# EN25Fxx
[Guid=VLI_USBHUB\\SPI_1C31]
SpiCmdChipErase = 0x60
SpiCmdSectorErase = 0x20
VliSpiCmdChipErase = 0x60
VliSpiCmdSectorErase = 0x20
# GD25Qxxx
[Guid=VLI_USBHUB\SPI_C840]
SpiCmdChipErase = 0xC7
SpiCmdSectorErase = 0x20
VliSpiCmdChipErase = 0xC7
VliSpiCmdSectorErase = 0x20
# M25PxxA/xx
[Guid=VLI_USBHUB\\SPI_0020]
SpiCmdChipErase = 0xC7
SpiCmdSectorErase = 0x00
VliSpiCmdChipErase = 0xC7
VliSpiCmdSectorErase = 0x00
# MX25Lxxx/xxxC/xxxE
[Guid=VLI_USBHUB\\SPI_C220]
SpiCmdChipErase = 0x60
SpiCmdSectorErase = 0x20
VliSpiCmdChipErase = 0x60
VliSpiCmdSectorErase = 0x20
# MX25Lxxx1E
[Guid=VLI_USBHUB\\SPI_C222]
SpiCmdChipErase = 0x60
SpiCmdSectorErase = 0x20
VliSpiCmdChipErase = 0x60
VliSpiCmdSectorErase = 0x20
# PCT/SST25VFxxx/xxxA
[Guid=VLI_USBHUB\\SPI_00BF]
# SpiCmdReadId = 0x90
SpiCmdChipErase = 0x60
SpiCmdSectorErase = 0x20
# VliSpiCmdReadId = 0x90
VliSpiCmdChipErase = 0x60
VliSpiCmdSectorErase = 0x20
# PM25LDxxx
[Guid=VLI_USBHUB\\SPI_009D]
# SpiCmdReadId = 0x90
SpiCmdChipErase = 0xC7
SpiCmdSectorErase = 0xD7
# VliSpiCmdReadId = 0x90
VliSpiCmdChipErase = 0xC7
VliSpiCmdSectorErase = 0xD7
# PM25LVxxx
[Guid=VLI_USBHUB\\SPI_009D]
# SpiCmdReadId = 0xAB
SpiCmdChipErase = 0xC7
SpiCmdSectorErase = 0xD7
# VliSpiCmdReadId = 0xAB
VliSpiCmdChipErase = 0xC7
VliSpiCmdSectorErase = 0xD7
# W25XxxBV/W25XxxCL
[Guid=VLI_USBHUB\\SPI_00EF]
SpiCmdChipErase = 0xC7
SpiCmdSectorErase = 0x20
VliSpiCmdChipErase = 0xC7
VliSpiCmdSectorErase = 0x20
# FM25Fxxx
#[Guid=VLI_USBHUB\\SPI_XXXX]
#SpiCmdChipErase = 0xC7
#SpiCmdSectorErase = 0x20
#VliSpiCmdChipErase = 0xC7
#VliSpiCmdSectorErase = 0x20
# KH25LxxxxE
#[Guid=VLI_USBHUB\\SPI_XXXX]
#SpiCmdChipErase = 0x60
#SpiCmdSectorErase = 0x20
#VliSpiCmdChipErase = 0x60
#VliSpiCmdSectorErase = 0x20
# MX25Vxxx
#[Guid=VLI_USBHUB\\SPI_XXXX]
#SpiCmdChipErase = 0x60
#SpiCmdSectorErase = 0x20
#VliSpiCmdChipErase = 0x60
#VliSpiCmdSectorErase = 0x20