mirror of
https://git.proxmox.com/git/fwupd
synced 2025-05-04 14:16:25 +00:00
vli: Add VL822 device+share-spi-pd
Co-authored-by: Emily Miller <m_emily@berkeley.com>
This commit is contained in:
parent
391647f55e
commit
c255034574
16
data/device-tests/devices/bizlink-no-sku-vli-tier1.json
Normal file
16
data/device-tests/devices/bizlink-no-sku-vli-tier1.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "BizLink Cayenne Hub [VL822+VL103]",
|
||||
"guids": [
|
||||
"a0eff862-6b0b-5571-91ec-a0c4bb25b539"
|
||||
],
|
||||
"releases": [
|
||||
{
|
||||
"version": "A6.83",
|
||||
"file": "4b71550a59348053430bb4da8939eb24739617f5f03ff0551c4f3331056cfabf-BizLink-Cayenne_New.cab"
|
||||
},
|
||||
{
|
||||
"version": "06.83",
|
||||
"file": "071cb1ecd11fed54438541d447d2289cf87ee1cb8c8e342b8e7bc28fcd8d70be-BizLink-Cayenne_Old.cab"
|
||||
}
|
||||
]
|
||||
}
|
16
data/device-tests/devices/bizlink-no-sku-vli-tier3.json
Normal file
16
data/device-tests/devices/bizlink-no-sku-vli-tier3.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "BizLink Cayenne Hub [VL822+VL103]",
|
||||
"guids": [
|
||||
"f04ecda7-f2ff-5574-8736-d83c520639f1"
|
||||
],
|
||||
"releases": [
|
||||
{
|
||||
"version": "138.2.5.18",
|
||||
"file": "4b71550a59348053430bb4da8939eb24739617f5f03ff0551c4f3331056cfabf-BizLink-Cayenne_New.cab"
|
||||
},
|
||||
{
|
||||
"version": "122.2.5.18",
|
||||
"file": "071cb1ecd11fed54438541d447d2289cf87ee1cb8c8e342b8e7bc28fcd8d70be-BizLink-Cayenne_Old.cab"
|
||||
}
|
||||
]
|
||||
}
|
@ -50,6 +50,8 @@ fu_vli_common_device_kind_to_string (FuVliDeviceKind device_kind)
|
||||
return "VL820Q7";
|
||||
if (device_kind == FU_VLI_DEVICE_KIND_VL820Q8)
|
||||
return "VL820Q8";
|
||||
if (device_kind == FU_VLI_DEVICE_KIND_VL822)
|
||||
return "VL822";
|
||||
if (device_kind == FU_VLI_DEVICE_KIND_VL120)
|
||||
return "VL120";
|
||||
if (device_kind == FU_VLI_DEVICE_KIND_VL210)
|
||||
@ -108,6 +110,8 @@ fu_vli_common_device_kind_from_string (const gchar *device_kind)
|
||||
return FU_VLI_DEVICE_KIND_VL820Q7;
|
||||
if (g_strcmp0 (device_kind, "VL820Q8") == 0)
|
||||
return FU_VLI_DEVICE_KIND_VL820Q8;
|
||||
if (g_strcmp0 (device_kind, "VL822") == 0)
|
||||
return FU_VLI_DEVICE_KIND_VL822;
|
||||
if (g_strcmp0 (device_kind, "VL120") == 0)
|
||||
return FU_VLI_DEVICE_KIND_VL120;
|
||||
if (g_strcmp0 (device_kind, "VL210") == 0)
|
||||
@ -172,6 +176,8 @@ fu_vli_common_device_kind_get_size (FuVliDeviceKind device_kind)
|
||||
return 0x20000 * 2;
|
||||
if (device_kind == FU_VLI_DEVICE_KIND_VL820Q8)
|
||||
return 0x20000 * 2;
|
||||
if (device_kind == FU_VLI_DEVICE_KIND_VL822)
|
||||
return 0x20000 * 2;
|
||||
if (device_kind == FU_VLI_DEVICE_KIND_PS186)
|
||||
return 0x40000;
|
||||
return 0x0;
|
||||
|
@ -34,6 +34,7 @@ typedef enum {
|
||||
FU_VLI_DEVICE_KIND_VL819 = 0x0819,
|
||||
FU_VLI_DEVICE_KIND_VL820Q7 = 0xa820,
|
||||
FU_VLI_DEVICE_KIND_VL820Q8 = 0xb820,
|
||||
FU_VLI_DEVICE_KIND_VL822 = 0x0822,
|
||||
FU_VLI_DEVICE_KIND_MSP430 = 0xf430, /* guessed */
|
||||
FU_VLI_DEVICE_KIND_PS186 = 0xf186, /* guessed */
|
||||
FU_VLI_DEVICE_KIND_RTD21XX = 0xff00, /* guessed */
|
||||
|
@ -50,6 +50,8 @@ fu_vli_pd_firmware_validate_header (FuVliPdFirmware *self)
|
||||
return TRUE;
|
||||
if (GUINT16_FROM_LE (self->hdr.vid) == 0x2D01)
|
||||
return TRUE;
|
||||
if (GUINT16_FROM_LE (self->hdr.vid) == 0x06C4)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -379,6 +379,7 @@ fu_vli_usbhub_device_guess_kind (FuVliUsbhubDevice *self, GError **error)
|
||||
GUsbDevice *usb_device = fu_usb_device_get_dev (FU_USB_DEVICE (self));
|
||||
guint8 b811P812 = 0x0;
|
||||
guint8 b820Q7Q8 = 0x0;
|
||||
guint8 b820822 = 0x0;
|
||||
guint8 chipid1 = 0x0;
|
||||
guint8 chipid2 = 0x0;
|
||||
guint8 chipid12 = 0x0;
|
||||
@ -419,6 +420,10 @@ fu_vli_usbhub_device_guess_kind (FuVliUsbhubDevice *self, GError **error)
|
||||
g_prefix_error (error, "Read_820Q7Q8 failed: ");
|
||||
return FALSE;
|
||||
}
|
||||
if (!fu_vli_usbhub_device_read_reg (self, 0xf88c, &b820822, error)) {
|
||||
g_prefix_error (error, "Read_820822 failed: ");
|
||||
return FALSE;
|
||||
}
|
||||
if (g_getenv ("FWUPD_VLI_USBHUB_VERBOSE") != NULL) {
|
||||
g_debug ("chipver = 0x%02x", chipver);
|
||||
g_debug ("chipver2 = 0x%02x", chipver2);
|
||||
@ -428,15 +433,20 @@ fu_vli_usbhub_device_guess_kind (FuVliUsbhubDevice *self, GError **error)
|
||||
g_debug ("chipid12 = 0x%02x", chipid12);
|
||||
g_debug ("chipid22 = 0x%02x", chipid22);
|
||||
g_debug ("b820Q7Q8 = 0x%02x", b820Q7Q8);
|
||||
g_debug ("b820822 = 0x%02x", b820822);
|
||||
}
|
||||
|
||||
if (chipid2 == 0x35 && chipid1 == 0x07) {
|
||||
fu_vli_device_set_kind (FU_VLI_DEVICE (self), FU_VLI_DEVICE_KIND_VL210);
|
||||
} else if (chipid2 == 0x35 && chipid1 == 0x18) {
|
||||
if (b820Q7Q8 & (1 << 2))
|
||||
fu_vli_device_set_kind (FU_VLI_DEVICE (self), FU_VLI_DEVICE_KIND_VL820Q8);
|
||||
else
|
||||
fu_vli_device_set_kind (FU_VLI_DEVICE (self), FU_VLI_DEVICE_KIND_VL820Q7);
|
||||
if (b820822 == 0xF0) {
|
||||
fu_vli_device_set_kind (FU_VLI_DEVICE (self), FU_VLI_DEVICE_KIND_VL822);
|
||||
} else {
|
||||
if (b820Q7Q8 & (1 << 2))
|
||||
fu_vli_device_set_kind (FU_VLI_DEVICE (self), FU_VLI_DEVICE_KIND_VL820Q8);
|
||||
else
|
||||
fu_vli_device_set_kind (FU_VLI_DEVICE (self), FU_VLI_DEVICE_KIND_VL820Q7);
|
||||
}
|
||||
} else if (chipid2 == 0x35 && chipid1 == 0x31) {
|
||||
fu_vli_device_set_kind (FU_VLI_DEVICE (self), FU_VLI_DEVICE_KIND_VL815);
|
||||
} else if (chipid2 == 0x35 && chipid1 == 0x38) {
|
||||
|
@ -174,15 +174,30 @@ fu_vli_usbhub_firmware_parse (FuFirmware *firmware,
|
||||
self->device_kind = FU_VLI_DEVICE_KIND_VL211;
|
||||
break;
|
||||
case 0x0518:
|
||||
/* VL820 == VT3518 */
|
||||
if (!fu_common_read_uint8_safe (buf, bufsz, 0xf000, &tmp, error)) {
|
||||
g_prefix_error (error, "failed to get Q7/Q8 difference: ");
|
||||
if (!fu_common_read_uint8_safe (buf, bufsz, 0x8021, &tmp, error)) {
|
||||
g_prefix_error (error, "failed to get 820/822 byte: ");
|
||||
return FALSE;
|
||||
}
|
||||
if (tmp & (1 << 0))
|
||||
self->device_kind = FU_VLI_DEVICE_KIND_VL820Q8;
|
||||
else
|
||||
self->device_kind = FU_VLI_DEVICE_KIND_VL820Q7;
|
||||
/* VL820/VL822 == VT3518 */
|
||||
if (tmp == 0xF0) {
|
||||
self->device_kind = FU_VLI_DEVICE_KIND_VL822;
|
||||
} else {
|
||||
/* Q7/Q8 requires searching two addresses for offset value */
|
||||
if (!fu_common_read_uint16_safe (buf, bufsz, 0x8018,
|
||||
&adr_ofs,G_BIG_ENDIAN, error)) {
|
||||
g_prefix_error (error, "failed to get Q7/Q8 offset mapping: ");
|
||||
return FALSE;
|
||||
}
|
||||
if (!fu_common_read_uint8_safe (buf, bufsz, adr_ofs + 0x2000 + 0x05,
|
||||
&tmp, error)) {
|
||||
g_prefix_error (error, "failed to get offset version: ");
|
||||
return FALSE;
|
||||
}
|
||||
if (tmp & (1 << 0))
|
||||
self->device_kind = FU_VLI_DEVICE_KIND_VL820Q8;
|
||||
else
|
||||
self->device_kind = FU_VLI_DEVICE_KIND_VL820Q7;
|
||||
}
|
||||
break;
|
||||
case 0x0538:
|
||||
/* VL817 == VT3538 */
|
||||
|
@ -6,6 +6,7 @@ install_data([
|
||||
'vli-usbhub.quirk',
|
||||
'vli-usbhub-lenovo.quirk',
|
||||
'vli-usbhub-hyper.quirk',
|
||||
'vli-usbhub-bizlink.quirk',
|
||||
],
|
||||
install_dir: join_paths(datadir, 'fwupd', 'quirks.d')
|
||||
)
|
||||
|
16
plugins/vli/vli-usbhub-bizlink.quirk
Normal file
16
plugins/vli/vli-usbhub-bizlink.quirk
Normal file
@ -0,0 +1,16 @@
|
||||
# BizLink USB-C Cayenne
|
||||
[DeviceInstanceId=USB\VID_06C4&PID_C304]
|
||||
Plugin = vli
|
||||
GType = FuVliUsbhubDevice
|
||||
Flags = usb3,has-shared-spi-pd
|
||||
CounterpartGuid = USB\VID_06C4&PID_C303
|
||||
[DeviceInstanceId=USB\VID_06C4&PID_C303]
|
||||
Plugin = vli
|
||||
GType = FuVliUsbhubDevice
|
||||
Flags = usb2
|
||||
ParentGuid = USB\VID_06C4&PID_C304
|
||||
[DeviceInstanceId=USB\VID_06C4&PID_C305]
|
||||
Plugin = vli
|
||||
GType = FuVliUsbhubDevice
|
||||
Flags = usb2
|
||||
ParentGuid = USB\VID_06C4&PID_C304
|
Loading…
Reference in New Issue
Block a user