file-format.rst 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. .. SPDX-License-Identifier: GPL-2.0-only
  2. ==================================
  3. PLDM Firmware file format overview
  4. ==================================
  5. A PLDM firmware package is a binary file which contains a header that
  6. describes the contents of the firmware package. This includes an initial
  7. package header, one or more firmware records, and one or more components
  8. describing the actual flash contents to program.
  9. This diagram provides an overview of the file format::
  10. overall file layout
  11. +----------------------+
  12. | |
  13. | Package Header |
  14. | |
  15. +----------------------+
  16. | |
  17. | Device Records |
  18. | |
  19. +----------------------+
  20. | |
  21. | Component Info |
  22. | |
  23. +----------------------+
  24. | |
  25. | Package Header CRC |
  26. | |
  27. +----------------------+
  28. | |
  29. | Component Image 1 |
  30. | |
  31. +----------------------+
  32. | |
  33. | Component Image 2 |
  34. | |
  35. +----------------------+
  36. | |
  37. | ... |
  38. | |
  39. +----------------------+
  40. | |
  41. | Component Image N |
  42. | |
  43. +----------------------+
  44. Package Header
  45. ==============
  46. The package header begins with the UUID of the PLDM file format, and
  47. contains information about the version of the format that the file uses. It
  48. also includes the total header size, a release date, the size of the
  49. component bitmap, and an overall package version.
  50. The following diagram provides an overview of the package header::
  51. header layout
  52. +-------------------------+
  53. | PLDM UUID |
  54. +-------------------------+
  55. | Format Revision |
  56. +-------------------------+
  57. | Header Size |
  58. +-------------------------+
  59. | Release Date |
  60. +-------------------------+
  61. | Component Bitmap Length |
  62. +-------------------------+
  63. | Package Version Info |
  64. +-------------------------+
  65. Device Records
  66. ==============
  67. The device firmware records area starts with a count indicating the total
  68. number of records in the file, followed by each record. A single device
  69. record describes what device matches this record. All valid PLDM firmware
  70. files must contain at least one record, but optionally may contain more than
  71. one record if they support multiple devices.
  72. Each record will identify the device it supports via TLVs that describe the
  73. device, such as the PCI device and vendor information. It will also indicate
  74. which set of components that are used by this device. It is possible that
  75. only subset of provided components will be used by a given record. A record
  76. may also optionally contain device-specific package data that will be used
  77. by the device firmware during the update process.
  78. The following diagram provides an overview of the device record area::
  79. area layout
  80. +---------------+
  81. | |
  82. | Record Count |
  83. | |
  84. +---------------+
  85. | |
  86. | Record 1 |
  87. | |
  88. +---------------+
  89. | |
  90. | Record 2 |
  91. | |
  92. +---------------+
  93. | |
  94. | ... |
  95. | |
  96. +---------------+
  97. | |
  98. | Record N |
  99. | |
  100. +---------------+
  101. record layout
  102. +-----------------------+
  103. | Record Length |
  104. +-----------------------+
  105. | Descriptor Count |
  106. +-----------------------+
  107. | Option Flags |
  108. +-----------------------+
  109. | Version Settings |
  110. +-----------------------+
  111. | Package Data Length |
  112. +-----------------------+
  113. | Applicable Components |
  114. +-----------------------+
  115. | Version String |
  116. +-----------------------+
  117. | Descriptor TLVs |
  118. +-----------------------+
  119. | Package Data |
  120. +-----------------------+
  121. Component Info
  122. ==============
  123. The component information area begins with a count of the number of
  124. components. Following this count is a description for each component. The
  125. component information points to the location in the file where the component
  126. data is stored, and includes version data used to identify the version of
  127. the component.
  128. The following diagram provides an overview of the component area::
  129. area layout
  130. +-----------------+
  131. | |
  132. | Component Count |
  133. | |
  134. +-----------------+
  135. | |
  136. | Component 1 |
  137. | |
  138. +-----------------+
  139. | |
  140. | Component 2 |
  141. | |
  142. +-----------------+
  143. | |
  144. | ... |
  145. | |
  146. +-----------------+
  147. | |
  148. | Component N |
  149. | |
  150. +-----------------+
  151. component layout
  152. +------------------------+
  153. | Classification |
  154. +------------------------+
  155. | Component Identifier |
  156. +------------------------+
  157. | Comparison Stamp |
  158. +------------------------+
  159. | Component Options |
  160. +------------------------+
  161. | Activation Method |
  162. +------------------------+
  163. | Location Offset |
  164. +------------------------+
  165. | Component Size |
  166. +------------------------+
  167. | Component Version Info |
  168. +------------------------+
  169. | Package Data |
  170. +------------------------+
  171. Package Header CRC
  172. ==================
  173. Following the component information is a short 4-byte CRC calculated over
  174. the contents of all of the header information.
  175. Component Images
  176. ================
  177. The component images follow the package header information in the PLDM
  178. firmware file. Each of these is simply a binary chunk with its start and
  179. size defined by the matching component structure in the component info area.