aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2021-06-12 22:33:25 +0200
committerPatrick Georgi <pgeorgi@google.com>2021-06-17 10:00:45 +0000
commitddbc771524a2a127dd51f711b6d88b13884c2164 (patch)
tree5c6bee6ec9ad6f31679fb1bed87d31339270d305 /src
parent30701763e3886ecdf94b4c6dbadfb8079318f324 (diff)
arch/x86/walkcbfs.S: Fix the cbfs base addr for some fmap
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 <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/55452 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Diffstat (limited to 'src')
-rw-r--r--src/arch/x86/walkcbfs.S8
1 files changed, 7 insertions, 1 deletions
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