summaryrefslogtreecommitdiffstats
path: root/Makefile.inc
diff options
context:
space:
mode:
authorMaximilian Brune <maximilian.brune@9elements.com>2023-03-05 20:55:32 +0100
committerLean Sheng Tan <sheng.tan@9elements.com>2023-03-28 13:27:50 +0000
commit347596ae6ee5ec50526f5dbf9300c183e1d48cd0 (patch)
tree8faa7f63f2202e5d9af92a370d9e222115e9b634 /Makefile.inc
parenta3391e5f7a0d9d26c71092aaeab13d2fe5a133c6 (diff)
downloadcoreboot-347596ae6ee5ec50526f5dbf9300c183e1d48cd0.tar.gz
coreboot-347596ae6ee5ec50526f5dbf9300c183e1d48cd0.tar.bz2
coreboot-347596ae6ee5ec50526f5dbf9300c183e1d48cd0.zip
util/ifdtool: Add option to create FMAP template
On systems that do not provide their own *.fmd (Flashmap) file, we fall back to a default flashmap file. That file however does not contain the blobs (ME, GBE ...), that are usually placed below the BIOS Flashmap. It can therefore easily happen that the placement of the blobs collides with the placement of the BIOS region (e.g. if CBFS_SIZE is big enough). The fmaptool can't catch that, since it does not know of the blobs placement. This patch basically maps the regions described in the IFD (Intel Firmware Descriptor) to the default Flashmap. Test: Build and see that build/fmap.fmd contains all blobs now (on intel systems that are supported by the ifdtool) Signed-off-by: Maximilian Brune <maximilian.brune@9elements.com> Change-Id: I82cb252fff456773af69943e188480a4998736fd Reviewed-on: https://review.coreboot.org/c/coreboot/+/73487 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
Diffstat (limited to 'Makefile.inc')
-rw-r--r--Makefile.inc15
1 files changed, 13 insertions, 2 deletions
diff --git a/Makefile.inc b/Makefile.inc
index ba4f6fad1ec2..d2d3f8860713 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -934,11 +934,22 @@ prebuild-files = $(foreach region,$(all-regions), \
$(call sort-files,$(call placed-files-in-region,$(region))), \
$(call cbfs-add-cmd,$(file),$(region),$(CONFIG_UPDATE_IMAGE))))
+# If no FMD file (Flashmap) is supplied by mainboard, fall back to a default
ifeq ($(CONFIG_FMDFILE),)
-# For a description of the flash layout described by these variables, check
-# the $(DEFAULT_FLASHMAP) .fmd files.
+
ifeq ($(CONFIG_ARCH_X86),y)
+
DEFAULT_FLASHMAP:=$(top)/util/cbfstool/default-x86.fmd
+# check if IFD_CHIPSET is set and if yes generate a FMAP template from IFD descriptor
+ifneq ($(CONFIG_IFD_CHIPSET),)
+ifeq ($(CONFIG_HAVE_IFD_BIN),y)
+DEFAULT_FLASHMAP:=$(obj)/fmap-template.fmd
+$(DEFAULT_FLASHMAP): $(call strip_quotes,$(CONFIG_IFD_BIN_PATH)) $(IFDTOOL)
+ echo " IFDTOOL -p $(CONFIG_IFD_CHIPSET) -F $@ $<"
+ $(IFDTOOL) -p $(CONFIG_IFD_CHIPSET) -F $@ $<
+endif # ifeq($(CONFIG_HAVE_IFD_BIN),y)
+endif # ifneq($(CONFIG_IFD_CHIPSET),)
+
# entire flash
FMAP_ROM_ADDR := $(call int-subtract, 0x100000000 $(CONFIG_ROM_SIZE))
FMAP_ROM_SIZE := $(CONFIG_ROM_SIZE)