From 2efd8315f20ff1fbdccdc0b6f0af97b4a7512981 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Wed, 18 May 2022 21:37:58 +0200 Subject: [PATCH] lib/Makefile.inc: Add cbfs header pointer on !BOOTBLOCK_IN_CBFS On some x86 targets it the bootblock is loaded via a different mechanism, like via the AMD PSP or Intel IFWI. Some payloads need that pointer so add it to cbfs. Note that on Intel APL this file is not used, which is why the bootblock still needs to contain the pointer in the ARCH_X86 part. It is not worth it to add logic to specifically deal with APL as this is a legacy feature anyway. For AMD non-car platform this fixes cbfs access in SeaBIOS. Change-Id: If46e80e3eed5cc3f59964ac58e507f927fc563c4 Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/coreboot/+/64483 Tested-by: build bot (Jenkins) Reviewed-by: Felix Held --- src/lib/Makefile.inc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc index 57b0c7a122..505dc4684b 100644 --- a/src/lib/Makefile.inc +++ b/src/lib/Makefile.inc @@ -402,9 +402,18 @@ cbfs_master_header-position := 0 ifeq ($(CONFIG_ARCH_X86),y) $(call src-to-obj,bootblock,$(dir)/master_header_pointer.c): $(obj)/fmap_config.h bootblock-y += master_header_pointer.c -else -cbfs-files-y += header_pointer +endif + +NEED_CBFS_POINTER= + +ifneq ($(CONFIG_ARCH_X86),y) +NEED_CBFS_POINTER=y +endif +ifneq ($(CONFIG_BOOTBLOCK_IN_CBFS),y) +NEED_CBFS_POINTER=y +endif + +cbfs-files-$(NEED_CBFS_POINTER) += header_pointer header_pointer-file := master_header_pointer.c:struct header_pointer-position := -4 header_pointer-type := "cbfs header" -endif