aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKarthikeyan Ramasubramanian <kramasub@google.com>2023-10-16 14:53:57 -0600
committerMartin L Roth <gaumless@gmail.com>2023-10-20 19:32:43 +0000
commit3167fb70f8366d8698383679b4fbcfaa643e9d2e (patch)
tree2f434ebc608b7bec12cbd59fd2a758474ac80433 /src
parent13946121164b38ae946dfb8d51a8fac87310e6c0 (diff)
soc/amd/*: Set AMD_FW_AB_POSITION to either 64 or 128 bytes
When CBFS verification is enabled, add amdfw_a/b.rom at offset 128 bytes to account for CBFS file header with hash attribute. When CBFS verification is disabled, add amdfw_a/b.rom at offset 64 bytes to account for CBFS file header without hash attribute. BUG=None TEST=Build Skyrim, Myst BIOS images with and without CBFS verification enabled. Change-Id: Ic374ac41df0c8fb8ce59488881ce5846e9058915 Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/78425 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
Diffstat (limited to 'src')
-rw-r--r--src/soc/amd/glinda/Makefile.inc9
-rw-r--r--src/soc/amd/mendocino/Makefile.inc9
-rw-r--r--src/soc/amd/phoenix/Makefile.inc9
3 files changed, 21 insertions, 6 deletions
diff --git a/src/soc/amd/glinda/Makefile.inc b/src/soc/amd/glinda/Makefile.inc
index ea2a48b883..5b63df30ec 100644
--- a/src/soc/amd/glinda/Makefile.inc
+++ b/src/soc/amd/glinda/Makefile.inc
@@ -43,9 +43,14 @@ CPPFLAGS_common += -I$(src)/soc/amd/glinda/acpi
CPPFLAGS_common += -I$(src)/vendorcode/amd/fsp/glinda
CPPFLAGS_common += -I$(src)/vendorcode/amd/fsp/common
-# 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
+# Building the cbfs image will fail if the offset, aligned to 64 bytes, isn't large enough
+ifeq ($(CONFIG_CBFS_VERIFICATION),y)
+# 0x80 accounts for the cbfs_file struct + filename + metadata structs
+AMD_FW_AB_POSITION := 0x80
+else # ($(CONFIG_CBFS_VERIFICATION), y)
+# 0x40 accounts for the cbfs_file struct + filename + metadata structs without hash attribute
AMD_FW_AB_POSITION := 0x40
+endif # ($(CONFIG_CBFS_VERIFICATION), y)
GLINDA_FW_A_POSITION=$(call int-add, \
$(call get_fmap_value,FMAP_SECTION_FW_MAIN_A_START) $(AMD_FW_AB_POSITION))
diff --git a/src/soc/amd/mendocino/Makefile.inc b/src/soc/amd/mendocino/Makefile.inc
index 944208326e..f123487da3 100644
--- a/src/soc/amd/mendocino/Makefile.inc
+++ b/src/soc/amd/mendocino/Makefile.inc
@@ -42,9 +42,14 @@ CPPFLAGS_common += -I$(src)/soc/amd/mendocino/acpi
CPPFLAGS_common += -I$(src)/vendorcode/amd/fsp/mendocino
CPPFLAGS_common += -I$(src)/vendorcode/amd/fsp/common
-# 0x80 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
+# Building the cbfs image will fail if the offset, aligned to 64 bytes, isn't large enough
+ifeq ($(CONFIG_CBFS_VERIFICATION),y)
+# 0x80 accounts for the cbfs_file struct + filename + metadata structs
AMD_FW_AB_POSITION := 0x80
+else # ($(CONFIG_CBFS_VERIFICATION), y)
+# 0x40 accounts for the cbfs_file struct + filename + metadata structs without hash attribute
+AMD_FW_AB_POSITION := 0x40
+endif # ($(CONFIG_CBFS_VERIFICATION), y)
MENDOCINO_FW_A_POSITION=$(call int-add, \
$(call get_fmap_value,FMAP_SECTION_FW_MAIN_A_START) $(AMD_FW_AB_POSITION))
diff --git a/src/soc/amd/phoenix/Makefile.inc b/src/soc/amd/phoenix/Makefile.inc
index ee7ccea323..cab89871b4 100644
--- a/src/soc/amd/phoenix/Makefile.inc
+++ b/src/soc/amd/phoenix/Makefile.inc
@@ -46,9 +46,14 @@ CPPFLAGS_common += -I$(src)/soc/amd/phoenix/acpi
CPPFLAGS_common += -I$(src)/vendorcode/amd/fsp/phoenix
CPPFLAGS_common += -I$(src)/vendorcode/amd/fsp/common
-# 0x80 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
+# Building the cbfs image will fail if the offset, aligned to 64 bytes, isn't large enough
+ifeq ($(CONFIG_CBFS_VERIFICATION),y)
+# 0x80 accounts for the cbfs_file struct + filename + metadata structs
AMD_FW_AB_POSITION := 0x80
+else # ($(CONFIG_CBFS_VERIFICATION), y)
+# 0x40 accounts for the cbfs_file struct + filename + metadata structs without hash attribute
+AMD_FW_AB_POSITION := 0x40
+endif # ($(CONFIG_CBFS_VERIFICATION), y)
PHOENIX_FW_A_POSITION=$(call int-add, \
$(call get_fmap_value,FMAP_SECTION_FW_MAIN_A_START) $(AMD_FW_AB_POSITION))