75226bb879
The makefiles don't like cbfs file names with spaces in them so update the file name with '_' instead of spaces. To keep the master header at the top of cbfs, add a placeholder. This removes the need to handle the cbfs master header in cbfstool. This functionality will be dropped in a later CL. On x86 reserve some space in the linker script to add the pointer. On non-x86 generate a pointer inside a C struct file. As a bonus this would actually fix the master header pointer mechanism on Intel/APL as only the bootblock inside IFWI gets memory mapped. TESTED on thinkpad X201: SeaBIOS correctly finds the cbfs master header. Change-Id: I3ba01be7da1f09a8cac287751497c18cda97d293 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/59132 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Raul Rangel <rrangel@chromium.org>
30 lines
1.2 KiB
C
30 lines
1.2 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
#include <endian.h>
|
|
#include <fmap_config.h>
|
|
#include <commonlib/bsd/cbfs_serialized.h>
|
|
|
|
struct cbfs_header header = {
|
|
.magic = cpu_to_be32(CBFS_HEADER_MAGIC),
|
|
.version = cpu_to_be32(CBFS_HEADER_VERSION),
|
|
/*
|
|
* The offset and romsize fields within the master header are absolute
|
|
* values within the boot media. As such, romsize needs to reflect
|
|
* the end 'offset' for a CBFS. To achieve that the current buffer
|
|
* representing the CBFS region's size is added to the offset of
|
|
* the region within a larger image.
|
|
*/
|
|
.romsize = cpu_to_be32(FMAP_SECTION_COREBOOT_START + FMAP_SECTION_COREBOOT_SIZE
|
|
- FMAP_SECTION_FLASH_START),
|
|
/*
|
|
* The 4 bytes are left out for two reasons:
|
|
* 1. the cbfs master header pointer resides there
|
|
* 2. some cbfs implementations assume that an image that resides
|
|
* below 4GB has a bootblock and get confused when the end of the
|
|
* image is at 4GB == 0.
|
|
*/
|
|
.bootblocksize = cpu_to_be32(4),
|
|
.align = cpu_to_be32(CBFS_ALIGNMENT),
|
|
.offset = cpu_to_be32(FMAP_SECTION_COREBOOT_START - FMAP_SECTION_FLASH_START),
|
|
.architecture = cpu_to_be32(CBFS_ARCHITECTURE_UNKNOWN),
|
|
};
|