diff --git a/plugins/synapticsmst/fu-plugin-synapticsmst.c b/plugins/synapticsmst/fu-plugin-synapticsmst.c index 83c9eee93..780064834 100644 --- a/plugins/synapticsmst/fu-plugin-synapticsmst.c +++ b/plugins/synapticsmst/fu-plugin-synapticsmst.c @@ -340,6 +340,7 @@ fu_plugin_update (FuPlugin *plugin, guint8 layer; guint8 rad; gboolean reboot; + gboolean install_force; /* extract details to build a new device */ kind = synapticsmst_device_kind_from_string (fu_device_get_metadata (dev, "SynapticsMSTKind")); @@ -359,11 +360,14 @@ fu_plugin_update (FuPlugin *plugin, if (!synapticsmst_device_enumerate_device (device, error)) return FALSE; reboot = !fu_device_has_custom_flag (dev, "skip-restart"); + install_force = (flags & FWUPD_INSTALL_FLAG_FORCE) != 0 || + fu_device_has_custom_flag (dev, "ignore-board-id"); fu_device_set_status (dev, FWUPD_STATUS_DEVICE_WRITE); if (!synapticsmst_device_write_firmware (device, blob_fw, fu_synapticsmst_write_progress_cb, dev, reboot, + install_force, error)) { g_prefix_error (error, "failed to flash firmware: "); return FALSE; diff --git a/plugins/synapticsmst/synapticsmst-device.c b/plugins/synapticsmst/synapticsmst-device.c index 57d8516bd..3598abfa1 100644 --- a/plugins/synapticsmst/synapticsmst-device.c +++ b/plugins/synapticsmst/synapticsmst-device.c @@ -1117,6 +1117,7 @@ synapticsmst_device_write_firmware (SynapticsMSTDevice *device, GFileProgressCallback progress_cb, gpointer progress_data, gboolean reboot, + gboolean install_force, GError **error) { const guint8 *payload_data; @@ -1137,21 +1138,16 @@ synapticsmst_device_write_firmware (SynapticsMSTDevice *device, return FALSE; } - /* TODO: May need a way to override this to cover field - * issues of invalid firmware flashed*/ /* check firmware and board ID again */ tmp = (*(payload_data + ADDR_CUSTOMER_ID) << 8) + *(payload_data + ADDR_BOARD_ID); - if (synapticsmst_device_get_board_id (device) >> 8 == 0) { - g_warning ("EVB board detected, bypassing customer ID check"); - } else { - if (tmp != synapticsmst_device_get_board_id (device)) { - g_set_error_literal (error, - G_IO_ERROR, - G_IO_ERROR_INVALID_DATA, - "board ID mismatch"); - return FALSE; - } + if (tmp != synapticsmst_device_get_board_id (device) && !install_force) { + g_set_error_literal (error, + G_IO_ERROR, + G_IO_ERROR_INVALID_DATA, + "board ID mismatch"); + return FALSE; } + /* open device */ if (!synapticsmst_device_open (device, error)) { g_prefix_error (error, diff --git a/plugins/synapticsmst/synapticsmst-device.h b/plugins/synapticsmst/synapticsmst-device.h index e0cdecb77..c3bc4a579 100644 --- a/plugins/synapticsmst/synapticsmst-device.h +++ b/plugins/synapticsmst/synapticsmst-device.h @@ -82,6 +82,7 @@ gboolean synapticsmst_device_write_firmware (SynapticsMSTDevice *device, GFileProgressCallback progress_cb, gpointer user_data, gboolean reboot, + gboolean install_force, GError **error); G_END_DECLS diff --git a/plugins/synapticsmst/synapticsmst.quirk b/plugins/synapticsmst/synapticsmst.quirk index 25b3bf354..6a5c8ad2e 100644 --- a/plugins/synapticsmst/synapticsmst.quirk +++ b/plugins/synapticsmst/synapticsmst.quirk @@ -15,10 +15,6 @@ # To override this behavior add the custom flag "skip-restart" # -[SynapticsMSTBoardID=2] -Name = Synaptics EVB development board -DeviceKind = evb - [SynapticsMSTBoardID=272] Name = Dell X6 Platform DeviceKind = system diff --git a/plugins/synapticsmst/synapticsmst_evb.quirk b/plugins/synapticsmst/synapticsmst_evb.quirk new file mode 100644 index 000000000..209e7c7ac --- /dev/null +++ b/plugins/synapticsmst/synapticsmst_evb.quirk @@ -0,0 +1,18 @@ +# Synaptics MST early validation board support +# +# This is not installed by default, but can be used to exercise new boards +# that don't yet have customer ID or board ID bytes filled out. +# +# To use it, load the quirk file into the quirks directory for the fwupd installation +# Usually this is /usr/share/fwupd/quirks.d +# +# Note: The flag "ignore-board-id" will be used to ignore the board ID checking in +# during flashing. This shouldn't be used in practice for production boards. +# + +[SynapticsMSTBoardID=2] +Name = Synaptics EVB development board +DeviceKind = panamera_evb + +[Guid=MST-panamera_evb-vmm5331-2] +Flags = ignore-board-id