aboutsummaryrefslogtreecommitdiff
path: root/Makefile.inc
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@chromium.org>2016-01-18 16:24:10 +0100
committerPatrick Georgi <pgeorgi@google.com>2016-01-21 18:48:23 +0100
commite02be0e14ab0d53fbe270556e1a7752558014b36 (patch)
tree7a70149d9a2b541b6b789c65a81e0018a10867d1 /Makefile.inc
parent9a17d04e40b3f45f348963b8e3154fd3b869697b (diff)
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 <pgeorgi@chromium.org> Reviewed-on: https://review.coreboot.org/13039 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins)
Diffstat (limited to 'Makefile.inc')
-rw-r--r--Makefile.inc9
1 files changed, 9 insertions, 0 deletions
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)