Patrick Georgi | 7333a11 | 2020-05-08 20:48:04 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Stefan Reinauer | 543a682 | 2013-02-04 15:39:13 -0800 | [diff] [blame] | 2 | |
| 3 | #define FV_SIGNATURE 0x4856465f |
| 4 | typedef struct { |
| 5 | uint8_t padding[16]; |
| 6 | uint8_t guid[16]; |
| 7 | uint64_t fv_length; |
| 8 | uint32_t signature; |
| 9 | uint32_t attributes; |
| 10 | uint16_t header_length; |
| 11 | uint16_t checksum; |
| 12 | uint16_t ext_header_offs; |
| 13 | uint8_t reserved; |
| 14 | uint8_t revision; |
| 15 | /* not used here: block map entries */ |
| 16 | } firmware_volume_header_t; |
| 17 | |
| 18 | #define FILETYPE_SEC 0x03 |
Patrick Georgi | 4610247 | 2013-02-09 13:26:19 +0100 | [diff] [blame] | 19 | #define FILETYPE_PAD 0xf0 |
Stefan Reinauer | 543a682 | 2013-02-04 15:39:13 -0800 | [diff] [blame] | 20 | typedef struct { |
| 21 | uint8_t name[16]; |
| 22 | uint16_t integrity; |
| 23 | uint8_t file_type; |
| 24 | uint8_t attributes; |
| 25 | uint8_t size[3]; |
| 26 | uint8_t state; |
| 27 | } ffs_file_header_t; |
| 28 | |
| 29 | #define SECTION_PE32 0x10 |
Patrick Georgi | 4610247 | 2013-02-09 13:26:19 +0100 | [diff] [blame] | 30 | #define SECTION_RAW 0x19 |
Stefan Reinauer | 543a682 | 2013-02-04 15:39:13 -0800 | [diff] [blame] | 31 | typedef struct { |
| 32 | uint8_t size[3]; |
| 33 | uint8_t section_type; |
| 34 | } common_section_header_t; |
Dun Tan | 4a35940 | 2021-09-01 10:29:41 +0800 | [diff] [blame] | 35 | |
| 36 | typedef struct { |
| 37 | uint8_t guid[16]; |
| 38 | uint32_t ext_header_size; |
| 39 | } firmware_volume_ext_header_t; |