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/+/85657?usp=email
to review the following change.
Change subject: soc/amd/common: Add partition B for bootblock B ......................................................................
soc/amd/common: Add partition B for bootblock B
Change-Id: I12e956f36b5a22eecd1fd207c346a928c170c16e Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/common/Makefile.mk M src/soc/amd/common/block/psp/Makefile.mk 2 files changed, 45 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/57/85657/1
diff --git a/src/soc/amd/common/Makefile.mk b/src/soc/amd/common/Makefile.mk index 626260f..dcdeb71 100644 --- a/src/soc/amd/common/Makefile.mk +++ b/src/soc/amd/common/Makefile.mk @@ -40,22 +40,49 @@
amd_microcode_bins += $(wildcard ${FIRMWARE_LOCATION}/*U?odePatch*.bin)
+AB_RECOVERY=$(CONFIG_PSP_AB_RECOVERY) +ifeq ($(AB_RECOVERY),y) +BOOTBLOCK_SOURCE=$(obj)/amdfw.rom.ra +BOOTBLOCK_SOURCE_B=$(obj)/amdfw.rom.rb +else +BOOTBLOCK_SOURCE=$(obj)/amdfw.rom +endif + ifeq ($(CONFIG_RESET_VECTOR_IN_RAM),y) -$(objcbfs)/bootblock.bin: $(obj)/amdfw.rom $(obj)/fmap_config.h +$(objcbfs)/bootblock.bin: $(BOOTBLOCK_SOURCE) $(obj)/fmap_config.h cp $< $@
amdfw_region_start=$(subst $(spc),,FMAP_SECTION_$(call regions-for-file,apu/amdfw)_START) +ifeq ($(AB_RECOVERY),y) +amdfw_offset=4096 +$(call add_intermediate, add_amdfw, $(obj)/amdfw.rom) + printf " DD Adding AMD Firmware at ROM offset 0x%x\n" \ + "$(CONFIG_AMD_FWM_POSITION)" + $(CBFSTOOL) $(obj)/coreboot.pre write -r EFS -f $(obj)/amdfw.rom --fill-upward + +$(obj)/amdfw.rom.rb: $(obj)/amdfw.rom +$(obj)/amdfw.rom.ra: $(obj)/amdfw.rom + +else 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))) +endif
-add_bootblock = \ - $(CBFSTOOL) $(1) add -f $(2) -n apu/amdfw -t amdfw \ - -b $(amdfw_offset) -r $(call regions-for-file,apu/amdfw) \ - $(CBFSTOOL_ADD_CMD_OPTIONS) - +add_bootblock= \ + for region in $(subst $(comma),$(spc),$(call regions-for-file,apu/amdfw)); do \ + if [ $$region = COREBOOT ]; then \ + $(CBFSTOOL) $(1) add -f $(2) -n apu/amdfw -t amdfw \ + -b $(amdfw_offset) -r $$region \ + $(CBFSTOOL_ADD_CMD_OPTIONS) ; \ + elif [ $$region = COREBOOTB ]; then \ + $(CBFSTOOL) $(1) add -f $(obj)/amdfw.rom.rb -n apu/amdfw -t amdfw \ + -b $(amdfw_offset) -r $$region \ + $(CBFSTOOL_ADD_CMD_OPTIONS) ; \ + fi ; \ + done endif # ifeq ($(CONFIG_RESET_VECTOR_IN_RAM),y)
ifeq ($(CONFIG_VBOOT_GSCVD),y) diff --git a/src/soc/amd/common/block/psp/Makefile.mk b/src/soc/amd/common/block/psp/Makefile.mk index f90f94b..150d406 100644 --- a/src/soc/amd/common/block/psp/Makefile.mk +++ b/src/soc/amd/common/block/psp/Makefile.mk @@ -39,3 +39,15 @@ ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_PSP_SPL) += spl_fuse.c
endif # CONFIG_SOC_AMD_COMMON_BLOCK_PSP_GEN2 + +regions-for-file += $(if $(filter \ + %/romstage \ + %/ramstage \ + %/dsdt.aml \ + %/payload \ + fspm%.bin \ + fsps%.bin \ + cpu_microcode%.bin \ + pci%.rom \ + apu/amdfw \ + ,$(1)), $(if $(call get_fmap_value,FMAP_SECTION_BCOPY_START),COREBOOTB))