Attention is currently required from: Martin Roth. Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/56122 )
Change subject: Makefile.inc: Add the x86 bootblock as a regular cbfs file ......................................................................
Makefile.inc: Add the x86 bootblock as a regular cbfs file
Files of type bootblock are now always top aligned. This assumes only x86 ever uses cbfs file type bootblock.
As the cbfs header needs to be at a specific place and it can be updated only later on, use a placeholder cbfs file.
Change-Id: I4de9d7fedf1ae5a37a3310dd42eb07b44c030930 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M Makefile.inc M src/arch/x86/Makefile.inc 2 files changed, 27 insertions(+), 11 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/22/56122/1
diff --git a/Makefile.inc b/Makefile.inc index 046f589..7e08a74 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -829,6 +829,7 @@ # CBFSTOOL_ADD_CMD_OPTIONS can be used by arch/SoC/mainboard to supply # add commands with any additional arguments for cbfstool. # Example: --ext-win-base <base> --ext-win-size <size> +# This top aligns files of type bootblock, assuming that only x86 uses those define cbfs-add-cmd-for-region $(CBFSTOOL) $(obj)/coreboot.pre \ add$(if $(filter stage,$(call extract_nth,3,$(1))),-stage)$(if \ @@ -844,6 +845,7 @@ $(if $(call extract_nth,6,$(1)),-a $(call extract_nth,6,$(file)), \ $(if $(call extract_nth,5,$(file)),-b $(call extract_nth,5,$(file)))) \ $(call extract_nth,7,$(1)) \ + $(if $(filter bootblock,$(call extract_nth,3,$(1))),-b -$(call file-size, $(call extract_nth,1,$(1)))) \ $(CBFSTOOL_ADD_CMD_OPTIONS)
endef @@ -1123,23 +1125,13 @@
ifneq ($(CONFIG_UPDATE_IMAGE),y) +# on X86 bootblock is added as a cbfsfile ifneq ($(CONFIG_ARCH_X86),y) $(call add_intermediate, add_bootblock, $(objcbfs)/bootblock.bin) printf " FMAP BOOTBLOCK adding bootblock\n" $(CBFSTOOL) $< write -u \ -r BOOTBLOCK \ -f $(objcbfs)/bootblock.bin -else -$(call add_intermediate, add_bootblock, $(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) - $(CBFSTOOL) $< add-master-header $(TS_OPTIONS) $(CBFSTOOL_ADD_CMD_OPTIONS) endif # ARCH_X86 endif # UPDATE_IMAGE
diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc index 3949e3a..ab8f18c 100644 --- a/src/arch/x86/Makefile.inc +++ b/src/arch/x86/Makefile.inc @@ -85,6 +85,30 @@ bootblock-y += id.S bootblock-$(CONFIG_HAVE_CF9_RESET) += cf9_reset.c
+ifneq ($(CONFIG_UPDATE_IMAGE),y) +# Add a placeholder cbfs file that will be updated later on to hold +# the legacy cbfs master header. +$(obj)/placeholder: + dd if=/dev/zero of=$@ bs=32 count=1 + +cbfs-files-y += cbfs_master_header +cbfs_master_header-file := $(obj)/placeholder +cbfs_master_header-position := 0 +cbfs_master_header-type := "cbfs header" + +$(call add_intermediate, update_master_header, add_prebuild_files) + printf " CBFS Updating master header\n" + rm -f $(obj)/placeholder + $(CBFSTOOL) $< remove -n cbfs_master_header + $(CBFSTOOL) $< add-master-header $(TS_OPTIONS) $(CBFSTOOL_ADD_CMD_OPTIONS) + +endif + +cbfs-files-y += bootblock +bootblock-file := $(objcbfs)/bootblock.bin +bootblock-type := bootblock +bootblock-options := $(TS_OPTIONS) $(TXTIBB) + $(call src-to-obj,bootblock,$(dir)/id.S): $(obj)/build.h
ifeq ($(CONFIG_ARCH_BOOTBLOCK_X86_32),y)