summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarthikeyan Ramasubramanian <kramasub@google.com>2022-09-20 23:53:40 -0600
committerRaul Rangel <rrangel@chromium.org>2022-10-26 16:00:10 +0000
commit8d66fb1a7056961aaa8874d8d9001716c9a61c1b (patch)
tree38bf716ed47e2c964578f4861c049ff1000eb387
parentda5d0251f52356bc2acb4217bbc2030581145af1 (diff)
soc/amd: Add amdfw.rom in coreboot.pre
This change ensures that amdfw.rom binary containing metadata hash anchor is added before any file is added to CBFS. This will allow to verify all the CBFS files that are not excluded from verification. BUG=b:227809919 TEST=Build and boot to OS in Skyrim with CBFS verification enabled using x86 and PSP verstages. Change-Id: Id4d1a2d8b145cbbbf2da27aa73b296c9c8a65209 Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/66943 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Raul Rangel <rrangel@chromium.org>
-rw-r--r--src/soc/amd/cezanne/Makefile.inc5
-rw-r--r--src/soc/amd/common/Makefile.inc12
-rw-r--r--src/soc/amd/mendocino/Makefile.inc5
-rw-r--r--src/soc/amd/morgana/Makefile.inc5
-rw-r--r--src/soc/amd/picasso/Makefile.inc5
5 files changed, 12 insertions, 20 deletions
diff --git a/src/soc/amd/cezanne/Makefile.inc b/src/soc/amd/cezanne/Makefile.inc
index 508ea1da99..cdbbcfefd4 100644
--- a/src/soc/amd/cezanne/Makefile.inc
+++ b/src/soc/amd/cezanne/Makefile.inc
@@ -274,11 +274,6 @@ $(obj)/amdfw_b.rom: $(obj)/amdfw.rom
--output $@
-cbfs-files-y += apu/amdfw
-apu/amdfw-file := $(obj)/amdfw.rom
-apu/amdfw-position := $(CEZANNE_FWM_POSITION)
-apu/amdfw-type := raw
-
ifeq ($(CONFIG_VBOOT_SLOTS_RW_A)$(CONFIG_VBOOT_STARTS_BEFORE_BOOTBLOCK),yy)
cbfs-files-y += apu/amdfw_a
apu/amdfw_a-file := $(obj)/amdfw_a.rom
diff --git a/src/soc/amd/common/Makefile.inc b/src/soc/amd/common/Makefile.inc
index 75b1142632..c8e9d0df4a 100644
--- a/src/soc/amd/common/Makefile.inc
+++ b/src/soc/amd/common/Makefile.inc
@@ -14,6 +14,18 @@ DEP_FILES= $(patsubst %,$(FIRMWARE_LOCATION)/%, $(shell sed -e /^$(POUND_SIGN)/d
amd_microcode_bins += $(wildcard ${FIRMWARE_LOCATION}/*UcodePatch_*.bin)
+ifeq ($(CONFIG_RESET_VECTOR_IN_RAM),y)
+$(objcbfs)/bootblock.bin: $(obj)/amdfw.rom
+ cp $< $@
+
+add_bootblock = \
+ $(CBFSTOOL) $(1) add -f $(2) -n apu/amdfw -t amdfw \
+ -b $(call int-add, \
+ $(call int-subtract, 0xffffffff \
+ $(call int-shift-left, \
+ 0x80000 $(CONFIG_AMD_FWM_POSITION_INDEX))) 0x20000 1)
+endif # ifeq ($(CONFIG_RESET_VECTOR_IN_RAM),y)
+
ifeq ($(CONFIG_VBOOT_GSCVD),y)
build_complete:: $(AMDFWREAD)
endif # ifeq ($(CONFIG_VBOOT_GSCVD),y)
diff --git a/src/soc/amd/mendocino/Makefile.inc b/src/soc/amd/mendocino/Makefile.inc
index 8f3425d83f..fe283bdad6 100644
--- a/src/soc/amd/mendocino/Makefile.inc
+++ b/src/soc/amd/mendocino/Makefile.inc
@@ -296,11 +296,6 @@ $(obj)/amdfw_b.rom: $(obj)/amdfw.rom
--output $@
-cbfs-files-y += apu/amdfw
-apu/amdfw-file := $(obj)/amdfw.rom
-apu/amdfw-position := $(MENDOCINO_FWM_POSITION)
-apu/amdfw-type := raw
-
ifeq ($(CONFIG_VBOOT_SLOTS_RW_A)$(CONFIG_VBOOT_STARTS_BEFORE_BOOTBLOCK),yy)
cbfs-files-y += apu/amdfw_a
apu/amdfw_a-file := $(obj)/amdfw_a.rom
diff --git a/src/soc/amd/morgana/Makefile.inc b/src/soc/amd/morgana/Makefile.inc
index f4243bce27..a0065b8256 100644
--- a/src/soc/amd/morgana/Makefile.inc
+++ b/src/soc/amd/morgana/Makefile.inc
@@ -298,11 +298,6 @@ $(obj)/amdfw_b.rom: $(obj)/amdfw.rom
--output $@
-cbfs-files-y += apu/amdfw
-apu/amdfw-file := $(obj)/amdfw.rom
-apu/amdfw-position := $(MORGANA_FWM_POSITION)
-apu/amdfw-type := raw
-
ifeq ($(CONFIG_VBOOT_SLOTS_RW_AB)$(CONFIG_VBOOT_STARTS_BEFORE_BOOTBLOCK),yy)
cbfs-files-y += apu/amdfw_a
apu/amdfw_a-file := $(obj)/amdfw_a.rom
diff --git a/src/soc/amd/picasso/Makefile.inc b/src/soc/amd/picasso/Makefile.inc
index cff47af8e2..397c54d618 100644
--- a/src/soc/amd/picasso/Makefile.inc
+++ b/src/soc/amd/picasso/Makefile.inc
@@ -286,11 +286,6 @@ $(obj)/amdfw_b.rom: $(obj)/amdfw.rom
--anywhere \
--output $@
-cbfs-files-y += apu/amdfw
-apu/amdfw-file := $(obj)/amdfw.rom
-apu/amdfw-position := $(PICASSO_FWM_POSITION)
-apu/amdfw-type := raw
-
ifeq ($(CONFIG_VBOOT_SLOTS_RW_A)$(CONFIG_VBOOT_STARTS_BEFORE_BOOTBLOCK),yy)
cbfs-files-y += apu/amdfw_a
apu/amdfw_a-file := $(obj)/amdfw_a.rom