From f975e55dcdbeb31e39449d22a9c04ff861dae8dd Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Fri, 19 Aug 2016 15:43:06 -0700 Subject: cbfs: Add "struct" file type and associated helpers This patch adds functionality to compile a C data structure into a raw binary file, add it to CBFS and allow coreboot to load it at runtime. This is useful in all cases where we need to be able to have several larger data sets available in an image, but will only require a small subset of them at boot (a classic example would be DRAM parameters) or only require it in certain boot modes. This allows us to load less data from flash and increase boot speed compared to solutions that compile all data sets into a stage. Each structure has to be defined in a separate .c file which contains no functions and only a single global variable. The data type must be serialization safe (composed of only fixed-width types, paying attention to padding). It must be added to CBFS in a Makefile with the 'struct' file processor. Change-Id: Iab65c0b6ebea235089f741eaa8098743e54d6ccc Signed-off-by: Julius Werner Reviewed-on: https://review.coreboot.org/16272 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- util/cbfstool/cbfs.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'util') diff --git a/util/cbfstool/cbfs.h b/util/cbfstool/cbfs.h index 36b9fc0f87..f1ae09d97a 100644 --- a/util/cbfstool/cbfs.h +++ b/util/cbfstool/cbfs.h @@ -186,6 +186,7 @@ struct cbfs_payload { #define CBFS_COMPONENT_MRC 0x61 #define CBFS_COMPONENT_MMA 0x62 #define CBFS_COMPONENT_EFI 0x63 +#define CBFS_COMPONENT_STRUCT 0x70 #define CBFS_COMPONENT_CMOS_DEFAULT 0xaa #define CBFS_COMPONENT_SPD 0xab #define CBFS_COMPONENT_MRC_CACHE 0xac @@ -227,6 +228,7 @@ static struct typedesc_t filetypes[] unused = { {CBFS_COMPONENT_MRC_CACHE, "mrc_cache"}, {CBFS_COMPONENT_MMA, "mma"}, {CBFS_COMPONENT_EFI, "efi"}, + {CBFS_COMPONENT_STRUCT, "struct"}, {CBFS_COMPONENT_DELETED, "deleted"}, {CBFS_COMPONENT_NULL, "null"} }; -- cgit v1.2.3