From ac522f1cd7e955bcb7bcd2fe6942d5a09223a509 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Sun, 25 Jul 2021 10:40:53 +0200 Subject: src/vendorcode/eltan: Don't reference CONFIG_CBFS_SIZE This symbol is only used in generating a default fmap. Change-Id: I8d92eba9978cdad5795b0f5755e1d75db7b3cb2d Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/coreboot/+/56592 Tested-by: build bot (Jenkins) Reviewed-by: Frans Hendriks --- src/vendorcode/eltan/security/verified_boot/vboot_check.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/vendorcode/eltan/security') diff --git a/src/vendorcode/eltan/security/verified_boot/vboot_check.c b/src/vendorcode/eltan/security/verified_boot/vboot_check.c index 0de2f0af55..ed20af5076 100644 --- a/src/vendorcode/eltan/security/verified_boot/vboot_check.c +++ b/src/vendorcode/eltan/security/verified_boot/vboot_check.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -177,6 +178,12 @@ static void verified_boot_check_buffer(const char *name, void *start, size_t siz } } +#if FMAP_SECTION_COREBOOT_START < (0xffffffff - CONFIG_ROM_SIZE + 1) +#define COREBOOT_CBFS_START (0xffffffff - CONFIG_ROM_SIZE + 1 + FMAP_SECTION_COREBOOT_START) +#else +#define COREBOOT_CBFS_START FMAP_SECTION_COREBOOT_START +#endif + void verified_boot_check_cbfsfile(const char *name, uint32_t type, uint32_t hash_index, void **buffer, uint32_t *filesize, int32_t pcr) { @@ -189,7 +196,7 @@ void verified_boot_check_cbfsfile(const char *name, uint32_t type, uint32_t hash if (!ENV_ROMSTAGE_OR_BEFORE && (type & VERIFIED_BOOT_COPY_BLOCK)) { if ((buffer) && (*buffer) && (*filesize >= size) && - ((uint32_t) start > (uint32_t)(~(CONFIG_CBFS_SIZE-1)))) { + ((uint32_t) start > COREBOOT_CBFS_START)) { /* Use the buffer passed in if possible */ printk(BIOS_DEBUG, "%s: move buffer to memory\n", __func__); -- cgit v1.2.3