0001 .. SPDX-License-Identifier: GPL-2.0-only
0002
0003 ==================================
0004 PLDM Firmware file format overview
0005 ==================================
0006
0007 A PLDM firmware package is a binary file which contains a header that
0008 describes the contents of the firmware package. This includes an initial
0009 package header, one or more firmware records, and one or more components
0010 describing the actual flash contents to program.
0011
0012 This diagram provides an overview of the file format::
0013
0014 overall file layout
0015 +----------------------+
0016 | |
0017 | Package Header |
0018 | |
0019 +----------------------+
0020 | |
0021 | Device Records |
0022 | |
0023 +----------------------+
0024 | |
0025 | Component Info |
0026 | |
0027 +----------------------+
0028 | |
0029 | Package Header CRC |
0030 | |
0031 +----------------------+
0032 | |
0033 | Component Image 1 |
0034 | |
0035 +----------------------+
0036 | |
0037 | Component Image 2 |
0038 | |
0039 +----------------------+
0040 | |
0041 | ... |
0042 | |
0043 +----------------------+
0044 | |
0045 | Component Image N |
0046 | |
0047 +----------------------+
0048
0049 Package Header
0050 ==============
0051
0052 The package header begins with the UUID of the PLDM file format, and
0053 contains information about the version of the format that the file uses. It
0054 also includes the total header size, a release date, the size of the
0055 component bitmap, and an overall package version.
0056
0057 The following diagram provides an overview of the package header::
0058
0059 header layout
0060 +-------------------------+
0061 | PLDM UUID |
0062 +-------------------------+
0063 | Format Revision |
0064 +-------------------------+
0065 | Header Size |
0066 +-------------------------+
0067 | Release Date |
0068 +-------------------------+
0069 | Component Bitmap Length |
0070 +-------------------------+
0071 | Package Version Info |
0072 +-------------------------+
0073
0074 Device Records
0075 ==============
0076
0077 The device firmware records area starts with a count indicating the total
0078 number of records in the file, followed by each record. A single device
0079 record describes what device matches this record. All valid PLDM firmware
0080 files must contain at least one record, but optionally may contain more than
0081 one record if they support multiple devices.
0082
0083 Each record will identify the device it supports via TLVs that describe the
0084 device, such as the PCI device and vendor information. It will also indicate
0085 which set of components that are used by this device. It is possible that
0086 only subset of provided components will be used by a given record. A record
0087 may also optionally contain device-specific package data that will be used
0088 by the device firmware during the update process.
0089
0090 The following diagram provides an overview of the device record area::
0091
0092 area layout
0093 +---------------+
0094 | |
0095 | Record Count |
0096 | |
0097 +---------------+
0098 | |
0099 | Record 1 |
0100 | |
0101 +---------------+
0102 | |
0103 | Record 2 |
0104 | |
0105 +---------------+
0106 | |
0107 | ... |
0108 | |
0109 +---------------+
0110 | |
0111 | Record N |
0112 | |
0113 +---------------+
0114
0115 record layout
0116 +-----------------------+
0117 | Record Length |
0118 +-----------------------+
0119 | Descriptor Count |
0120 +-----------------------+
0121 | Option Flags |
0122 +-----------------------+
0123 | Version Settings |
0124 +-----------------------+
0125 | Package Data Length |
0126 +-----------------------+
0127 | Applicable Components |
0128 +-----------------------+
0129 | Version String |
0130 +-----------------------+
0131 | Descriptor TLVs |
0132 +-----------------------+
0133 | Package Data |
0134 +-----------------------+
0135
0136 Component Info
0137 ==============
0138
0139 The component information area begins with a count of the number of
0140 components. Following this count is a description for each component. The
0141 component information points to the location in the file where the component
0142 data is stored, and includes version data used to identify the version of
0143 the component.
0144
0145 The following diagram provides an overview of the component area::
0146
0147 area layout
0148 +-----------------+
0149 | |
0150 | Component Count |
0151 | |
0152 +-----------------+
0153 | |
0154 | Component 1 |
0155 | |
0156 +-----------------+
0157 | |
0158 | Component 2 |
0159 | |
0160 +-----------------+
0161 | |
0162 | ... |
0163 | |
0164 +-----------------+
0165 | |
0166 | Component N |
0167 | |
0168 +-----------------+
0169
0170 component layout
0171 +------------------------+
0172 | Classification |
0173 +------------------------+
0174 | Component Identifier |
0175 +------------------------+
0176 | Comparison Stamp |
0177 +------------------------+
0178 | Component Options |
0179 +------------------------+
0180 | Activation Method |
0181 +------------------------+
0182 | Location Offset |
0183 +------------------------+
0184 | Component Size |
0185 +------------------------+
0186 | Component Version Info |
0187 +------------------------+
0188 | Package Data |
0189 +------------------------+
0190
0191
0192 Package Header CRC
0193 ==================
0194
0195 Following the component information is a short 4-byte CRC calculated over
0196 the contents of all of the header information.
0197
0198 Component Images
0199 ================
0200
0201 The component images follow the package header information in the PLDM
0202 firmware file. Each of these is simply a binary chunk with its start and
0203 size defined by the matching component structure in the component info area.