Arthur Heymans | 75226bb | 2022-03-30 20:16:36 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <commonlib/bsd/cbfs_serialized.h> |
| 4 | #include <endian.h> |
| 5 | #include <fmap_config.h> |
| 6 | #include <stdint.h> |
| 7 | |
Arthur Heymans | e8217b1 | 2022-04-05 20:42:07 +0200 | [diff] [blame] | 8 | #if CONFIG(BOOTBLOCK_IN_CBFS) |
Arthur Heymans | 75226bb | 2022-03-30 20:16:36 +0200 | [diff] [blame] | 9 | __attribute__((used, __section__(".header_pointer"))) |
| 10 | #endif |
| 11 | |
| 12 | #if FMAP_SECTION_COREBOOT_START < (0xffffffff - CONFIG_ROM_SIZE + 1) |
| 13 | #define COREBOOT_CBFS_START (0xffffffff - CONFIG_ROM_SIZE + 1 + FMAP_SECTION_COREBOOT_START) |
| 14 | #else |
| 15 | #define COREBOOT_CBFS_START FMAP_SECTION_COREBOOT_START |
| 16 | #endif |
| 17 | |
| 18 | uint32_t header_pointer = |
| 19 | cpu_to_le32(COREBOOT_CBFS_START + ALIGN_UP(sizeof(struct cbfs_file) |
| 20 | + sizeof("cbfs_master_header"), |
| 21 | CBFS_ATTRIBUTE_ALIGN)); |