Commit Graph

11 Commits

Author SHA1 Message Date
Mario Limonciello
55de39c077 trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
Mario Limonciello
73cdf067ed trivial: fixup includes for a variety of plugins 2021-06-14 10:12:45 +01:00
Mario Limonciello
395856afeb trivial: remove some unused variables
Caught by clang
2021-04-06 14:09:12 -05:00
Richard Hughes
52441f28a4 Allow objects to deserialize to XML
This makes a lot more sense; we can parse a firmware and export the same XML
we would use in a .builder.xml file. This allows us to two two things:

 * Check we can round trip from XML -> binary -> XML

 * Using a .builder.xml file we can check ->write() is endian safe
2021-03-15 12:07:30 +00:00
Richard Hughes
1981c63d58 Remove FuFirmwareImage and just use FuFirmware instead
This allows us to 'nest' firmware formats, and removes a ton of duplication.

The aim here is to deprecate FuFirmwareImage -- it's almost always acting
as a 'child' FuFirmware instance, and even copies most of the vfuncs to allow
custom types. If I'm struggling to work out what should be a FuFirmware and
what should be a FuFirmwareImage then a plugin author has no hope.

For simple payloads we were adding bytes into an image and then the image into
a firmware. This gets really messy when most plugins are treating the FuFirmware
*as* the binary firmware file.

The GBytes saved in the FuFirmware would be considered the payload with the
aim of not using FuFirmwareImage in the single-image case.
2021-03-09 21:14:12 +00:00
Mario Limonciello
2994338c63 trivial: thunderbolt: set the version for Titan Ridge devices in FW 2021-03-03 07:32:35 +00:00
Richard Hughes
54bc512388 Add firmware flags for presence of CRC and VID/PID 2021-02-11 20:27:20 +00:00
Richard Hughes
5c915eef1e Check the return values of g_return_val_if_fail() in CI 2021-01-12 20:31:47 +00:00
Mario Limonciello
a61cca9e3d thunderbolt: Add maple ridge firmware parsing support
These are expected to be flashed via UEFI capsules *not* Thunderbolt plugin
* Flashing via fwupd will require matching kernel work.
* They're left here only for parsing the binaries

```
FuThunderboltFirmwareUpdate:
Family:                 Maple Ridge
IsHost:                 true
IsNative:               true
DeviceId:               0x1136
VendorId:               0xd4
ModelId:                0xa58
FlashSize:              0x0
Generation:             0x4
Ports:                  0x2
HasPd:                  true
Section0:               0x4000
Section1:               0x4210
Section2:               0x4610
Section3:               0x22958
  FuFirmwareImage:
  Data:                 0x67000
```
2020-12-10 09:59:58 -06:00
Mario Limonciello
94874cd067 thunderbolt: Add a new subclassed thunderbolt firmware update type
Thunderbolt images brought in from the SPI don't have a FARB header.
Thunderbolt update images do.

So these two types of images need to be handled separately from the
firmware parser.
2020-05-06 11:13:51 -05:00
Mario Limonciello
ec44dd3353 Modernize the thunderbolt plugin.
Remove it's references to it's own GUdevclient and instead use
FuUdevDevice.

Some intentional casualties of the move:
* Plugin metadata around native and safe mode dropped.
  - These haven't been useful in debugging anything and aren't relevant
    on new hardware
* Extra GUID for 2 host controllers in same system dropped
  - Although this was normally static information BIOS operations like
    turning off PCI-E SD card reader or LAN controller changed things.
* The NVM version is parsed directly instead of through gudev to prevent
  cached data breaking change events.

Remaining TODO:
* Force power w/ thunderbolt-power doesn't work
2020-04-29 13:15:45 -05:00