Documentation/driver-api/pldmfw/index.rst
.. SPDX-License-Identifier: GPL-2.0-only
pldmfw implements functionality for updating the flash on a device using
the PLDM for Firmware Update standard
https://www.dmtf.org/documents/pmci/pldm-firmware-update-specification-100.
.. toctree:: :maxdepth: 1
file-format driver-ops
pldmfw libraryThe pldmfw library is intended to be used by device drivers for
implementing device flash update based on firmware files following the PLDM
firmware file format.
It is implemented using an ops table that allows device drivers to provide the underlying device specific functionality.
pldmfw implements logic to parse the packed binary format of the PLDM
firmware file into data structures, and then uses the provided function
operations to determine if the firmware file is a match for the device. If
so, it sends the record and component data to the firmware using the device
specific implementations provided by device drivers. Once the device
firmware indicates that the update may be performed, the firmware data is
sent to the device for programming.
The PLDM file format uses packed binary data, with most multi-byte fields stored in the Little Endian format. Several pieces of data are variable length, including version strings and the number of records and components. Due to this, it is not straight forward to index the record, record descriptors, or components.
To avoid proliferating access to the packed binary data, the pldmfw
library parses and extracts this data into simpler structures for ease of
access.
In order to safely process the firmware file, care is taken to avoid unaligned access of multi-byte fields, and to properly convert from Little Endian to CPU host format. Additionally the records, descriptors, and components are stored in linked lists.
To perform a flash update, the pldmfw module performs the following
steps