From ddbc771524a2a127dd51f711b6d88b13884c2164 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Sat, 12 Jun 2021 22:33:25 +0200 Subject: arch/x86/walkcbfs.S: Fix the cbfs base addr for some fmap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Defining the memory mapped base in fmap for example "FLASH@0xff800000 0x80000" for a 8M flash is optional in fmap files. This will also reflect in the generated fmap_config.h. Fix the assembly cbfs walker walkcbfs.S for fmap lacking a definition of the flash base. Change-Id: I96b18f675e625abee503648ffdc6031978a4269a Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/coreboot/+/55452 Tested-by: build bot (Jenkins) Reviewed-by: Michał Żygowski --- src/arch/x86/walkcbfs.S | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/arch/x86/walkcbfs.S b/src/arch/x86/walkcbfs.S index 4608e2c12a..208a1281b2 100644 --- a/src/arch/x86/walkcbfs.S +++ b/src/arch/x86/walkcbfs.S @@ -13,6 +13,12 @@ #define CBFS_FILE_STRUCTSIZE (CBFS_FILE_OFFSET + 4) +#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 + .code32 .section .init .global walkcbfs_asm @@ -26,7 +32,7 @@ walkcbfs_asm: cld - movl $FMAP_SECTION_COREBOOT_START, %ebx + movl $COREBOOT_CBFS_START, %ebx /* determine filename length */ mov $0, %eax -- cgit v1.2.3