| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#ifndef __CBFSTOOL_FIT_H |
| 5 |
#define __CBFSTOOL_FIT_H |
| 6 |
|
| 7 |
#include "cbfs_image.h" |
| 8 |
#include "common.h" |
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
enum fit_type { |
| 15 |
FIT_TYPE_HEADER = 0, |
| 16 |
FIT_TYPE_MICROCODE = 1, |
| 17 |
FIT_TYPE_BIOS_ACM = 2, |
| 18 |
FIT_TYPE_PLATFORM_BOOT_POLICY = 4, |
| 19 |
FIT_TYPE_BIOS_STARTUP = 7, |
| 20 |
FIT_TYPE_TPM_POLICY = 8, |
| 21 |
FIT_TYPE_BIOS_POLICY = 9, |
| 22 |
FIT_TYPE_TXT_POLICY = 0xa, |
| 23 |
FIT_TYPE_KEY_MANIFEST = 0xb, |
| 24 |
FIT_TYPE_BOOT_POLICY = 0xc, |
| 25 |
FIT_TYPE_CSE_SECURE_BOOT = 0x10, |
| 26 |
FIT_TYPE_TXTSX_POLICY = 0x2d, |
| 27 |
FIT_TYPE_JMP_DEBUG_POLICY = 0x2f, |
| 28 |
FIT_TYPE_UNUSED = 127, |
| 29 |
}; |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
typedef unsigned (*fit_offset_converter_t)(const struct buffer *region, |
| 38 |
unsigned offset); |
| 39 |
|
| 40 |
struct fit_table; |
| 41 |
|
| 42 |
struct fit_table *fit_get_table(struct buffer *bootblock, |
| 43 |
fit_offset_converter_t offset_fn, |
| 44 |
uint32_t topswap_size); |
| 45 |
int fit_dump(struct fit_table *fit); |
| 46 |
int fit_clear_table(struct fit_table *fit); |
| 47 |
int fit_is_supported_type(const enum fit_type type); |
| 48 |
int fit_add_entry(struct fit_table *fit, |
| 49 |
const uint32_t offset, |
| 50 |
const uint32_t len, |
| 51 |
const enum fit_type type, |
| 52 |
const size_t max_fit_entries); |
| 53 |
int fit_delete_entry(struct fit_table *fit, |
| 54 |
const size_t idx); |
| 55 |
|
| 56 |
int fit_add_microcode_file(struct fit_table *fit, |
| 57 |
struct cbfs_image *image, |
| 58 |
const char *blob_name, |
| 59 |
fit_offset_converter_t offset_helper, |
| 60 |
const size_t max_fit_entries); |
| 61 |
int set_fit_pointer(struct buffer *bootblock, const uint32_t offset, |
| 62 |
fit_offset_converter_t offset_fn, uint32_t topswap_size); |
| 63 |
#endif |