Linux 5.19 Adding Ability To Initiate Firmware Updates Using Sysfs
In addition to driver-core-next having queued up the long-awaited Zstd compressed firmware support ahead of the Linux 5.19 kernel, another change readied is allowing support for initiating firmware updates for supported drivers via sysfs.
Thanks to Intel there is firmware-upload support being added to sysfs that user-space software can use for initiating a firmware update.
For supported devices/drivers under /sys/class/firmware/ will now be data, loading, and timeout files for being able to trigger firmware updates on the particular device.
The way this works from user-space is simply writing a "1" to the "loading" file, the contents of your firmware binary can be then cat'ed/written to the "data" file, and then upon completion write "0" to the "loading" file. After that the firmware upload to the device proceeds using the existing kernel functions/hooks.
More details within this patch currently in Greg Kroah-Hartman's driver-core "next" branch ahead of the Linux 5.19 merge window.
Intel engineers worked on this firmware-upload sysfs interface with the motivation being for their FPGA-based PCIe cards for triggering firmware updates from user-space after boot. However, other drivers can also make use of this plumbing too if desiring such dynamic firmware uploading/updates via sysfs instead of writing it to the Linux firmware directly (e.g. /lib/firmware) and the triggering any update/reload mechanism.
Thanks to Intel there is firmware-upload support being added to sysfs that user-space software can use for initiating a firmware update.
For supported devices/drivers under /sys/class/firmware/ will now be data, loading, and timeout files for being able to trigger firmware updates on the particular device.
The way this works from user-space is simply writing a "1" to the "loading" file, the contents of your firmware binary can be then cat'ed/written to the "data" file, and then upon completion write "0" to the "loading" file. After that the firmware upload to the device proceeds using the existing kernel functions/hooks.
More details within this patch currently in Greg Kroah-Hartman's driver-core "next" branch ahead of the Linux 5.19 merge window.
Intel engineers worked on this firmware-upload sysfs interface with the motivation being for their FPGA-based PCIe cards for triggering firmware updates from user-space after boot. However, other drivers can also make use of this plumbing too if desiring such dynamic firmware uploading/updates via sysfs instead of writing it to the Linux firmware directly (e.g. /lib/firmware) and the triggering any update/reload mechanism.
5 Comments