mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-08 10:54:41 +00:00
synapticsmst: Adjust EVB board handling
1. Since board ID in synapticsmst.quirk is different based upon how the board ID is read, don't whitelist it in `write_firmware` 2. Allow using `--force` with `fwupdmgr` or `fwupdtool` to override board ID check. 3. Allow using custom flag `ignore-board-id` to ignore board IDs. This will be the default for EVB boards and can be used in the event of a factory mistake as well. 4. Move the EVB board IDs into their own synapticsmst_evb.quirk. This file will not be installed by default (So EVB boards are only functional when manually installed).
This commit is contained in:
parent
da4049499e
commit
5e36c9e792
@ -340,6 +340,7 @@ fu_plugin_update (FuPlugin *plugin,
|
|||||||
guint8 layer;
|
guint8 layer;
|
||||||
guint8 rad;
|
guint8 rad;
|
||||||
gboolean reboot;
|
gboolean reboot;
|
||||||
|
gboolean install_force;
|
||||||
|
|
||||||
/* extract details to build a new device */
|
/* extract details to build a new device */
|
||||||
kind = synapticsmst_device_kind_from_string (fu_device_get_metadata (dev, "SynapticsMSTKind"));
|
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))
|
if (!synapticsmst_device_enumerate_device (device, error))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
reboot = !fu_device_has_custom_flag (dev, "skip-restart");
|
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);
|
fu_device_set_status (dev, FWUPD_STATUS_DEVICE_WRITE);
|
||||||
if (!synapticsmst_device_write_firmware (device, blob_fw,
|
if (!synapticsmst_device_write_firmware (device, blob_fw,
|
||||||
fu_synapticsmst_write_progress_cb,
|
fu_synapticsmst_write_progress_cb,
|
||||||
dev,
|
dev,
|
||||||
reboot,
|
reboot,
|
||||||
|
install_force,
|
||||||
error)) {
|
error)) {
|
||||||
g_prefix_error (error, "failed to flash firmware: ");
|
g_prefix_error (error, "failed to flash firmware: ");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -1117,6 +1117,7 @@ synapticsmst_device_write_firmware (SynapticsMSTDevice *device,
|
|||||||
GFileProgressCallback progress_cb,
|
GFileProgressCallback progress_cb,
|
||||||
gpointer progress_data,
|
gpointer progress_data,
|
||||||
gboolean reboot,
|
gboolean reboot,
|
||||||
|
gboolean install_force,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
const guint8 *payload_data;
|
const guint8 *payload_data;
|
||||||
@ -1137,21 +1138,16 @@ synapticsmst_device_write_firmware (SynapticsMSTDevice *device,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: May need a way to override this to cover field
|
|
||||||
* issues of invalid firmware flashed*/
|
|
||||||
/* check firmware and board ID again */
|
/* check firmware and board ID again */
|
||||||
tmp = (*(payload_data + ADDR_CUSTOMER_ID) << 8) + *(payload_data + ADDR_BOARD_ID);
|
tmp = (*(payload_data + ADDR_CUSTOMER_ID) << 8) + *(payload_data + ADDR_BOARD_ID);
|
||||||
if (synapticsmst_device_get_board_id (device) >> 8 == 0) {
|
if (tmp != synapticsmst_device_get_board_id (device) && !install_force) {
|
||||||
g_warning ("EVB board detected, bypassing customer ID check");
|
g_set_error_literal (error,
|
||||||
} else {
|
G_IO_ERROR,
|
||||||
if (tmp != synapticsmst_device_get_board_id (device)) {
|
G_IO_ERROR_INVALID_DATA,
|
||||||
g_set_error_literal (error,
|
"board ID mismatch");
|
||||||
G_IO_ERROR,
|
return FALSE;
|
||||||
G_IO_ERROR_INVALID_DATA,
|
|
||||||
"board ID mismatch");
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* open device */
|
/* open device */
|
||||||
if (!synapticsmst_device_open (device, error)) {
|
if (!synapticsmst_device_open (device, error)) {
|
||||||
g_prefix_error (error,
|
g_prefix_error (error,
|
||||||
|
@ -82,6 +82,7 @@ gboolean synapticsmst_device_write_firmware (SynapticsMSTDevice *device,
|
|||||||
GFileProgressCallback progress_cb,
|
GFileProgressCallback progress_cb,
|
||||||
gpointer user_data,
|
gpointer user_data,
|
||||||
gboolean reboot,
|
gboolean reboot,
|
||||||
|
gboolean install_force,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
@ -15,10 +15,6 @@
|
|||||||
# To override this behavior add the custom flag "skip-restart"
|
# To override this behavior add the custom flag "skip-restart"
|
||||||
#
|
#
|
||||||
|
|
||||||
[SynapticsMSTBoardID=2]
|
|
||||||
Name = Synaptics EVB development board
|
|
||||||
DeviceKind = evb
|
|
||||||
|
|
||||||
[SynapticsMSTBoardID=272]
|
[SynapticsMSTBoardID=272]
|
||||||
Name = Dell X6 Platform
|
Name = Dell X6 Platform
|
||||||
DeviceKind = system
|
DeviceKind = system
|
||||||
|
18
plugins/synapticsmst/synapticsmst_evb.quirk
Normal file
18
plugins/synapticsmst/synapticsmst_evb.quirk
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user