Commit Graph

88 Commits

Author SHA1 Message Date
Richard Hughes
aa6a56205f dfu: Assume DFU version is 1.1 if unspecified 2017-11-21 15:55:29 +00:00
Richard Hughes
352ba1b833 dfu: Add support for the original AVR DFU protocol
This allows us to flash hardware like the Retrode and other devices using chips
like the AT90USB1287.

The test files can be re-generated using the sample code found here:
https://github.com/hughsie/fwupd-test-firmware and are designed
to be used on the AT90USBKEY2 development board.
2017-11-16 15:30:30 +00:00
Richard Hughes
fd4697188a dfu: Invalidate the DFU mode, state and status when replugging 2017-11-16 15:30:30 +00:00
Richard Hughes
31830aaea3 dfu: Ensure the mode is set correctly for fake runtimes 2017-11-13 16:01:57 +00:00
Richard Hughes
85dbcbf534 dfu: Add trivial helpers to get the current vid/pid/release 2017-11-11 21:06:18 +00:00
Richard Hughes
d44a5ee56d dfu: Add support for XMEGA chips
Notably, bootloaders for this class of device export an incorrect DFU interface.

Additionally, allow setting the buffer size for the UPLOAD to a larger size
than the defined device transfer size, which allows us to return the full
packet from the larger XMEGA devices.
2017-11-07 12:40:25 +00:00
Richard Hughes
ac9fa21eda dfu: Use a GError chain to properly report parsing failures 2017-11-07 12:40:25 +00:00
Richard Hughes
bdb6d7027a dfu: Allow setting a specific DFU version for hardware
Ignoring the warning is not good enough when we're setting policy based on the
specific version. Use the new quirk functionality to do this easily, which
also allows us to remove one more thing in the quirk mega-bitfield.
2017-11-07 12:40:25 +00:00
Richard Hughes
8a0ec158bd dfu: Return failure when getting device status fails 2017-11-06 20:10:26 +00:00
Richard Hughes
adeefcd4e0 dfu: Use FuQuirk to encode the Jabra magic packet contents
This allows us to remove the Jabra-specific quirk entry in the device bitfield,
and more importantly allows us to support some more Jabra devices in the future
without code changes.
2017-11-02 19:08:51 +00:00
Richard Hughes
24c452297d dfu: Use the FuQuirk infrastructure to move the quirks out of the code
This is slightly more verbose than desired as we also have to include the quirk
information when running the dfu-tool, which does not have an already set-up
FuQuirks object as it has no plugin.
2017-11-02 19:08:51 +00:00
Richard Hughes
c4e9b08f41 dfu: Remove the CanDownload and CanUpload attribute when required
When the AVR device is not recognised as a supported part we can't read or
write the firmware from the chip.
2017-10-31 18:30:05 +00:00
Richard Hughes
3e1e8227be dfu: Add support for one type of AVR32 device
Currently the only supported model is the AT32UC3A3256S, more to come...
2017-10-31 18:30:05 +00:00
Richard Hughes
d49f64f700 dfu: Split out the STM functionality to a new file 2017-10-31 18:30:05 +00:00
Richard Hughes
9acf8cd16f dfu: Set up the DfuTarget when opening the DfuDevice
In the future we'll use this to set vendor-specific quirks.
2017-10-31 18:30:05 +00:00
Richard Hughes
97520bd583 dfu: Add support for a chip ID
This allows us to show the user something they can include in a bug report.
2017-10-31 18:30:05 +00:00
Richard Hughes
f3e27065e6 dfu: Support devices with truncated DFU interface data
We can assume they support DFU 1.1. Fixes flashing the Jabra Speak 410.
2017-10-30 13:37:11 +00:00
Richard Hughes
54c7c0cc9f dfu: Only detach the HID interface when updating Jabra devices 2017-10-30 13:37:11 +00:00
Richard Hughes
181f516114 dfu: Guess the transfer size if it is not specified 2017-10-26 20:49:10 +01:00
Richard Hughes
55d5fb1ab0 dfu: Remove redundant dfu_device_has_dfuse_support() 2017-10-26 20:49:10 +01:00
Richard Hughes
61222fcb60 dfu: Add the various device quirks for the Jabra Speak devices
With much help from Niels Skou Olsen <nolsen@jabra.com>, many thanks.
2017-10-13 17:24:35 +01:00
Richard Hughes
3d2baa7476 dfu: Add DFU_DEVICE_QUIRK_ATTACH_EXTRA_RESET
Some devices need yet another reset to get them back into runtime mode.
2017-10-13 17:20:20 +01:00
Richard Hughes
7a42f5eab9 dfu: Add DFU_DEVICE_QUIRK_IGNORE_UPLOAD
Some DFU implementations (e.g. CSR) do not properly support verification of
firmware using the upload mechanism.
2017-10-13 17:20:20 +01:00
Richard Hughes
ce7baf4e2e dfu: Don't infer that NO_DFU_RUNTIME always requires user action 2017-10-13 17:20:20 +01:00
Richard Hughes
9fac3a2895 dfu: Unbind the kernel module when claiming the device DFU interface 2017-10-13 17:20:20 +01:00
Richard Hughes
64179e42af dfu: Print the device attributes when using 'dfu-tool list' 2017-10-13 09:13:42 +01:00
Richard Hughes
4b9126ee7d dfu: Allow flashing when the target does not specify an alt-name 2017-10-12 12:47:10 +01:00
Richard Hughes
b9f4907645 dfu: Add a low-level 'reset' command to dfu-tool 2017-10-12 09:13:27 +01:00
Richard Hughes
6359f7f9c6 dfu: Log the transfer size chosen for the device 2017-10-12 09:13:27 +01:00
Richard Hughes
153374e014 dfu: Use 0x0101 as an alias for 0x0110
If read the specification correctly it's supposed to be 0x0110 i.e. 1.10,
rather than 1.01 -- just work around it as it seems a common enough mistake.
2017-10-12 09:13:27 +01:00
Richard Hughes
8e054956b2 dfu: Include the reset timeout as wValue to fix some hardware 2017-10-12 09:13:27 +01:00
Richard Hughes
b73ff8a346 trivial: Use FwupdStatus in the dfu plugin 2017-09-28 09:23:52 +01:00
Richard Hughes
9e79223ecf trivial: C99ify more for-loops 2017-09-28 09:23:52 +01:00
Richard Hughes
daa341720f trivial: Show the interface size for an invalid DFU device 2017-09-18 11:06:29 +01:00
Richard Hughes
b3c13461e9 trivial: Use the error domain from libfwupd
This means we don't need to convert the error code in the dfu plugin.
2017-09-08 13:33:34 +01:00
Richard Hughes
ef39e2e52f trivial: Remove all the DFU API versioning information 2017-09-08 10:32:22 +01:00
Richard Hughes
a81ee67356 dfu: Use FuDeviceLocker 2017-09-07 19:00:51 +01:00
Richard Hughes
68480a2069 trivial: Move the libdfu sources to the dfu plugin 2017-09-07 18:39:23 +01:00