Commit Graph

4304 Commits

Author SHA1 Message Date
Richard Hughes
a3740518b2 vli: Port to fu_device_retry() 2020-03-28 12:46:03 +00:00
Richard Hughes
49797d7de4 ccgx: Reset the i2c bridge on status failure 2020-03-28 12:46:03 +00:00
Richard Hughes
89a5ed01ef trivial: Add fu_device_retry_set_delay() to set a generic device delay 2020-03-28 12:46:03 +00:00
Richard Hughes
348719f759 Add fu_device_retry() helper functionality
Sometimes plugins need to retry various commands send to hardware, either due
to unreliable transfers (e.g. using USB bulk) or from slightly quirky hardware.

Between them they seem to get various things wrong; either the error messages
are repeated and thus difficult to parse, or they just get the memory handling
of `g_propagate_prefixed_error()` wrong.

Providing sane helpers we can reduce the amount of boilerplate. Additionally
we can support a 'reset' function that can try to automatically recover the
hardware for specific error domains and codes.
2020-03-27 15:47:08 +00:00
Richard Hughes
8e86b1ec4c trivial: Fix the ThinkPad USB-C Dock Gen2 audio device parent 2020-03-27 14:25:17 +00:00
Richard Hughes
5d787b5958 trivial: Set up the parent GUIDs for the Lenovo Gen2 Dock 2020-03-27 13:57:09 +00:00
Richard Hughes
81da69e73d ccgx: Implement writing firmware to flash
Correctly attach into the alternate mode after the update has completed.

The vendor was appending two files to make LVFS distribution 'easier' but I'd
much rather use the same deliverables as Windows. This also allows us to
simplify the firmware loading.
2020-03-27 13:25:40 +00:00
Changhee (Ryan) Lee
338f5a4083 ccgx: Add i2c status check when reading or writing registers
Signed-off-by: Richard Hughes <richard@hughsie.com>
2020-03-27 13:25:40 +00:00
Changhee (Ryan) Lee
064c5cce19 ccgx: Add 5ms delay between read registers to avoid an i2c error
Signed-off-by: Richard Hughes <richard@hughsie.com>
2020-03-27 13:25:40 +00:00
Richard Hughes
184baf6f4a trivial: Partially revert some of 464eacdc
The FuUsbDevice was using a locker of NULL to indicate unlocked, and just
calling `fu_device_locker_close()` does not unset the object.
2020-03-27 13:21:47 +00:00
Richard Hughes
464eacdc53 libfwupdplugin: Use fu_device_locker_close() 2020-03-26 15:23:10 -05:00
Richard Hughes
d66a445ada synaptics-mst: Use fu_device_locker_close() 2020-03-26 15:23:10 -05:00
Richard Hughes
a1882f8c4b Add fu_device_locker_close()
This allows us to manually close the locker, allowing proper error handling.
2020-03-26 15:23:10 -05:00
Mario Limonciello
f35be1c393 trivial: ci: exclude ia64 for flashrom 2020-03-25 09:51:12 -05:00
Richard Hughes
87d39d06a3 ccgx: Do not store the silicon ID in the image address
First, it's a hack; second we actually need to store the start address for
flashing FW2 on asymmetric hardware...
2020-03-24 21:16:08 +00:00
Richard Hughes
bf5481e358 ccgx: Add device quirks for the Lenovo Hybrid Dock 2020-03-24 21:16:08 +00:00
Richard Hughes
9278e265b4 ccgx: Switch HID mode to HPI mode at startup 2020-03-24 21:16:08 +00:00
Richard Hughes
dab6bda2be ccgx: Clear the event queue when in startup 2020-03-24 21:16:08 +00:00
Richard Hughes
fd7f13f905 ccgx: Wait for hardware to settle when coming out of reset 2020-03-24 21:16:08 +00:00
Richard Hughes
3990a71401 ccgx: Do not mark the device as updatable when in boot mode 2020-03-24 21:16:08 +00:00
Richard Hughes
c6147bf340 ccgx: Verify the firmware app type when preparing firmware 2020-03-24 21:16:08 +00:00
Richard Hughes
754d85e282 ccgx: Set the update message when running in backup firmware 2020-03-24 21:16:08 +00:00
Richard Hughes
de61d27259 ccgx: Read the FwAppType from the hardware 2020-03-24 21:16:08 +00:00
Richard Hughes
2b45362e25 ccgx: Set the HPI version number for the current firmware 2020-03-24 21:16:08 +00:00
Richard Hughes
c6a671be7e ccgx: Get the silicon ID to map the flash parameters 2020-03-24 21:16:08 +00:00
Richard Hughes
11fa0a1e90 ccgx: Read the HPI device mode at startup 2020-03-24 21:16:08 +00:00
Richard Hughes
0a37232ba1 ccgx: Set up the HPI I²C config at startup 2020-03-24 21:16:08 +00:00
Mario Limonciello
36ffd92695 trivial: fix ubuntu CI 2020-03-24 10:02:28 -05:00
Richard Hughes
69b761ce64 trivial: Export fu_device_add_instance_id_full() for plugins to use
Sometimes we only want to add the instance ID to get the quirk matches, and it
is confusing to see the "fake" IDs in the 'fwupdmgr get-devices' output.
2020-03-24 14:43:31 +00:00
Richard Hughes
cff23f798f trivial: Autodetect the HID interface to use 2020-03-24 08:34:16 -05:00
Richard Hughes
62aa46cb83 ccgx: Create devices when in HID and I2C modes 2020-03-23 20:02:17 +00:00
Mario Limonciello
b963cb3678 Add a new ChromeOS CI target to build without GPG and PKCS7
This is actually built on Debian, but it's intended purpose is to
be able to check whether the package made bad assumptions for ChromeOS
2020-03-23 19:55:12 +00:00
Richard Hughes
d5aab65f30 Use Jcat files in firmware archives and for metadata
A Jcat file can be used to store GPG, PKCS-7 and SHA-256 checksums for multiple
files. This allows us to sign a firmware or metadata multiple times (perhaps
by the OEM and also then the LVFS) which further decentralizes the trust model
of the LVFS.

The Jcat format was chosen as the Microsoft catalog format is nonfree and not
documented. We also don't want to modify an existing .cat file created from WU
as this may make it unsuitable to use on Windows.

More information can be found here: https://github.com/hughsie/libjcat
2020-03-23 19:55:12 +00:00
Richard Hughes
86b0bae0c4 trivial: Do not use -Db_sanitize=address as it breaks g-ir-scanner
And nobody can figure out why!
2020-03-23 19:55:12 +00:00
Richard Hughes
46963b1118 csr: Allow truncated HID reads
The device is allowed to return short buffers during read operation. This fixes
a regression introduced in c04f5a3.

Fixes https://github.com/fwupd/fwupd/issues/1893
2020-03-23 13:40:34 +00:00
Richard Hughes
1ae456c49c trivial: Show the expected size when HID reads or writes were truncated 2020-03-23 13:40:34 +00:00
Emily
5f3a2c0bc1 vli: Only consider the high nibble when building the sub-version 2020-03-23 08:11:14 +00:00
Richard Hughes
ded9fef4b6 csr: Parse the firmware as a DFU file
This was changed to Intel hex in 7afd7cba0d,
probbaly due to a copy-paste mistake. Change it back to DFU.

Fixes https://github.com/fwupd/fwupd/issues/1890
2020-03-22 11:46:40 -05:00
Richard Hughes
811e75db4b Add support for EP963x hardware 2020-03-22 15:48:04 +00:00
Mario Limonciello
60f15fe426 trivial: ci: suppress binary-is-wrong-architecture as well 2020-03-20 16:10:28 -05:00
Mario Limonciello
75a3b17972 trivial: ci: suppress lintian error that is a lintian bug
This will be fixed in an updated lintian and is not a problem
for the fwupd packaging.
2020-03-20 16:10:28 -05:00
Mario Limonciello
6c5a9e04e5 trivial: snap: save artifacts from build
Should help for debugging problems without a local build as well
as in case upload to snapcraft.io fails to avoid having to re-run
full build.
2020-03-20 11:18:00 -05:00
Mario Limonciello
0b2c717e97 trivial: snap: fix bash completion
fwupdmgr is now using fwupdagent, and so we need to reference properly.
2020-03-20 11:18:00 -05:00
Mario Limonciello
14001f7523 trivial: snap: remove master snap
We're realistically never going to build something with this.
2020-03-20 11:18:00 -05:00
Mario Limonciello
c4bc1ad881 trivial: snap: add fwupdagent command 2020-03-20 11:18:00 -05:00
Mario Limonciello
d6baddc772 trivial: snap: include fwupdtpmevlog command (fixes: #1885) 2020-03-20 11:18:00 -05:00
Richard Hughes
c04f5a3e15 Add FuHidDevice abstraction
Quite a few plugins use HID commands to communicate with the hardware. At the
mement we have ~6 implementations of SET_REPORT and are soon to add one more.

Move this into common code.
2020-03-19 17:02:07 +00:00
Richard Hughes
c134451aeb trivial: Fix up a private function name that was missed 2020-03-19 06:43:42 +00:00
Richard Hughes
dd34e51711 trivial: Fix up some argument names with additional docs 2020-03-19 06:43:42 +00:00
Richard Hughes
ed07a17509 vli: Correctly attach VL103 after a firmware update
This works around a silicon errata which makes the existing 0xB0 chip reset
non-functional.

ALso, as VL10x and VL103 are so different now, use different `->attach()` and
`->detach()` implementations for code sanity.

Based on a patch by Sherlock Chu <SherlockChu@via-labs.com>, many thanks.
2020-03-19 06:43:42 +00:00