Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33275
Change subject: [WIP]Makefile.inc: Simplify generating the default fmap ......................................................................
[WIP]Makefile.inc: Simplify generating the default fmap
Apparently you don't always need to specify base/size as fmap tool fills in the gaps, so make use of that to remove some ugly Makefile arithmetics.
Change-Id: Ib138249140fc87307c3dc76692f343587117c7e0 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M Makefile.inc M util/cbfstool/default-x86.fmd 2 files changed, 7 insertions(+), 16 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/75/33275/1
diff --git a/Makefile.inc b/Makefile.inc index d4f7597..13cb6ed 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -865,10 +865,9 @@ # X86 CONSOLE FMAP region # # position, size and entry line of CONSOLE relative to BIOS_BASE, if enabled -FMAP_CONSOLE_BASE := 0 ifeq ($(CONFIG_CONSOLE_SPI_FLASH),y) FMAP_CONSOLE_SIZE := $(CONFIG_CONSOLE_SPI_FLASH_BUFFER_SIZE) -FMAP_CONSOLE_ENTRY := CONSOLE@$(FMAP_CONSOLE_BASE) $(FMAP_CONSOLE_SIZE) +FMAP_CONSOLE_ENTRY := CONSOLE $(FMAP_CONSOLE_SIZE) else # ifeq ($(CONFIG_CONSOLE_SPI_FLASH),y) FMAP_CONSOLE_SIZE := 0 FMAP_CONSOLE_ENTRY := @@ -879,12 +878,9 @@ # # position, size and entry line of MRC_CACHE relative to BIOS_BASE, if enabled ifeq ($(CONFIG_CACHE_MRC_SETTINGS),y) -FMAP_MRC_CACHE_BASE := $(call int-align, $(call int-add, $(FMAP_CONSOLE_BASE) \ - $(FMAP_CONSOLE_SIZE)), 0x10000) FMAP_MRC_CACHE_SIZE := $(CONFIG_MRC_SETTINGS_CACHE_SIZE) -FMAP_MRC_CACHE_ENTRY := RW_MRC_CACHE@$(FMAP_MRC_CACHE_BASE) $(FMAP_MRC_CACHE_SIZE) +FMAP_MRC_CACHE_ENTRY := RW_MRC_CACHE $(FMAP_MRC_CACHE_SIZE) else # ifeq ($(CONFIG_CACHE_MRC_SETTINGS),y) -FMAP_MRC_CACHE_BASE := 0 FMAP_MRC_CACHE_SIZE := 0 FMAP_MRC_CACHE_ENTRY := endif # ifeq ($(CONFIG_CACHE_MRC_SETTINGS),y) @@ -894,12 +890,9 @@ # # position, size and entry line of SMMSTORE relative to BIOS_BASE, if enabled ifeq ($(CONFIG_SMMSTORE),y) -FMAP_SMMSTORE_BASE := $(call int-align, $(call int-add, $(FMAP_CONSOLE_BASE) \ - $(FMAP_CONSOLE_SIZE) $(FMAP_MRC_CACHE_SIZE)), 0x10000) FMAP_SMMSTORE_SIZE := $(CONFIG_SMMSTORE_SIZE) -FMAP_SMMSTORE_ENTRY := SMMSTORE@$(FMAP_SMMSTORE_BASE) $(FMAP_SMMSTORE_SIZE) +FMAP_SMMSTORE_ENTRY := SMMSTORE $(FMAP_SMMSTORE_SIZE) else # ifeq ($(CONFIG_SMMSTORE),y) -FMAP_SMMSTORE_BASE := 0 FMAP_SMMSTORE_SIZE := 0 FMAP_SMMSTORE_ENTRY := endif # ifeq ($(CONFIG_CACHE_MRC_SETTINGS),y) @@ -909,16 +902,14 @@ # # # position, size -FMAP_FMAP_BASE := $(call int-add, $(FMAP_CONSOLE_BASE) $(FMAP_CONSOLE_SIZE) \ - $(FMAP_MRC_CACHE_SIZE) $(FMAP_SMMSTORE_SIZE)) FMAP_FMAP_SIZE := 0x200
# # X86 COREBOOT default cbfs FMAP region # # position and size of CBFS, relative to BIOS_BASE -FMAP_CBFS_BASE := $(call int-add, $(FMAP_FMAP_BASE) $(FMAP_FMAP_SIZE)) -FMAP_CBFS_SIZE := $(call int-subtract, $(FMAP_BIOS_SIZE) $(FMAP_CBFS_BASE)) +FMAP_CBFS_SIZE := $(shell echo $($(FMAP_BIOS_SIZE) - $(FMAP_FMAP_SIZE) \ + - $(FMAP_CONSOLE_SIZE) - $(FMAP_MRC_CACHE_SIZE) - $(FMAP_SMMSTORE_SIZE))) else # ifeq ($(CONFIG_ARCH_X86),y) DEFAULT_FLASHMAP:=$(top)/util/cbfstool/default.fmd # entire flash diff --git a/util/cbfstool/default-x86.fmd b/util/cbfstool/default-x86.fmd index f0143e9..1d1fec9 100644 --- a/util/cbfstool/default-x86.fmd +++ b/util/cbfstool/default-x86.fmd @@ -12,7 +12,7 @@ ##CONSOLE_ENTRY## ##MRC_CACHE_ENTRY## ##SMMSTORE_ENTRY## - FMAP@##FMAP_BASE## ##FMAP_SIZE## - COREBOOT(CBFS)@##CBFS_BASE## ##CBFS_SIZE## + FMAP ##FMAP_SIZE## + COREBOOT(CBFS) ##CBFS_SIZE## } }