summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZheng Bao <fishbaozi@gmail.com>2023-02-11 16:27:16 +0800
committerFelix Held <felix-coreboot@felixheld.de>2023-09-01 11:48:02 +0000
commit69cef8e6942ab62abc02062522f62cc1bb337f55 (patch)
tree39791555ab3cd69e382ca9eda098d878681fb38c
parent6bc06983ed1d6c545056b584eabc2f7864cb39cd (diff)
amd/soc/common: Use relative offset for AMDFW
The amdfw.rom is mostly in region COREBOOT. Calculate the relative address as the CBFS module address. That is for future 32M flash size support. TEST=binary identical test on amd/birman amd/majolica amd/gardenia amd/mayan amd/bilby amd/mandolin amd/chausie amd/pademelon pcengines/apu2 google/skyrim google/guybrush google/zork google/kahlee google/myst This commit is part of a series of patches to support 32/64M flash. BUG=b:255374782 Change-Id: I2add8e4e6755e582b3be6a150cf83d1468f2f1be Signed-off-by: Zheng Bao <fishbaozi@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/72961 Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com> Reviewed-by: Felix Held <felix-coreboot@felixheld.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--src/soc/amd/common/Makefile.inc12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/soc/amd/common/Makefile.inc b/src/soc/amd/common/Makefile.inc
index e3883059f7..78ab4ff9bb 100644
--- a/src/soc/amd/common/Makefile.inc
+++ b/src/soc/amd/common/Makefile.inc
@@ -41,13 +41,19 @@ DEP_FILES = $(patsubst %,$(FIRMWARE_LOCATION)/%, $(AMDFW_CFG_IN_FW_LOC)) \
amd_microcode_bins += $(wildcard ${FIRMWARE_LOCATION}/*UcodePatch_*.bin)
ifeq ($(CONFIG_RESET_VECTOR_IN_RAM),y)
-$(objcbfs)/bootblock.bin: $(obj)/amdfw.rom
+$(objcbfs)/bootblock.bin: $(obj)/amdfw.rom $(obj)/fmap_config.h
cp $< $@
+amdfw_region_start=$(subst $(spc),,FMAP_SECTION_$(call regions-for-file,apu/amdfw)_START)
+amdfw_offset=$(call int-subtract, \
+ $(CONFIG_AMD_FWM_POSITION) \
+ $(call int-subtract, \
+ $(call get_fmap_value,$(amdfw_region_start)) \
+ $(call get_fmap_value,FMAP_SECTION_FLASH_START)))
+
add_bootblock = \
$(CBFSTOOL) $(1) add -f $(2) -n apu/amdfw -t amdfw \
- -b $(call int-add, \
- $(call int-subtract, 0xffffffff $(CONFIG_ROM_SIZE)) 1 $(CONFIG_AMD_FWM_POSITION))
+ -b $(amdfw_offset) -r $(call regions-for-file,apu/amdfw)
endif # ifeq ($(CONFIG_RESET_VECTOR_IN_RAM),y)