From 9dc29742c59888b0375d3975636e2b12c4a84683 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 28 Feb 2022 12:08:26 -0700 Subject: [PATCH] cbfs: Add some more definititions Add definitions for a payload or 'self', which is like an unpacked ELF file. Signed-off-by: Simon Glass --- include/cbfs.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/include/cbfs.h b/include/cbfs.h index 7449873b49..38efb1d2b0 100644 --- a/include/cbfs.h +++ b/include/cbfs.h @@ -24,6 +24,8 @@ enum cbfs_filetype { CBFS_TYPE_CBFSHEADER = 0x02, CBFS_TYPE_STAGE = 0x10, CBFS_TYPE_PAYLOAD = 0x20, + CBFS_TYPE_SELF = CBFS_TYPE_PAYLOAD, + CBFS_TYPE_FIT = 0x21, CBFS_TYPE_OPTIONROM = 0x30, CBFS_TYPE_BOOTSPLASH = 0x40, @@ -120,6 +122,47 @@ struct cbfs_file_attr_hash { u8 hash_data[]; } __packed; +/*** Component sub-headers ***/ + +/* Following are component sub-headers for the "standard" component types */ + +/** + * struct cbfs_stage - sub-header for stage components + * + * Stages are loaded by coreboot during the normal boot process + */ +struct cbfs_stage { + u32 compression; /** Compression type */ + u64 entry; /** entry point */ + u64 load; /** Where to load in memory */ + u32 len; /** length of data to load */ + u32 memlen; /** total length of object in memory */ +} __packed; + +/** + * struct cbfs_payload_segment - sub-header for payload components + * + * Payloads are loaded by coreboot at the end of the boot process + */ +struct cbfs_payload_segment { + u32 type; + u32 compression; + u32 offset; + u64 load_addr; + u32 len; + u32 mem_len; +} __packed; + +struct cbfs_payload { + struct cbfs_payload_segment segments; +}; + +#define PAYLOAD_SEGMENT_CODE 0x45444F43 +#define PAYLOAD_SEGMENT_DATA 0x41544144 +#define PAYLOAD_SEGMENT_BSS 0x20535342 +#define PAYLOAD_SEGMENT_PARAMS 0x41524150 +#define PAYLOAD_SEGMENT_ENTRY 0x52544E45 + struct cbfs_cachenode { struct cbfs_cachenode *next; void *data;