From 90ca3b6bd7d7849898fe2363a9e6d0e002c95943 Mon Sep 17 00:00:00 2001 From: David Hendricks Date: Fri, 16 Nov 2012 14:48:22 -0800 Subject: Add multi-architecture support to cbfstool This is an initial re-factoring of CBFS code to enable multiple architectures. To achieve a clean solution, an additional field describing the architecture has to be added to the master header. Hence we also increase the version number in the master header. Change-Id: Icda681673221f8c27efbc46f16c2c5682b16a265 Signed-off-by: Stefan Reinauer Signed-off-by: Hung-Te Lin Signed-off-by: David Hendricks Reviewed-on: http://review.coreboot.org/1944 Tested-by: build bot (Jenkins) --- documentation/cbfs.txt | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'documentation') diff --git a/documentation/cbfs.txt b/documentation/cbfs.txt index 61f9f794e7..4b266f2d77 100644 --- a/documentation/cbfs.txt +++ b/documentation/cbfs.txt @@ -144,11 +144,15 @@ need to read the pointer and do the appropriate math to locate the header. The following is the structure of the master header: struct cbfs_header { - unsigned int magic; - unsigned int size; - unsigned int align; - unsigned int offset; -}; + u32 magic; + u32 version; + u32 romsize; + u32 bootblocksize; + u32 align; + u32 offset; + u32 architecture; + u32 pad[1]; +} __attribute__((packed)); The meaning of each member is as follows: @@ -156,9 +160,14 @@ The meaning of each member is as follows: magic number is 0x4F524243, which is 'ORBC' in ASCII. -'size' is the size of the ROM in bytes. Coreboot will subtract 'size' from +'version' is a version number for CBFS header. cbfs_header structure may be +different if version is not matched. + +'romsize' is the size of the ROM in bytes. Coreboot will subtract 'size' from 0xFFFFFFFF to locate the beginning of the ROM in memory. +'bootblocksize' is the size of bootblock reserved in firmware image. + 'align' is the number of bytes that each component is aligned to within the ROM. This is used to make sure that each component is aligned correctly with @@ -169,6 +178,9 @@ component at runtime without disturbing the others. the ROM). This is to allow for arbitrary space to be left at the beginning of the ROM for things like embedded controller firmware. +'architecture' describes which architecture (x86, arm, ...) this CBFS is created +for. + = Bootblock = The bootblock is a mandatory component in the ROM. It is located in the last -- cgit v1.2.3