From 69cef8e6942ab62abc02062522f62cc1bb337f55 Mon Sep 17 00:00:00 2001 From: Zheng Bao Date: Sat, 11 Feb 2023 16:27:16 +0800 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/72961 Reviewed-by: Fred Reitberger Reviewed-by: Felix Held Tested-by: build bot (Jenkins) --- src/soc/amd/common/Makefile.inc | 12 +++++++++--- 1 file 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) -- cgit v1.2.3