Commit Graph

43 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
Richard Hughes
f1dbd42934 superio: Fix a buffer overread when using --verbose
Spotted by Coverity
2021-07-10 13:51:28 +01:00
Richard Hughes
772f116104 superio: Hide more debugging output by default 2021-07-10 13:51:28 +01:00
Richard Hughes
d4bd5cca5a Standardize some of the device summary text
This is supposed to be 'Sentence case' with no trailing fullstop.
2021-07-09 07:07:07 +01:00
Sergii Dmytruk
d8a5c7968d Add support for SuperIO IT5570
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2021-06-25 19:54:47 +01:00
Richard Hughes
6e3ad475a1 superio: Rename some variables with some new knowledge 2021-06-25 19:54:47 +01:00
Richard Hughes
79a217a2a6 superio: Use DeviceInstanceIDs to merge chip quirk metadata
This means we can use the standard ->set_quirk_kv() vfunc rather than using
FuQuirks directly with a custom group.
2021-03-03 08:30:34 +00:00
Richard Hughes
b3f9841924 Support more than one protocol for a given device
Devices may want to support more than one protocol, and for some devices
(e.g. Unifying peripherals stuck in bootloader mode) you might not even be able
to query for the correct protocol anyway.
2021-03-01 16:14:36 +00:00
Richard Hughes
b13e8dae36 superio: Simplify device setup using the parent_class 2021-02-26 18:46:51 +00:00
Richard Hughes
2e1245728f Call the superclass directly from subclassed devices
This allows a device subclass to call the parent method after doing an initial
action, or even deliberately not call the *generic* parent method at all.

It also simplifies the plugins; you no longer have to remember what the plugin
is deriving from and accidentally clobber the wrong superclass method.
2021-02-18 16:18:34 +00:00
Richard Hughes
eb4dcefbc6 Make the null-false-returns script also process return type
And fix up the rather disapointing single place we got it wrong...
2021-01-14 14:22:15 +00:00
Richard Hughes
9a07407401 Use the FuUdevDevice ->to_string() output
Print the sysfs path for devices deriving from FuUdevDevice, which also allows
us to use FU_UDEV_DEVICE_DEBUG without monkey-patching the plugins that also
define a device_class->to_string() vfunc.
2020-09-03 16:50:41 +01:00
Richard Hughes
56ac823af9 Set the protocol per-device not per-plugin
Some plugins have devices with more than one protocol. Logically the protocol
belongs to the device, not the plugin, and in the future we could use this to
further check firmware that's about to be deployed.

This is also not exported into libfwupd (yet?) as it's remains a debug-feature
only -- protocols are not actually required for devices to be added.
2019-11-25 18:01:54 +00:00
Richard Hughes
d630b5ee66 superio: Never read from port offset zero
At this point, PM1 IOBAD0 is unset, and thus zero...
2019-11-08 17:51:43 +00:00
Richard Hughes
025fc77d7a superio: Fix regression when coldplugging superio devices
Fixes https://github.com/fwupd/fwupd/issues/1546
2019-11-08 17:51:43 +00:00
Richard Hughes
bf00080d3f Move the file descriptor lifecycle into FuUdevDevice
This also means we can provide common 'safe' versions for plugins to use.
This makes a lot of plugins much simpler and we can delete a lot of code.
2019-10-31 09:21:35 -05:00
Mario Limonciello
8fa0b382fa Add new flags can-verify and can-verify-image
These are used to indicate that the device can verify checksums or
can dump an image for checksumming.
2019-10-14 12:41:09 -05:00
Richard Hughes
6e3e62bee8 Use fu_common_string_append_kv() in subclassed device
Also define the indent level in the the ->to_string vfunc so we can correctly
print client devices in all cases.
2019-08-14 16:48:37 +01:00
Richard Hughes
7afd7cba0d Use FuFirmware as a container for firmware images
In many plugins we've wanted to use ->prepare_firmware() to parse the firmware
ahead of ->detach() and ->write_firmware() but this has the limitation that it
can only return a single blob of data.

For many devices, multiple binary blobs are required from one parsed image,
for instance providing signatures, config and data blobs that have to be pushed
to the device in different way.

This also means we parse the firmware *before* we ask the user to detach.

Break the internal FuDevice API to support these firmware types as they become
more popular.

This also allows us to move the Intel HEX and SREC parsing out of the dfu plugin
as they are used by a few plugins now, and resolving symbols between plugins
isn't exactly awesome.
2019-08-08 13:10:57 +01:00
Richard Hughes
dfa9e11bb2 Allow handling FORCE for devices that subclass FuDevice
Pass FwupdInstallFlags down to the vfunc to allow us to check the flags when
parsing the firmware and updating the device.
2019-05-05 15:29:00 -05:00
Richard Hughes
38b357b131 superio: Add support for writing new e-flash contents 2019-03-23 12:04:18 +00:00
Richard Hughes
4702dfe0a7 superio: Use the chipset ID in the device name 2019-03-23 12:04:18 +00:00
Richard Hughes
763483411d superio: Move the device flush before getting the register map 2019-03-23 12:04:18 +00:00
Richard Hughes
c5ef28ad5e superio: Move all the IT89xx code to a subclassed device object 2019-03-23 12:04:18 +00:00
Richard Hughes
ebedf62b15 superio: Move all the IT85xx code to a subclassed device object 2019-03-23 12:04:18 +00:00
Richard Hughes
ebd55e5d14 superio: Split and export fu_superio_device_ec_writeX() 2019-03-23 12:04:18 +00:00
Richard Hughes
08609f3920 superio: Remove the port from fu_superio_device_ec_read()
It's always going to be PM1_IOBAD0.
2019-03-23 12:04:18 +00:00
Richard Hughes
1fccae68ad superio: Move the register read/write into the FuSuperioDevice object
This will allow us to use them from subclassed objects.
2019-03-23 12:04:18 +00:00
Richard Hughes
140ce926ae superio: Check the IOBAD0 is usable during setup 2019-03-23 12:04:18 +00:00
Richard Hughes
4c9d00c1d5 superio: Use fu_device_set_firmware_size() 2019-03-23 12:04:18 +00:00
Richard Hughes
bb73e6594d superio: Move some constants out to the common header 2019-03-23 12:04:18 +00:00
Richard Hughes
f83639fb77 superio: Use GObject properties in FuSuperioDevice 2019-03-23 12:04:18 +00:00
Richard Hughes
b12d0bfec5 superio: Convert FuSuperioDevice to be derivable
We'll need this for future refactoring.
2019-03-23 12:04:18 +00:00
Richard Hughes
079b7b6f9d superio: Get the chip size from the EC rather than hardcoding
I'm not sure why we can't just use SIO_LDNxx_IDX_CHIPID1, but lets do the same
as the vendor tool in case there is a good reason that I don't know about.
2019-03-15 13:47:57 +00:00
Richard Hughes
19a9fc4e6d superio: Implement detach() and attach()
This gets us closer to actually being able to flash the hardware.
2019-02-14 09:12:26 -06:00
Richard Hughes
5acfc64a78 superio: Correct the names of some constants and improve debugging support 2019-02-14 09:12:26 -06:00
Richard Hughes
8cfbb25c31 trivial: Fix a few 'Sign check of bitwise op' LGTM warnings
Not really a bug, as @crc and @data are both unsigned.
2019-02-12 06:28:51 -06:00
Richard Hughes
65c81921b6 Add fu_device_add_instance_id() and prefer explicit conversion 2019-02-04 15:19:57 +00:00
Richard Hughes
831eb7ef7e superio: Support IT89xx devices
We can switch to LDN 0x11 and read the IO base address for the PM1 legacy port
rather than hardcoding data and command ports.
2019-01-08 12:53:57 +00:00
Richard Hughes
57bf9d9eed superio: Set the physical and logical IDs 2018-09-11 16:02:03 +01:00
Richard Hughes
e39801f00d trivial: Fix some NULL/FALSE confusion 2018-09-04 20:37:17 +01:00
Richard Hughes
1263446b23 trivial: Add a 'setup' vfunc that is used after open()
The setup() is the counterpart to probe(), the difference being the former needs
the device open and the latter does not.

This allows objects that derive from FuDevice, and use FuDeviceLocker to use
open() and close() without worrying about the performance implications of
probing the hardware, i.e. open() now simply opens a file or device.
2018-09-03 19:56:26 -05:00
Richard Hughes
16e85aa8cf superio: Add a new plugin to enumerate EC firmware 2018-08-24 20:37:27 +01:00