summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mainboard/google/zork/Kconfig16
-rw-r--r--src/soc/amd/cezanne/Makefile.inc14
-rw-r--r--src/soc/amd/picasso/Kconfig10
-rw-r--r--src/soc/amd/picasso/Makefile.inc20
-rw-r--r--src/soc/amd/sabrina/Makefile.inc12
5 files changed, 34 insertions, 38 deletions
diff --git a/src/mainboard/google/zork/Kconfig b/src/mainboard/google/zork/Kconfig
index 96f40e4492..dfc87bf5d9 100644
--- a/src/mainboard/google/zork/Kconfig
+++ b/src/mainboard/google/zork/Kconfig
@@ -133,22 +133,6 @@ config DRIVER_TPM_I2C_ADDR
hex
default 0x50
-config PICASSO_FW_A_POSITION
- hex
- default 0xFF012040
- depends on VBOOT_SLOTS_RW_AB
- help
- Location of the AMD firmware in the RW_A region. This is the
- start of the RW-A region + 64 bytes for the cbfs header.
-
-config PICASSO_FW_B_POSITION
- hex
- default 0xFF312040
- depends on VBOOT_SLOTS_RW_AB
- help
- Location of the AMD firmware in the RW_B region. This is the
- start of the RW-A region + 64 bytes for the cbfs header.
-
config VARIANT_SUPPORTS_PRE_V3_SCHEMATICS
bool
default y if BOARD_GOOGLE_TREMBYLE
diff --git a/src/soc/amd/cezanne/Makefile.inc b/src/soc/amd/cezanne/Makefile.inc
index 5708baa0e3..332268ccf8 100644
--- a/src/soc/amd/cezanne/Makefile.inc
+++ b/src/soc/amd/cezanne/Makefile.inc
@@ -73,13 +73,17 @@ CEZANNE_FWM_POSITION=$(call int-add, \
$(call int-shift-left, \
0x80000 $(CONFIG_AMD_FWM_POSITION_INDEX))) 0x20000 1)
+# 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
+AMD_FW_AB_POSITION := 0x40
+
CEZANNE_FW_A_POSITION=$(call int-add, \
$(shell awk '$$2 == "FMAP_SECTION_FW_MAIN_A_START" {print $$3}' $(obj)/fmap_config.h) \
- 0x40)
+ $(AMD_FW_AB_POSITION))
CEZANNE_FW_B_POSITION=$(call int-add, \
$(shell awk '$$2 == "FMAP_SECTION_FW_MAIN_B_START" {print $$3}' $(obj)/fmap_config.h) \
- 0x40)
+ $(AMD_FW_AB_POSITION))
#
# PSP Directory Table items
#
@@ -278,12 +282,14 @@ 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
-apu/amdfw_a-position := $(call strip_quotes, $(CEZANNE_FW_A_POSITION))
+# Ensure this ends up at the beginning of the FW_MAIN_A fmap region
+apu/amdfw_a-position := $(AMD_FW_AB_POSITION)
apu/amdfw_a-type := raw
cbfs-files-y += apu/amdfw_b
apu/amdfw_b-file := $(obj)/amdfw_b.rom
-apu/amdfw_b-position := $(call strip_quotes, $(CEZANNE_FW_B_POSITION))
+# Ensure this ends up at the beginning of the FW_MAIN_B fmap region
+apu/amdfw_b-position := $(AMD_FW_AB_POSITION)
apu/amdfw_b-type := raw
endif
diff --git a/src/soc/amd/picasso/Kconfig b/src/soc/amd/picasso/Kconfig
index ebcbd62068..558f30110f 100644
--- a/src/soc/amd/picasso/Kconfig
+++ b/src/soc/amd/picasso/Kconfig
@@ -517,16 +517,6 @@ config RWB_REGION_ONLY
Add a space-delimited list of filenames that should only be in the
RW-B section.
-config PICASSO_FW_A_POSITION
- hex
- help
- Location of the AMD firmware in the RW_A region
-
-config PICASSO_FW_B_POSITION
- hex
- help
- Location of the AMD firmware in the RW_B region
-
endif # VBOOT_SLOTS_RW_AB && VBOOT_STARTS_BEFORE_BOOTBLOCK
endif # SOC_AMD_PICASSO
diff --git a/src/soc/amd/picasso/Makefile.inc b/src/soc/amd/picasso/Makefile.inc
index de16da4bd1..8eef1538cc 100644
--- a/src/soc/amd/picasso/Makefile.inc
+++ b/src/soc/amd/picasso/Makefile.inc
@@ -77,6 +77,18 @@ PICASSO_FWM_POSITION=$(call int-add, \
$(call int-shift-left, \
0x80000 $(CONFIG_AMD_FWM_POSITION_INDEX))) 0x20000 1)
+# 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
+AMD_FW_AB_POSITION := 0x40
+
+PICASSO_FW_A_POSITION=$(call int-add, \
+ $(shell awk '$$2 == "FMAP_SECTION_FW_MAIN_A_START" {print $$3}' $(obj)/fmap_config.h) \
+ $(AMD_FW_AB_POSITION))
+
+PICASSO_FW_B_POSITION=$(call int-add, \
+ $(shell awk '$$2 == "FMAP_SECTION_FW_MAIN_B_START" {print $$3}' $(obj)/fmap_config.h) \
+ $(AMD_FW_AB_POSITION))
+
#
# PSP Directory Table items
#
@@ -248,7 +260,7 @@ $(obj)/amdfw_a.rom: $(obj)/amdfw.rom
$(AMDFW_COMMON_ARGS) \
$(OPT_APOB_NV_SIZE) \
$(OPT_APOB_NV_BASE) \
- --location $(shell printf "%#x" $(CONFIG_PICASSO_FW_A_POSITION)) \
+ --location $(shell printf "%#x" $(PICASSO_FW_A_POSITION)) \
--anywhere \
--output $@
@@ -259,7 +271,7 @@ $(obj)/amdfw_b.rom: $(obj)/amdfw.rom
$(AMDFW_COMMON_ARGS) \
$(OPT_APOB_NV_SIZE) \
$(OPT_APOB_NV_BASE) \
- --location $(shell printf "%#x" $(CONFIG_PICASSO_FW_B_POSITION)) \
+ --location $(shell printf "%#x" $(PICASSO_FW_B_POSITION)) \
--anywhere \
--output $@
@@ -271,12 +283,12 @@ 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
-apu/amdfw_a-position := $(call strip_quotes, $(CONFIG_PICASSO_FW_A_POSITION))
+apu/amdfw_a-position := $(AMD_FW_AB_POSITION)
apu/amdfw_a-type := raw
cbfs-files-y += apu/amdfw_b
apu/amdfw_b-file := $(obj)/amdfw_b.rom
-apu/amdfw_b-position := $(call strip_quotes, $(CONFIG_PICASSO_FW_B_POSITION))
+apu/amdfw_b-position := $(AMD_FW_AB_POSITION)
apu/amdfw_b-type := raw
endif
diff --git a/src/soc/amd/sabrina/Makefile.inc b/src/soc/amd/sabrina/Makefile.inc
index 22ba2cc436..74124d25a7 100644
--- a/src/soc/amd/sabrina/Makefile.inc
+++ b/src/soc/amd/sabrina/Makefile.inc
@@ -72,13 +72,17 @@ SABRINA_FWM_POSITION=$(call int-add, \
$(call int-shift-left, \
0x80000 $(CONFIG_AMD_FWM_POSITION_INDEX))) 0x20000 1)
+# 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
+AMD_FW_AB_POSITION := 0x40
+
SABRINA_FW_A_POSITION=$(call int-add, \
$(shell awk '$$2 == "FMAP_SECTION_FW_MAIN_A_START" {print $$3}' $(obj)/fmap_config.h) \
- 0x40)
+ $(AMD_FW_AB_POSITION))
SABRINA_FW_B_POSITION=$(call int-add, \
$(shell awk '$$2 == "FMAP_SECTION_FW_MAIN_B_START" {print $$3}' $(obj)/fmap_config.h) \
- 0x40)
+ $(AMD_FW_AB_POSITION))
#
# PSP Directory Table items
#
@@ -277,12 +281,12 @@ 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
-apu/amdfw_a-position := $(call strip_quotes, $(SABRINA_FW_A_POSITION))
+apu/amdfw_a-position := $(AMD_FW_AB_POSITION)
apu/amdfw_a-type := raw
cbfs-files-y += apu/amdfw_b
apu/amdfw_b-file := $(obj)/amdfw_b.rom
-apu/amdfw_b-position := $(call strip_quotes, $(SABRINA_FW_B_POSITION))
+apu/amdfw_b-position := $(AMD_FW_AB_POSITION)
apu/amdfw_b-type := raw
endif