From e02be0e14ab0d53fbe270556e1a7752558014b36 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Mon, 18 Jan 2016 16:24:10 +0100 Subject: build system: allow assigning files to regions Using the regions-for-file function, the build system can now declare which (CBFS formatted) fmap region(s) a file should end up in. The default is to put them in the regular COREBOOT region, but more complex boot schemes (eg. vboot or fallback/normal) can use the function to implement suitable policies. Change-Id: I5e2e6b8e8759fda2cfb0144d5b998ba3e05650c8 Signed-off-by: Patrick Georgi Reviewed-on: https://review.coreboot.org/13039 Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) --- Makefile.inc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Makefile.inc b/Makefile.inc index 3757d99ea7..aab1efbcd2 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -648,6 +648,14 @@ $(objcbfs)/%.elf: $(objcbfs)/%.debug # 4) replace all '*' characters with spaces extract_nth=$(subst *,$(spc),$(patsubst -%-,%,$(word $(1), $(subst |,- -,-$(2)-)))) +# regions-for-file - Returns a cbfstool regions parameter +# $(call regions-for-file,$(filename)) +# returns "REGION1,REGION2,..." +# +# This is the default implementation. When using a boot strategy employing +# multiple CBFSes in fmap regions, override it. +regions-for-file ?= COREBOOT + cbfs-add-cmd = \ printf " CBFS $(call extract_nth,2,$(file))\n"; \ $(CBFSTOOL) $@.tmp \ @@ -656,6 +664,7 @@ cbfs-add-cmd = \ -n $(call extract_nth,2,$(file)) \ $(if $(filter-out stage,$(call extract_nth,3,$(file))),-t $(call extract_nth,3,$(file))) \ $(if $(call extract_nth,4,$(file)),-c $(call extract_nth,4,$(file))) \ + -r $(call regions-for-file,$(call extract_nth,2,$(file))) \ $(call extract_nth,7,$(file)) cbfs-files=$(cbfs-files-fixed) $(cbfs-files-aligned) $(cbfs-files-regular) -- cgit v1.2.3