fwupd/plugins/thunderbolt
Mika Westerberg 0fd763cad4 thunderbolt: Use both locations for multi controller entry validation
Since the multi controller entry is part of the DROM and its place is
not fixed, it is possible (however unlikely) that the locations between
controller and the image are different. One scenario is that the new
image has typo in device or vendor name string fixed which could cause
the offset to be different.

To handle this case properly we need to read multi controller locations
of both controller and image separately, read their values and then
compare them against each other.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2018-08-12 10:58:16 +01:00
..
fu-plugin-thunderbolt.c thunderbolt: Increase retry timeout from 20 to 200 ms 2018-08-09 14:18:55 +01:00
fu-plugin-thunderbolt.h Remove the unused Emacs indenting headers from all source files 2018-08-09 12:48:04 +01:00
fu-self-test.c trivial: Do not define _GNU_SOURCE 2018-08-09 16:59:04 +01:00
fu-thunderbolt-image.c thunderbolt: Use both locations for multi controller entry validation 2018-08-12 10:58:16 +01:00
fu-thunderbolt-image.h Remove the unused Emacs indenting headers from all source files 2018-08-09 12:48:04 +01:00
fu-thunderbolt-known-devices.h Remove the unused Emacs indenting headers from all source files 2018-08-09 12:48:04 +01:00
fu-thunderbolt-tool.c Remove the unused Emacs indenting headers from all source files 2018-08-09 12:48:04 +01:00
meson.build thunderbolt: Fix the self tests when using -Db_sanitize=address 2018-06-28 20:55:37 +01:00
README.md thunderbolt: handle "native" mode 2018-01-08 16:28:23 +00:00

Thunderbolt™ Support

Introduction

Thunderbolt™ is the brand name of a hardware interface developed by Intel that allows the connection of external peripherals to a computer. Versions 1 and 2 use the same connector as Mini DisplayPort (MDP), whereas version 3 uses USB Type-C.

Runtime Power Management

Thunderbolt controllers are slightly unusual in that they power down completely when no thunderbolt devices are detected. This poses a problem for fwupd as it can't coldplug devices to see if there are firmware updates available, and also can't ensure the controller stays awake during a firmware upgrade.

On Dell hardware the Thunderbolt::CanForcePower metadata value is set as the system can force the thunderbolt controller on during coldplug or during the firmware update process. This is typically done calling a SMI or ACPI method which asserts the GPIO for the duration of the request.

On non-Dell hardware you will have to insert a Thunderbolt device (e.g. a dock) into the laptop to be able to update the controller itself.

Safe Mode

Thunderbolt hardware is also slightly unusual in that it goes into "safe mode" whenever it encounters a critical firmware error, for instance if an update failed to be completed. In this safe mode you cannot query the controller vendor or model and therefore the thunderbolt plugin cannot add the correct GUID used to match it to the correct firmware.

In this case the metadata value Thunderbolt::IsSafeMode is set which would allow a different plugin to add the correct GUID based on some out-of-band device discovery. At the moment this only happens on Dell hardware.

GUID generation for LVFS

The GUID for the controller, which must appear in the metadata when uploading an NVM to LVFS, can be generated by a tool like appstream-util (with generate-guid command) or by Python (with uuid.uuid5(uuid.NAMESPACE_DNS, 'string')).

The format of the string used as input is "TBT-vvvvdddd", where vvvvv is the vendor ID and dddd is the device ID, both in hex, as appear in the controller's DROM and exposed in the relevant sysfs attributes.

If the controller is in native enumeration mode, the string "-native" is added at the end so the format is "TBT-vvvvdddd-native".