Commit Graph

1693 Commits

Author SHA1 Message Date
Benson Leung
852c6685ff cros-ec: Set protocol for cros-ec-usb-device
Specify "com.google.usb.crosec" to indicate support for Google's
USB endpoint updater protocol.
2020-07-09 07:44:19 +01:00
Benson Leung
8ed9f5f0a1 cros-ec: Write firmware to usb target
Write the firmware to the usb device, first finding which section to
write to, then breaking into blocks (based on maximum pdu size),
and then into chunks, which are transferred to the device using bulk transfers.
2020-07-09 07:44:19 +01:00
Benson Leung
4ed2400cab cros-ec: Store image_idx in section
Makes it a bit easier to retrieve the image later.
2020-07-09 07:44:19 +01:00
Benson Leung
9326e19118 cros-ec: Give cros-ec-firmware a get_sections
Add a getter for the sections.
2020-07-09 07:44:19 +01:00
Benson Leung
d0cd862acf cros-ec: Add fu_cros_ec_firmware_pick_sections
Add this to allow the usb-device to mark which section of the firmware
image is writeable by setting the section's ustatus to FU_CROS_EC_FW_NEEDED.
2020-07-09 07:44:19 +01:00
Benson Leung
befd9a420e cros-ec: Convert cros-ec-firmware's sections to GPtrArray 2020-07-09 07:44:19 +01:00
Benson Leung
6472742bea cros-ec: Add prepare firmware
Prepare firmware by parsing it, which will be of fu_cros_ec_firmware type.
2020-07-09 07:44:19 +01:00
Benson Leung
a989975812 cros-ec: Update documentation to reflect fmap
The file format was added last time around, so update cros-ec's
documentation to reflect that fwupd now supports fmap format
blobs.
2020-07-09 07:44:19 +01:00
Ryan Lee
ef7b7b0efd ccgx: modify installation time for hp g2 dock 2020-07-07 13:00:02 +01:00
Mario Limonciello
c90eca4787 thunderbolt: add support for retimers 2020-07-03 12:56:44 -05:00
Richard Hughes
a852254d92 trivial: Hide the UEFI DBX parsing by default 2020-07-03 12:32:06 +01:00
Ryan Lee
62618bedb6 ccgx: add extra 45% removal time for worst case 2020-07-03 10:18:57 +01:00
Richard Hughes
6269a839eb Add a security attribute for BootGuard
This information is obtained from the MEI configuration space.
2020-07-02 20:25:48 +01:00
Richard Hughes
81a12a1b17 pci-mei: Split out the HFSTS registers
The register specifications have been taken as a superset of the coreboot
documentation as different flags were documented in more detail on various
different platforms.

Having this new data allows us to add future tests and make the current tests
much easier to understand.
2020-07-02 20:25:48 +01:00
Reto Kromer
2b0a329cf1 fix alignment (in the code) 2020-07-01 21:11:17 +01:00
Richard Hughes
1de98dcd72 mei: Add extra metadata to the security attributes 2020-07-01 20:10:39 +01:00
Richard Hughes
2adeb7688a mei: Store the family in the plugin data 2020-07-01 20:10:39 +01:00
Mario Limonciello
b1cf96abe1 trivial: acpi-dmar: lower missing DMAR table to debug
If the system is missing a DMAR table, users can find out from
`fwupdtool/fwupdmgr security`.  No need to actually warn in the logs
every single time.
2020-07-01 13:42:28 -05:00
Richard Hughes
d09cf101c3 Change all instances of master/slave to initiator/target
This makes perfect sense, because the 'initiator' starts the transaction and
the 'target' is the addressee of the transaction. Even the I²C spec defines the
'master' as 'initiating' the transaction.

This is the same nomenclature now used by the Glasgow project too.
2020-07-01 15:44:30 +01:00
Ryan Lee
7ebcd06ae4 ccgx: remove verify flag in plugin 2020-07-01 14:14:10 +01:00
Mario Limonciello
6a6029f132 uefi: disable plugin if efivar is not supported
Don't even try to coldplug the device.

Fixes: #2237
2020-06-30 13:55:33 -05:00
Richard Hughes
85226fd9d1 Remove potentially problematic language
Red Hat wants to drive an initiative in correcting problematic and potentially
divisive language in open source projects. These naming conventions and
descriptive phrases are hurtful and offensive to many of our colleagues across
the open source universe.

See https://www.redhat.com/en/blog/making-open-source-more-inclusive-eradicating-problematic-language
2020-06-30 17:31:17 +01:00
Richard Hughes
d9f3bec6d0 trivial: Fix GtkDoc issue with FuFmapFirmware 2020-06-29 15:49:14 +01:00
Ryan Lee
609d0c570f ccgx: Add more hybrid dock support
Also add HPI command retry.
2020-06-25 18:30:30 +01:00
Mario Limonciello
28d51c036b trivial: tpm-eventlog: stop showing messages about secure boot
This was an overloaded use of UpdateMessage that didn't make sense.
It doesn't affect the functionality of updating, just the security.

Hints about why the TPM PCR0 reconstruction failed should go
to the wiki page not the device.
2020-06-25 11:17:47 -05:00
Mario Limonciello
b563840753 Move PCR0 reconstruction error into security command
Now that this infrastructure is built, it's a more useful location
to put the security output.
2020-06-25 11:17:47 -05:00
Mario Limonciello
4669dd590a trivial: uefi: drop secure boot check at coldplug
We'll instead check this when the user tries to run an update.  This
allows them to sign a bootloader after the daemon starts (or remove
a signed bootloader after starting)

Fixes: #2219
2020-06-24 08:18:48 -05:00
Mario Limonciello
58d6d329e8 trivial: thunderbolt: don't set update error for missing nvmem
Trying to explain why ICL thunderbolt isn't updatable doesn't help
people.  It just causes fwupdmgr and fwupdtool to show the device
front and center with a confusing message.

Instead don't populate the message and by the default device filter
it will be hidden.

See #2212 for background.
2020-06-24 06:31:58 +01:00
Mario Limonciello
bdc589884a modem-manager: add support for compiling libqmi-glib 1.26.0 and later 2020-06-23 15:21:09 -05:00
Mario Limonciello
bfd57c6ee1 trivial: modem-manager: chomp vendor string
Reading the sysfs file seemed to have also eaten the `\n` as mentioned
on a bug.

```
├DW5821e Snapdragon X20 LTE:
│     Device ID:           fa707b9af86ff44bc17316b6c3e5ea82aab3ce86
│     Summary:             Mobile broadband device
│     Current version:     T77W968.F1.0.0.4.2.GC.010
│     Vendor:              Dell Inc. (USB:0x413c
│     )
│     GUIDs:               64da2d58-8d1b-5e5b-b793-f88ba5a25a8f
│                          761d6124-0002-5185-b767-9adf67bf1a5e
│                          795e079d-093b-5503-aa59-35b832480e95
│     Device Flags:        • Updatable
```
2020-06-23 14:12:08 -05:00
Mario Limonciello
f7d83a2f45 trivial: modem-manager: fix a logic error 2020-06-23 08:44:21 -05:00
Mario Limonciello
752dc715ea Revert "trivial: add Vendor ID into Modem manager devices"
This reverts commit 5521e47511.
2020-06-23 07:57:22 +01:00
Mario Limonciello
50638657cc modem-manager: read the vendor ID directly from sysfs attribute
Fixes: #2209
2020-06-23 07:57:22 +01:00
Mario Limonciello
e2a77fc10b trivial: modem-manager: add a protocol for updating the devices 2020-06-23 07:57:22 +01:00
Mario Limonciello
834b28009d Add support for a delayed activation flow for Thunderbolt
This allows delaying the activation of Thunderbolt firmware until
shutdown/reboot or when the dock is unplugged.

This functionality requires features in the kernel:
https://lore.kernel.org/linux-usb/20200622143035.25327-1-mario.limonciello@dell.com/T/#t

Matrix of cases to support:

* Distro Old Linux kernel (doesn't support authenticate on disconnect)

  - WD19TB: Should have `skips-restart` flag set
    No flush or activate features called in `thunderbolt` plugin.
    `dell_dock` plugin will activate at end of composite update

  - All other devices: Shouldn't have flags set
    Should authenticate in Thunderbolt plugin.
    `1 > nvm_authenticate`

* Distro New Linux kernel (supports authenticate on disconnect)

  - WD19TB: Should have `usable-during-update` flag set but not `skips-restart`
    Should flush image to SPI in `thunderbolt` plugin
    `2 > nvm_authenticate_on_disconnect`
    Should configure TBT device for authenticate on disconnect
    `1 > nvm_authenticate_on_disconnect`
    `dell_dock` plugin will configure dock for authenticate on disconnect

  - All other devices: Shouldn't have flags set
    Should authenticate in `thunderbolt` plugin.
    `1 > nvm_authenticate`

* ChromeOS (supports authenticate on disconnect)

  - `thunerbolt.conf` will have `DelayedActivation=true`.

  - WD19TB: Should have `usable-during-update` flag set but not `skips-restart`
    Should flush image to SPI in `thunderbolt` plugin
    `2 > nvm_authenticate_on_disconnect`
    Should configure device for authenticate on disconnect
    `1 > nvm_authenticate_on_disconnect`
    `dell_dock` plugin will configure dock for authenticate on disconnect

  - All other devices: Should have both `usable-during-update` and `skips-restart` set
    Should flush image to SPI in `thunderbolt` plugin
    `2 > nvm_authenticate`
    Will activate upon logout/shutdown/reboot
    `1 > nvm_authenticate`
2020-06-22 16:09:10 -05:00
Mario Limonciello
5521e47511 trivial: add Vendor ID into Modem manager devices
Fixes: #2200
2020-06-22 15:57:10 -05:00
Richard Hughes
b1ae0dcbbc logind: Fix trivial memory leak at startup
The g_dbus_proxy_get_name_owner() function is (return full).
2020-06-22 15:55:02 +01:00
Richard Hughes
b0426f8a24 tpm-eventlog: Fix memory leak when reading file
The file contents were literally just read four lines above.
2020-06-22 15:55:02 +01:00
Ryan Lee
4c177ad540 ccgx: add new protocol for dmc dock 2020-06-22 12:57:43 +01:00
Mario Limonciello
91e27e145a Add a new plugin for legacy BIOS
This plugin is only enabled when coreboot isn't detected.
It intentionally does not check for EFI to be disabled at startup
since it can also notify the user that UEFI capsule updates are
disabled on the system even if running in UEFI mode.
2020-06-22 11:22:18 +01:00
Richard Hughes
5a831fa7ab vli: Set the i2c instance IDs in probe()
They do not need to query the device, so ->setup() is not required.
2020-06-22 10:42:05 +01:00
Benson Leung
53fad4cd6c trivial: cros-ec: Use fu-memcpy-safe 2020-06-20 07:24:32 +01:00
Benson Leung
3a02ad5129 cros-ec: Add cros-ec-firmware
cros-ec firmware are in fmap layout, and have two sections
that this plugin will look for, the EC_RO, and EC_RW sections.

Tested using a servo_micro firmware:
$ fwupdtool firmware-parse servo_micro_v2.4.17-df61092c3.bin
<select fmap option>
FuCrosEcFirmware:
Version:                 2.4.17
  FuFirmwareImage:
  ID:                    EC_RO
  Index:                 0x1
  Version:               servo_micro_v2.4.17-df61092c3
  Data:                  0xf000
  FuFirmwareImage:
  ID:                    FR_MAIN
  Index:                 0x2
  Data:                  0xf000
  FuFirmwareImage:
  ID:                    RO_FRID
  Index:                 0x3
  Address:               0xc4
  Data:                  0x20
  FuFirmwareImage:
  ID:                    FMAP
  Index:                 0x4
  Address:               0x9a40
  Version:               1.0
  Data:                  0x15e
  FuFirmwareImage:
  ID:                    WP_RO
  Index:                 0x5
  Data:                  0x10000
  FuFirmwareImage:
  ID:                    EC_RW
  Index:                 0x6
  Address:               0x10000
  Version:               servo_micro_v2.4.17-df61092c3
  Data:                  0x10000
  FuFirmwareImage:
  ID:                    RW_FWID
  Index:                 0x7
  Address:               0x100c4
  Data:                  0x20
2020-06-20 07:24:32 +01:00
Richard Hughes
0164141f9b trivial: Fix incorrect comment text 2020-06-19 10:59:16 +01:00
Richard Hughes
e5a4d52ea1 trivial: Spelling fixes from codespell 2020-06-18 20:49:12 +01:00
Mario Limonciello
7d5f6b0232 dell-dock: Add more module types to the enum
Unfortunately module type has more than I previously realized.
The meanings that previously were applied fortunately worked for
the most important case (130-180W TBT) but didn't for single C, dual
C or small power (45W) cases.

Since composite_prepare was trying to read and interpret these, it
causes failures when these other ones are encountered.

I reproduced this on a 130W adapter plugged into a single C (type 0x4).
This meant the update wouldn't install since NULL was returned for the
type.

In case a new module ID is added later, also return an "unknown" for
the metadata.
2020-06-17 17:10:05 -05:00
Mario Limonciello
f412227415 trivial: don't show reconstruction errors if uefi device is missing
The system must support UEFI capsule updates in order to measure
this. (Fixes: #2181)
2020-06-17 15:01:34 -05:00
Mario Limonciello
28bcecc028 trivial: fwupdtpmevlog: make clearer which algorithm is used 2020-06-17 15:01:34 -05:00
Mario Limonciello
9122999bfb tpm-eventlog: verify all algorithms, not just one of them
This will help to suss out any problems that are specific to sha1
or sha256 eventlog calculation.
2020-06-17 15:01:34 -05:00
Mario Limonciello
fe862a1d1b tpm-eventlog: Always look at all supported algorithms
This will effectively mean that both sha1 and sha256 results are
sent back to uefi plugin for analysis.
2020-06-17 15:01:34 -05:00