commit | f6ef78f676a9bf40d89c011aa686c74cd0553a93 | [log] [tgz] |
---|---|---|
author | Unive Tien <unive.tien.wiwynn@gmail.com> | Thu Jun 12 09:39:38 2025 +0800 |
committer | Andrew Jeffery <andrew@codeconstruct.com.au> | Fri Sep 05 03:24:42 2025 +0000 |
tree | 4936491120733fdac8c13a4f4d286a1134332547 | |
parent | cd02e9d0960917df93276ee461d2f3b839f3bec9 [diff] |
dsp: firmware_update: Stabilized new firmware package parsing ABI Below new APIs will be consumed by openbmc/pldm[1]: - `decode_pldm_firmware_update_package()` - `pldm_package_firmware_device_id_record_iter_init()` - `decode_pldm_package_firmware_device_id_record_from_iter()` - `pldm_package_downstream_device_id_record_iter_init()` - `decode_pldm_package_downstream_device_id_record_from_iter()` - `pldm_package_component_image_information_iter_init()` - `decode_pldm_package_component_image_information_from_iter()` - The newly added APIs uses iterators to parse the firmware update packages, which provide the efficiency and safety benefits than the old ones. - The new APIs support DSP0267 v1.1.0 to v1.3.0, which provides additional fields in the firmware update package. - Since the old APIs will be soon marked as deprecated, this is a good opportunity to stabilize the new APIs. - Build pass and passed google test on CI. - Build pass and tested successfully on Yosemite4. [1]: https://gerrit.openbmc.org/c/openbmc/pldm/+/80194 Change-Id: I44bd1be07b0cb19a7a1044d6b36e26ffbd771285 Signed-off-by: Unive Tien <unive.tien.wiwynn@gmail.com> Signed-off-by: Carter Chen <carter.chen.wiwynn@gmail.com>
This is a library which deals with the encoding and decoding of PLDM messages. It should be possible to use this library by projects other than OpenBMC, and hence certain constraints apply to it:
Source files are named according to the PLDM Type, for eg base.[h/c], fru.[h/c], etc.
Given a PLDM command "foo", the library will provide the following API: For the Requester function:
encode_foo_req() - encode a foo request decode_foo_resp() - decode a response to foo
For the Responder function:
decode_foo_req() - decode a foo request encode_foo_resp() - encode a response to foo
The library also provides API to pack and unpack PLDM headers.
libpldm
is configured and built using meson
. Python's pip
or pipx
can be used to install a recent version on your machine:
pipx install meson
Once meson
is installed:
meson setup build && meson compile -C build
meson test -C build
libpldm
Components of the library ABI[^1] (loosely, functions) are separated into three categories:
[^1]: "library API + compiler ABI = library ABI"
Applications depending on libpldm
should aim to only use functions from the stable category. However, this may not always be possible. What to do when required functions fall into the deprecated or testing categories is discussed in CONTRIBUTING.
libpldm is maintained with the expectation that users move between successive releases when upgrading. This constraint allows the library to reintroduce types and functions of the same name in subsequent releases in the knowledge that there are no remaining users of previous definitions. While strategies are employed to avoid breaking existing APIs unnecessarily, the library is still to reach maturity, and we must allow for improvements to be made in the design.