Firmware update for auxiliary components
Richard Hughes
hughsient at gmail.com
Tue Jan 11 19:55:12 AEDT 2022
On Tue, 11 Jan 2022 at 01:31, Derek Mantey <derekma at microsoft.com> wrote:
> I tried to pull the changes in but ran into some build issues.
Ohh? If you share them I might be able to help. I know fwpud is quite
aggressive with some of it's deps, but they should be all up to date
in oe-meta.
> could you tell me a little more about the interfaces that the fwupd uses?
No problem; but I suspect the answer is "all of them" :)
> Is it searching the device tree for devices that it can update? Is it searching the busses directly? Or is there a way to give hints for devices to update?
It does all of those things. In general, a "plugin" in fwupd just knows how to:
* enumerate (discover) the device, e.g. looking at the ESRT, looking
at files in /sys, using udev to find a device, or claiming an
interface on a USB device
* Install a blob of firmware on that device node
* (optionally) switch the device into, and out-of bootloader mode
There's quite a lot more, but it's all basically optional -- there's a
little tutorial available here:
https://fwupd.github.io/libfwupdplugin/tutorial.html
In reality, the best way to see how it all works is to look at the
code, for instance,
https://github.com/fwupd/fwupd/blob/main/plugins/nvme/fu-nvme-device.c
is <500 lines on how to properly enumerate and update a NVMe drive.
> For example, we have a CPLD on our board (see the Open Compute DC-SCM spec). We don't currently have that listed in our device tree as it is just sitting on a generic SPI bus.
The best way is to make it discoverable, as you don't need to add a
quirk file for each of the system boards that you want to support,
e.g. put it in an ACPI table or DT somewhere. If that's not possible,
you can add a "quirk" to fwupd to say "for this hardware do this",
e.g. https://github.com/fwupd/fwupd/blob/main/plugins/superio/superio.quirk#L55
although this isn't awesome as you have to update fwupd every time you
have a new board to support. Ideally you could ask an embedded
controller somewhere "what CPLDs are connected" and get back all the
data you need.
Richard
More information about the openbmc
mailing list