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 <reinauer@google.com> Signed-off-by: Hung-Te Lin <hungte@chromium.org> Signed-off-by: David Hendricks <dhendrix@chromium.org> Reviewed-on: http://review.coreboot.org/1944 Tested-by: build bot (Jenkins)
This commit is contained in:
committed by
Stefan Reinauer
parent
11a20b614e
commit
90ca3b6bd7
@@ -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
|
||||
|
Reference in New Issue
Block a user