Attention is currently required from: Zheng Bao.
Hello Zheng Bao,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/69922
to review the following change.
Change subject: WIP:mb/amd/birman: Split the amdfw.rom into head and body ......................................................................
WIP:mb/amd/birman: Split the amdfw.rom into head and body
Change-Id: I9d61d707c8292f7d89db5fccc26e860ff76e7374 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/mainboard/amd/birman/board.fmd M src/soc/amd/morgana/Makefile.inc 2 files changed, 43 insertions(+), 11 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/22/69922/1
diff --git a/src/mainboard/amd/birman/board.fmd b/src/mainboard/amd/birman/board.fmd index 6c6ad92..21a86c0 100644 --- a/src/mainboard/amd/birman/board.fmd +++ b/src/mainboard/amd/birman/board.fmd @@ -1,8 +1,9 @@ -FLASH@0xFF000000 16M { +FLASH@0xFE000000 32M { BIOS { EC 4K + AMDFW(CBFS) @131008 + FMAP @16M 3K RW_MRC_CACHE 120K - FMAP 4K - COREBOOT(CBFS) + COREBOOT(CBFS) @17M } } diff --git a/src/soc/amd/morgana/Makefile.inc b/src/soc/amd/morgana/Makefile.inc index a88e1a5..bbf8cf2 100644 --- a/src/soc/amd/morgana/Makefile.inc +++ b/src/soc/amd/morgana/Makefile.inc @@ -66,13 +66,16 @@ # | | PSPDIR ADDR | BIOSDIR ADDR | # +-----------+---------------+----------------+
-$(if $(CONFIG_AMD_FWM_POSITION_INDEX), ,\ - $(error Invalid AMD firmware position index. Check if the board sets a valid ROM size)) +MORGANA_FWM_POSITION_REL=$(call _toint, 0x20000) +MORGANA_FWM_POSITION_BODY=$(call _toint, 0x1000)
-MORGANA_FWM_POSITION=$(call int-add, \ - $(call int-subtract, 0xffffffff \ - $(call int-shift-left, \ - 0x80000 $(CONFIG_AMD_FWM_POSITION_INDEX))) 0x20000 1) +AMDFW_REGION_POSITION=$(call int-subtract, \ + $(shell awk '$$2 == "FMAP_SECTION_AMDFW_START" {print $$3}' $(obj)/fmap_config.h) \ + $(shell awk '$$2 == "FMAP_SECTION_FLASH_START" {print $$3}' $(obj)/fmap_config.h)) + +COREBOOT_REGION_POSITION=$(call int-subtract, \ + $(shell awk '$$2 == "FMAP_SECTION_COREBOOT_START" {print $$3}' $(obj)/fmap_config.h) \ + $(shell awk '$$2 == "FMAP_SECTION_FLASH_START" {print $$3}' $(obj)/fmap_config.h))
# 0x40 accounts for the cbfs_file struct + filename + metadata structs, aligned to 64 bytes # Building the cbfs image will fail if the offset isn't large enough @@ -259,8 +262,10 @@ $(OPT_VERSTAGE_FILE) \ $(OPT_VERSTAGE_SIG_FILE) \ $(OPT_SPL_TABLE_FILE) \ - --location $(shell printf "%#x" $(MORGANA_FWM_POSITION)) \ - --output $@ + --location $(shell printf "%#x" $(MORGANA_FWM_POSITION_REL)) \ + --body-location $(shell printf "%#x" $(call int-add, $(COREBOOT_REGION_POSITION) $(MORGANA_FWM_POSITION_BODY))) \ + --output $@ \ + --body-output "build/body.rom"
$(PSP_BIOSBIN_FILE): $(PSP_ELF_FILE) $(AMDCOMPRESS) rm -f $@ @@ -282,6 +287,12 @@ --anywhere \ --output $@
+regions-for-file = $(subst $(spc),$(comma),$(sort \ + $(if $(value regions-for-file-$(1)), \ + $(regions-for-file-$(1)), \ + ,COREBOOT,\ + ))) + $(obj)/amdfw_b.rom: $(obj)/amdfw.rom rm -f $@ @printf " AMDFWTOOL $(subst $(obj)/,,$(@))\n" @@ -296,6 +307,16 @@ --anywhere \ --output $@
+regions-for-file-apu/amdfw=AMDFW +cbfs-files-y += apu/amdfw +apu/amdfw-file := $(obj)/amdfw.rom +apu/amdfw-position := $(call int-subtract, $(MORGANA_FWM_POSITION_REL) $(AMDFW_REGION_POSITION)) +apu/amdfw-type := raw + +cbfs-files-y += apu/amdfwbody +apu/amdfwbody-file := $(obj)/body.rom +apu/amdfwbody-position := $(MORGANA_FWM_POSITION_BODY) +apu/amdfwbody-type := raw
ifeq ($(CONFIG_VBOOT_SLOTS_RW_AB)$(CONFIG_VBOOT_STARTS_BEFORE_BOOTBLOCK),yy) cbfs-files-y += apu/amdfw_a