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>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/63377
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
This commit is contained in:
Arthur Heymans 2022-04-05 20:42:07 +02:00
parent 31187bb0e0
commit e8217b11f1
3 changed files with 9 additions and 1 deletions

View File

@ -1327,6 +1327,12 @@ config BOOTBLOCK_CUSTOM
# src/lib/bootblock.c#main() C entry point. # src/lib/bootblock.c#main() C entry point.
bool bool
config BOOTBLOCK_IN_CBFS
bool
default y if ARCH_X86
help
Select this on platforms that have a top aligned bootblock inside cbfs.
config MEMLAYOUT_LD_FILE config MEMLAYOUT_LD_FILE
string string
default "src/mainboard/\$(CONFIG_MAINBOARD_DIR)/memlayout.ld" default "src/mainboard/\$(CONFIG_MAINBOARD_DIR)/memlayout.ld"

View File

@ -101,11 +101,13 @@ $(eval $(call early_x86_stage,bootblock,elf64-x86-64))
endif endif
ifneq ($(CONFIG_UPDATE_IMAGE),y) ifneq ($(CONFIG_UPDATE_IMAGE),y)
ifeq ($(CONFIG_BOOTBLOCK_IN_CBFS),y)
$(call add_intermediate, add_bootblock, $(objcbfs)/bootblock.bin) $(call add_intermediate, add_bootblock, $(objcbfs)/bootblock.bin)
@printf " CBFS $(subst $(obj)/,,$(@))\n" @printf " CBFS $(subst $(obj)/,,$(@))\n"
$(CBFSTOOL) $< add -f $(objcbfs)/bootblock.bin -n bootblock -t bootblock $(TXTIBB) -b -$(call file-size,$(objcbfs)/bootblock.bin) \ $(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) $(cbfs-autogen-attributes) $(TS_OPTIONS) $(CBFSTOOL_ADD_CMD_OPTIONS)
endif endif
endif
$(call src-to-obj,bootblock,$(dir)/walkcbfs.S): $(obj)/fmap_config.h $(call src-to-obj,bootblock,$(dir)/walkcbfs.S): $(obj)/fmap_config.h
bootblock-y += walkcbfs.S bootblock-y += walkcbfs.S

View File

@ -5,7 +5,7 @@
#include <fmap_config.h> #include <fmap_config.h>
#include <stdint.h> #include <stdint.h>
#if ENV_X86 #if CONFIG(BOOTBLOCK_IN_CBFS)
__attribute__((used, __section__(".header_pointer"))) __attribute__((used, __section__(".header_pointer")))
#endif #endif