Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/63377 )
Change subject: Kconfig: Add an option to skip adding a cbfs bootblock on x86 ......................................................................
Kconfig: Add an option to skip adding a cbfs bootblock on x86
Some targets don't need this as the bootblock is loaded differently.
Change-Id: Ia42448f7e9dd0635c72857fbc1fab54508932721 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/Kconfig M src/arch/x86/Makefile.inc M src/lib/Makefile.inc M src/lib/master_header_pointer.c 4 files changed, 10 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/77/63377/1
diff --git a/src/Kconfig b/src/Kconfig index d57ce90..eb1cac5 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -1327,6 +1327,12 @@ # src/lib/bootblock.c#main() C entry point. bool
+config TOP_ALIGNED_CBFS_BOOTBLOCK + bool + default y if ARCH_X86 + help + Select this on platforms that have a top aligned bootblock inside cbfs. + config MEMLAYOUT_LD_FILE string default "src/mainboard/$(CONFIG_MAINBOARD_DIR)/memlayout.ld" diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc index a56b5f1..9c360ec 100644 --- a/src/arch/x86/Makefile.inc +++ b/src/arch/x86/Makefile.inc @@ -101,12 +101,14 @@ endif
ifneq ($(CONFIG_UPDATE_IMAGE),y) +ifeq ($(CONFIG_TOP_ALIGNED_CBFS_BOOTBLOCK),y) $(call add_intermediate, add_bootblock, $(objcbfs)/bootblock.bin) @printf " CBFS $(subst $(obj)/,,$(@))\n" -$(CBFSTOOL) $< remove -n bootblock 2>/dev/null $(CBFSTOOL) $< add -f $(objcbfs)/bootblock.bin -n bootblock -t bootblock $(TXTIBB) -b -$(call file-size,$(objcbfs)/bootblock.bin) \ $(cbfs-autogen-attributes) $(TS_OPTIONS) $(CBFSTOOL_ADD_CMD_OPTIONS) endif +endif
$(call src-to-obj,bootblock,$(dir)/walkcbfs.S): $(obj)/fmap_config.h bootblock-y += walkcbfs.S diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc index e94b874..71a9d93 100644 --- a/src/lib/Makefile.inc +++ b/src/lib/Makefile.inc @@ -399,7 +399,7 @@ cbfs_master_header-type := "cbfs header" cbfs_master_header-position := 0
-ifneq ($(CONFIG_ARCH_X86),y) +ifneq ($(CONFIG_TOP_ALIGNED_CBFS_BOOTBLOCK),y) cbfs-files-y += header_pointer header_pointer-file := master_header_pointer.c:struct header_pointer-position := -4 diff --git a/src/lib/master_header_pointer.c b/src/lib/master_header_pointer.c index 7656e2e..c5a1163 100644 --- a/src/lib/master_header_pointer.c +++ b/src/lib/master_header_pointer.c @@ -4,7 +4,7 @@ #include <fmap_config.h> #include <stdint.h>
-#if ENV_X86 +#if CONFIG(TOP_ALIGNED_CBFS_BOOTBLOCK) #define ATTRIBUTES __attribute__((used, __section__(".header_pointer"))) #else #define ATTRIBUTES