Debian Codegraph @

src/lib/cbfs_master_header.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #include <endian.h>
4 #include <fmap_config.h>
5 #include <commonlib/bsd/cbfs_serialized.h>
6
7 struct cbfs_header header = {
8 .magic = cpu_to_be32(CBFS_HEADER_MAGIC),
9 .version = cpu_to_be32(CBFS_HEADER_VERSION),
10 /*
11 * The offset and romsize fields within the master header are absolute
12 * values within the boot media. As such, romsize needs to reflect
13 * the end 'offset' for a CBFS. To achieve that the current buffer
14 * representing the CBFS region's size is added to the offset of
15 * the region within a larger image.
16 */
17 .romsize = cpu_to_be32(FMAP_SECTION_COREBOOT_START + FMAP_SECTION_COREBOOT_SIZE),
18 /*
19 * The 4 bytes are left out for two reasons:
20 * 1. the cbfs master header pointer resides there
21 * 2. some cbfs implementations assume that an image that resides
22 * below 4GB has a bootblock and get confused when the end of the
23 * image is at 4GB == 0.
24 */
25 .bootblocksize = cpu_to_be32(4),
26 .align = cpu_to_be32(CBFS_ALIGNMENT),
27 .offset = cpu_to_be32(FMAP_SECTION_COREBOOT_START),
28 .architecture = cpu_to_be32(CBFS_ARCHITECTURE_UNKNOWN),
29 };