Commit Graph

1843 Commits

Author SHA1 Message Date
Richard Hughes
94e3d24f55 bcm57xx: Make hotplug more reliable
Although hotpluggging PCIe cards isn't common, it's how I'm testing this in the
device test enclosure. Add a tiny delay to wait for the kernel to populate the
net class on hotplug.
2020-10-29 14:01:25 +00:00
Richard Hughes
a78b13fb71 Use a different Device ID for the OptionROM devices
We want to continue to dedupe the ID, and the priority should be decided on the
GUID match.

Fixes https://github.com/fwupd/fwupd/issues/2510 in a different way
2020-10-29 14:01:25 +00:00
Richard Hughes
ded5410f6d Delete unused EFI variables when deploying firmware
Unconditionally delete FWUPDATE_VERBOSE and FWUPDATE_DEBUG_LOG when deploying
the update using fwupdtool or fwupd and leave it to fwupdate.

If you want to debug the efi binary you then have to use fwupdate and squirt
the .cap file rather than using all the other layers.
2020-10-27 17:05:01 +00:00
Richard Hughes
49c2a78c99 Include the amount of NVRAM size in use in the LVFS failure report 2020-10-27 13:58:40 +00:00
Mario Limonciello
8aa5d41eb7 Add external interface messages 2020-10-26 12:05:20 -05:00
Emily Miller
f9ad963bcf vli: Add support for Hyper hardware 2020-10-26 10:08:00 +00:00
Jingle Wu
3460e0a5ed elantp: Modify the correct input for the iap reg.
1. Modify the correct input for the iap reg (byte -> word).
2. Add new HWID for ThinkPad X1 Carbon Gen 9.
2020-10-23 08:56:48 +01:00
Richard Hughes
e80547e8fc Record the TPM version when reporting a UEFI update
Fixes https://github.com/fwupd/fwupd/issues/2391
2020-10-22 16:16:23 +01:00
Richard Hughes
b814af80ef synaptics-cxaudio: Retry the HID SetReport to fix flashing the TB3 dock
Upon restarting the upstream VLI USB hub the cxaudio device re-enumerated okay
but would not service HID requests for 100ms, returning 'endpoint stalled'.

To make this more reliable retry the SetRequest up to 10 times after a short
delay to make enumeration reliable.
2020-10-22 14:36:05 +01:00
Richard Hughes
3b577c5de3 bcm57xx: Fix trivial warnings when building on Win32 2020-10-22 13:55:14 +01:00
Richard Hughes
1fd1a8047e optionrom: Add the fuzzing functionality as a meson target 2020-10-22 13:22:34 +01:00
Vincent Huang
a9d8074c61 synaptics-prometheus: add pids to quirk file 2020-10-22 08:21:30 +01:00
Richard Hughes
b7e406c217 ata: Add OUI quirk for Corsair 2020-10-21 20:18:27 +01:00
Richard Hughes
0d778dbd50 vli: Set the parent of the USB2 recovery for cosmetic reasons 2020-10-21 17:48:36 +01:00
Richard Hughes
07326182ca vli: Do not expose the shared-SPI devices on the USB2 recovery device 2020-10-21 17:48:25 +01:00
Mario Limonciello
b15f4ab4b1 elantp: Trivial whitespace fixes 2020-10-21 16:54:13 +01:00
Mario Limonciello
0ad124a02b elantp: Match all i2c-hid devices in quirk
In the plugin probe routine, check whether they are actually i2c-hid touchpad
by looking at PID.

Fixes #2494
2020-10-21 16:54:13 +01:00
Richard Hughes
f6a765d251 vli: Remove one of the catch-all PD VID:PID matches
This is already supported using the &APP_ GUID for the Lenovo USB-C Mini dock.
2020-10-21 16:25:12 +01:00
Richard Hughes
a2a8f8ea70 Add fu_byte_array_set_size()
The GLib g_byte_array_set_size() function does not zero the contents if the
array size is larger, which leads to unpredictable output when using valgrind.
2020-10-20 19:54:07 +01:00
Richard Hughes
92769bfba1 trivial: Use fu_device_sleep_with_progress() in one more place 2020-10-20 18:21:27 +01:00
Richard Hughes
04d0a1b863 vli: Use the tokenization data for the Intel HEX file 2020-10-20 16:27:15 +01:00
Richard Hughes
c7283ea61e uefi: Drop efivar dependency 2020-10-19 16:13:21 +01:00
Richard Hughes
f019971c00 redfish: Drop efivar dependency 2020-10-19 16:13:21 +01:00
Mario Limonciello
68df30bd2b dell: Drop efivar dependency
Since we removed the ability to turn on/off force power this is dead code, and
an unnecessary dependency.
2020-10-19 16:13:21 +01:00
Richard Hughes
81b5defaa6 uefi: Use fu_efivar_get_data() to fix setting BootNext correctly
Fixes https://github.com/fwupd/fwupd/issues/2169
2020-10-19 16:13:21 +01:00
Richard Hughes
ae5858ff58 vli: Get the new firmware version when updating the PD device
To do this without rebooting the device implement VliUsbhubPdDevice->reload()
like the other FuVliUsbhubDevice child devices.

Fixes half of https://github.com/fwupd/fwupd/issues/2376
2020-10-18 07:35:46 +01:00
Richard Hughes
0357881c42 elantp: Implement the ->reload action to get the new firmware version 2020-10-16 10:06:45 +01:00
Mario Limonciello
61ba02ae16 trivial: increase debugging for for fu-uefi-bootmgr.c
See #2169 for more context
2020-10-15 17:02:04 -05:00
Richard Hughes
1f6a1520fb elantp: Fix three impossible to hit bugs spotted by Coverity
If somehow chk->data_sz is bigger than blksz then we would write past the end
of the allocated buffer.
2020-10-14 15:11:31 +01:00
Richard Hughes
7bcb8d4385 Export FwupdPlugin so we can convey enumerated system errors to the end user
For instance, we can tell the user that UEFI UpdateCapsule is disabled in the
system firmware, or that efivarfs is not mounted. This is much better than
creating "dummy" devices which are really just hacks around the problem because
no better API existed. THe dummy devices cause as many problems as they solve.

Plugins have to set FWUPD_PLUGIN_FLAG_USER_WARNING if a warning should be shown
to the user, and only one warning will be shown of each failure type.

It is expected that GUI clients like gnome-software and gnome-firmware would use
this API to notify the user the localized message for why firmware updates are
not being shown.

Fixes https://github.com/fwupd/fwupd/issues/2456
2020-10-13 15:56:49 +01:00
Benson Leung
42f2e22dd2 cros-ec: Add support for quiche and gingerbread boards
Add quirks for PID 5048 and 5049, which are cros-ec devices
that update via USB endpoint. Notable about these two are
they support rw_sig, for RW region signature verification.
2020-10-11 07:34:49 +01:00
Benson Leung
343613954b cros-ec: Increase remove delay for reenumeration to 20s. 2020-10-11 07:34:49 +01:00
Benson Leung
e8fd2cdfa4 cros-ec: Restructure to allow RO update first
Our update flow prior to this was:
1. On detach, reboot to RO.
2. From Old RO, Update RW.
3. Reboot to New RW
4. From New RW, Update RO.
5. Reboot to finish

This flow has a flaw, which is that the Old RO may be buggy (especially
during development, before it's actually locked down and actually Read-Only).

This change will do the following instead:
1. On detach, do not reboot to RO if RO is writeable, and we are in RW
2. From old RW, Update RO
3. Reboot to new RO
4. From New RO, update RW
5. Reboot to finish.

This has a speed advantage as well, as we save one reboot cycle (2 vs 3).
2020-10-11 07:34:49 +01:00
Benson Leung
2c5558e51d cros-ec: Log error paths, and trigger flushes
In case of a failure during the bulk transfer sequence, flush out
before trying again.
2020-10-11 07:34:49 +01:00
Benson Leung
af07f32c0f cros-ec: Send a start message after the stay-in-ro
The extra command (stay-in-ro) consumes the start message, so we
need to issue another one before write firmware.
2020-10-11 07:34:49 +01:00
Benson Leung
c516724278 cros-ec: Set another write required if we immediate reset back into RO
As a result of the previous change, where we send an immediate reset to
devices in order to transition back to rw, we will end up reenumerating
as RO briefly, although the destination we wanted to get to was RW.

In that case, basically skip the write firmware step, set another write
required and allow the RO firmware to complete rw_sig and jump to the rw
partition.
2020-10-11 07:34:49 +01:00
Benson Leung
08c396b31c cros-ec: Send an immediate reset after jump to rw
Some devices don't do the jump, so an immediate reset is required to get us
into RW.
2020-10-11 07:34:49 +01:00
Benson Leung
b093de999a cros-ec: Fix reboot to RO sequence
Previously, we sent a 'stay-in-ro' subcommand when we are in
fu_cros_ec_usb_device_reset_to_ro, which is called from the detach phase,
in other words, we are currently sitting in RW.
This is incorrect, since stay-in-ro only interrupts an RO's
rw_sig process if it is in progress.

Instead, 'stay-in-ro' must be issued when the device reenumerates in RO,
immediately before the writing sequence starts. On devices that implement
rw_sig, they will briefly enumerate as RO before self-issuing a jump to RW
on the signature check being valid. In order to stay in RO to perform a RW
partition update, we must interrupt it as soon as we see the RO version
enumerate.
2020-10-11 07:34:49 +01:00
Richard Hughes
cc2f6aa1b2 Add fu_device_sleep_with_progress helper()
This makes the console a bit more helpful than just 'hanging'...
2020-10-11 07:34:00 +01:00
Érico Rolim
acd95c661b uefi: add configuration option for objcopy utility. 2020-10-10 12:32:13 +01:00
Evan Lojewski
44361fa14e bcm57xx: Improve reliability when flashing
- Use pci function 0 instead of 1 when flashing firmware.
  In certain situations, the BCM5719 NVM controller can lockup if
  a function other than 0 is used to read from NVM word-by-word like
  the kernel driver does.
- Fix APE_MODE offset in BAR[2] to enable proper resetting of the APE.
- Remove unnededed NVRam lock when resetting the APE.

Signed-off-by: Evan Lojewski <github@meklort.com>
2020-10-09 07:37:33 +01:00
Richard Hughes
4123885c81 bcm57xx: Add a plugin that can update the BCM5719 network adapter 2020-10-08 16:49:07 +01:00
jingle.wu
4f2cb4598c elantp: Modify firmware update flow
1. Check FW in bootloader mode, need send reset command to firmware.
 2. IAP Type register parameter is defind as how many bytes/page to be written.
 3. Write IAP Type function in detach function.
 4. Remove IAP Type function in setup function.
 5. Modify page format for i2c-device
 6. Modify firmware bin file size.
 7. Modify firmware update flow when the firmware in bootloader mode.
 8. Add another instance ID which corresponds to the IC type & module ID
   * `ELANTP\ICTYPE_09&MOD_1234`
 9. Add Lenovo ThinkPad X1 nano gen1 to elantp.quick
10. Add recovry device - lenovo thinkpad x1 nanao gen 1
11. Add elan touchpad device - vid:04f3 pid:314f
12. Set the firmware version when the firmware is incorrect.
2020-10-08 10:43:06 -05:00
Richard Hughes
e6eb913b74 uefi: Only set the version format for ESRT entries
Setting the default to number unconditionally causes problems when the device
is created using _register_proxy_device().

Based on a patch by Mario Limonciello <mario.limonciello@dell.com>, many thanks.
2020-10-08 10:34:23 -05:00
Mario Limonciello
e8a2fc8c57 uefi: Make udisks2 errors more apparent
When support for dynamically mounting disks was added for 25ba41579f
udisks2 became a harder dependency and it was less obvious to users.

Create devices but show an error in why devices aren't updatable if
it's not found.

Users can still configure ESP manually in `uefi.conf`

Fixes: #2444
2020-10-08 09:16:32 -05:00
Richard Hughes
6450d0deb4 Add FwupdInstallFlags of _IGNORE_CHECKSUM, _IGNORE_VID_PID and _IGNORE_POWER
The FWUPD_INSTALL_FLAG_FORCE flag has really unclear semantics, and ignoring a
file CRC, checksum or model ID should only be done when using fwupdtool actually
debugging a plugin or firmware parser.

Use the existing --force flag when we want a "gentle nudge" like reuploading
previously processed reports.
2020-10-07 13:15:09 +01:00
Mario Limonciello
406025ba56 trivial: ci: fix installed-tests for test plugin
This has been broken for a while and missed various changes.
* Reading firmware version
* Passing `-y` into build
* New verify / verify-image split
2020-10-06 13:34:41 -05:00
Richard Hughes
488a8a76d4 trivial: Fix 'returning FALSE in a pointer function' warning 2020-10-05 22:14:31 +01:00
Richard Hughes
26e57dd4e2 Do not auto-detach when dumping firmware
This allows us to handle this in the plugin, which might mean detaching the
*proxy* device. It's also very important as a few plugins reboot the device
in ->attach() to get the new firmware version, which isn't required for a dump.

This partially reverts a58510b246 and does the
detach and attach in the few plugins where actually required.
2020-10-05 19:44:44 +01:00
Mario Limonciello
c5ea3a39f9 trivial: uefi: quiet down debugging messages
With how well fwupd UEFI updates work these days >99% of people
don't need to see messages about the capsule update running.
Those who have problems, this isn't going to help them.
2020-10-03 06:58:13 -05:00