Stefan Reinauer | 543a682 | 2013-02-04 15:39:13 -0800 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2013 Google, Inc. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
Stefan Reinauer | 543a682 | 2013-02-04 15:39:13 -0800 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | #define FV_SIGNATURE 0x4856465f |
| 17 | typedef struct { |
| 18 | uint8_t padding[16]; |
| 19 | uint8_t guid[16]; |
| 20 | uint64_t fv_length; |
| 21 | uint32_t signature; |
| 22 | uint32_t attributes; |
| 23 | uint16_t header_length; |
| 24 | uint16_t checksum; |
| 25 | uint16_t ext_header_offs; |
| 26 | uint8_t reserved; |
| 27 | uint8_t revision; |
| 28 | /* not used here: block map entries */ |
| 29 | } firmware_volume_header_t; |
| 30 | |
| 31 | #define FILETYPE_SEC 0x03 |
Patrick Georgi | 4610247 | 2013-02-09 13:26:19 +0100 | [diff] [blame] | 32 | #define FILETYPE_PAD 0xf0 |
Stefan Reinauer | 543a682 | 2013-02-04 15:39:13 -0800 | [diff] [blame] | 33 | typedef struct { |
| 34 | uint8_t name[16]; |
| 35 | uint16_t integrity; |
| 36 | uint8_t file_type; |
| 37 | uint8_t attributes; |
| 38 | uint8_t size[3]; |
| 39 | uint8_t state; |
| 40 | } ffs_file_header_t; |
| 41 | |
| 42 | #define SECTION_PE32 0x10 |
Patrick Georgi | 4610247 | 2013-02-09 13:26:19 +0100 | [diff] [blame] | 43 | #define SECTION_RAW 0x19 |
Stefan Reinauer | 543a682 | 2013-02-04 15:39:13 -0800 | [diff] [blame] | 44 | typedef struct { |
| 45 | uint8_t size[3]; |
| 46 | uint8_t section_type; |
| 47 | } common_section_header_t; |