blob: d589bf11b9ec9f9b33bd8ba3bcaa5a6d1ec136fe [file] [log] [blame]
Martin Roth1a3de8e2022-10-06 15:57:21 -06001# SPDX-License-Identifier: BSD-3-Clause
2
3# TODO: Move as much as possible to common
Martin Roth20646cd2023-01-04 21:27:06 -07004# TODO: Update for Phoenix
Martin Roth1a3de8e2022-10-06 15:57:21 -06005
Martin Roth20646cd2023-01-04 21:27:06 -07006ifeq ($(CONFIG_SOC_AMD_PHOENIX),y)
Martin Roth1a3de8e2022-10-06 15:57:21 -06007
8subdirs-$(CONFIG_VBOOT_STARTS_BEFORE_BOOTBLOCK) += psp_verstage
9
10# Beware that all-y also adds the compilation unit to verstage on PSP
Martin Roth1a3de8e2022-10-06 15:57:21 -060011all-y += aoac.c
Felix Held46cd1b52023-04-01 01:21:27 +020012all-y += config.c
13all-y += i2c.c
Martin Roth1a3de8e2022-10-06 15:57:21 -060014
Felix Heldf008e0a2023-04-01 01:31:24 +020015# all_x86-y adds the compilation unit to all stages that run on the x86 cores
16all_x86-y += gpio.c
17all_x86-y += uart.c
18
Martin Roth1a3de8e2022-10-06 15:57:21 -060019bootblock-y += early_fch.c
20bootblock-y += espi_util.c
Martin Roth1a3de8e2022-10-06 15:57:21 -060021
Martin Roth1a3de8e2022-10-06 15:57:21 -060022verstage-y += espi_util.c
Martin Roth1a3de8e2022-10-06 15:57:21 -060023
24romstage-y += fsp_m_params.c
Martin Roth1a3de8e2022-10-06 15:57:21 -060025romstage-y += romstage.c
Felix Held8f705b92023-02-06 19:56:35 +010026romstage-y += soc_util.c
Martin Roth1a3de8e2022-10-06 15:57:21 -060027
28ramstage-y += acpi.c
29ramstage-y += agesa_acpi.c
30ramstage-y += chip.c
31ramstage-y += cpu.c
Martin Roth1a3de8e2022-10-06 15:57:21 -060032ramstage-y += fch.c
33ramstage-y += fsp_s_params.c
Ritul Guru4843ded2023-02-20 00:45:11 +053034ramstage-y += graphics.c
Martin Roth1a3de8e2022-10-06 15:57:21 -060035ramstage-y += mca.c
Martin Roth1a3de8e2022-10-06 15:57:21 -060036ramstage-y += root_complex.c
Felix Held8f705b92023-02-06 19:56:35 +010037ramstage-y += soc_util.c
Martin Roth1a3de8e2022-10-06 15:57:21 -060038ramstage-y += xhci.c
39
40smm-y += gpio.c
41smm-y += smihandler.c
Martin Roth1a3de8e2022-10-06 15:57:21 -060042smm-$(CONFIG_DEBUG_SMI) += uart.c
43
Martin Roth20646cd2023-01-04 21:27:06 -070044CPPFLAGS_common += -I$(src)/soc/amd/phoenix/include
45CPPFLAGS_common += -I$(src)/soc/amd/phoenix/acpi
46CPPFLAGS_common += -I$(src)/vendorcode/amd/fsp/phoenix
Martin Roth1a3de8e2022-10-06 15:57:21 -060047CPPFLAGS_common += -I$(src)/vendorcode/amd/fsp/common
48
Martin Roth1a3de8e2022-10-06 15:57:21 -060049# 0x40 accounts for the cbfs_file struct + filename + metadata structs, aligned to 64 bytes
50# Building the cbfs image will fail if the offset isn't large enough
51AMD_FW_AB_POSITION := 0x40
52
Martin Roth20646cd2023-01-04 21:27:06 -070053PHOENIX_FW_A_POSITION=$(call int-add, \
Matt DeVillier163dbdd2023-06-29 16:56:09 -050054 $(call get_fmap_value,FMAP_SECTION_FW_MAIN_A_START) $(AMD_FW_AB_POSITION))
Martin Roth1a3de8e2022-10-06 15:57:21 -060055
Martin Roth20646cd2023-01-04 21:27:06 -070056PHOENIX_FW_B_POSITION=$(call int-add, \
Matt DeVillier163dbdd2023-06-29 16:56:09 -050057 $(call get_fmap_value,FMAP_SECTION_FW_MAIN_B_START) $(AMD_FW_AB_POSITION))
Fred Reitbergerdbf1b632023-06-30 13:44:14 -040058
59FMAP_FLASH_START=$(call get_fmap_value,FMAP_SECTION_FLASH_START)
60
Martin Roth1a3de8e2022-10-06 15:57:21 -060061#
62# PSP Directory Table items
63#
64# Certain ordering requirements apply, however these are ensured by amdfwtool.
65# For more information see "AMD Platform Security Processor BIOS Architecture
66# Design Guide for AMD Family 17h Processors" (PID #55758, NDA only).
67#
68
69ifeq ($(CONFIG_PSP_DISABLE_POSTCODES),y)
70PSP_SOFTFUSE_BITS += 7
71endif
72
73ifeq ($(CONFIG_PSP_UNLOCK_SECURE_DEBUG),y)
74# Enable secure debug unlock
75PSP_SOFTFUSE_BITS += 0
76OPT_TOKEN_UNLOCK="--token-unlock"
77endif
78
79ifeq ($(CONFIG_PSP_LOAD_MP2_FW),y)
80OPT_PSP_LOAD_MP2_FW="--load-mp2-fw"
81else
82# Disable MP2 firmware loading
83PSP_SOFTFUSE_BITS += 29
84endif
85
86# Use additional Soft Fuse bits specified in Kconfig
87PSP_SOFTFUSE_BITS += $(call strip_quotes, $(CONFIG_PSP_SOFTFUSE_BITS))
88
89# type = 0x3a
90ifeq ($(CONFIG_HAVE_PSP_WHITELIST_FILE),y)
91PSP_WHITELIST_FILE=$(CONFIG_PSP_WHITELIST_FILE)
92endif
93
94# type = 0x55
Martin Roth1a3de8e2022-10-06 15:57:21 -060095SPL_TABLE_FILE=$(CONFIG_SPL_TABLE_FILE)
96ifeq ($(CONFIG_HAVE_SPL_RW_AB_FILE),y)
97SPL_RW_AB_TABLE_FILE=$(CONFIG_SPL_RW_AB_TABLE_FILE)
98else
99SPL_RW_AB_TABLE_FILE=$(CONFIG_SPL_TABLE_FILE)
100endif
Martin Roth1a3de8e2022-10-06 15:57:21 -0600101
102#
103# BIOS Directory Table items - proper ordering is managed by amdfwtool
104#
105
106# type = 0x60
107PSP_APCB_FILES=$(APCB_SOURCES) $(APCB_SOURCES_RECOVERY)
108
109# type = 0x61
110PSP_APOB_BASE=$(CONFIG_PSP_APOB_DRAM_ADDRESS)
111
112# type = 0x62
113PSP_BIOSBIN_FILE=$(obj)/amd_biospsp.img
114PSP_ELF_FILE=$(objcbfs)/bootblock.elf
Felix Held3b89c952022-11-22 20:02:46 +0100115PSP_BIOSBIN_SIZE=$(shell $(READELF_bootblock) -Wl $(PSP_ELF_FILE) | grep LOAD | awk '{print $$5}')
116PSP_BIOSBIN_DEST=$(shell $(READELF_bootblock) -Wl $(PSP_ELF_FILE) | grep LOAD | awk '{print $$3}')
Martin Roth1a3de8e2022-10-06 15:57:21 -0600117
Fred Reitberger2a1fc732023-07-17 09:09:42 -0400118ifneq ($(CONFIG_SOC_AMD_COMMON_BLOCK_APOB_NV_DISABLE),y)
Martin Roth1a3de8e2022-10-06 15:57:21 -0600119# type = 0x63 - construct APOB NV base/size from flash map
120# The flashmap section used for this is expected to be named RW_MRC_CACHE
Matt DeVillier163dbdd2023-06-29 16:56:09 -0500121APOB_NV_SIZE=$(call get_fmap_value,FMAP_SECTION_RW_MRC_CACHE_SIZE)
Fred Reitbergere66ce2f2023-07-05 15:43:19 -0400122APOB_NV_BASE=$(call _tohex,$(call int-subtract, \
Fred Reitbergerdbf1b632023-06-30 13:44:14 -0400123 $(call get_fmap_value,FMAP_SECTION_RW_MRC_CACHE_START) $(FMAP_FLASH_START)))
Martin Roth1a3de8e2022-10-06 15:57:21 -0600124
Fred Reitberger097f5402023-02-24 13:27:13 -0500125ifeq ($(CONFIG_HAS_RECOVERY_MRC_CACHE),y)
126# On boards with recovery MRC cache, point type 0x63 entry to RECOVERY_MRC_CACHE.
127# Else use RW_MRC_CACHE. This entry will be added in the RO section.
Matt DeVillier163dbdd2023-06-29 16:56:09 -0500128APOB_NV_RO_SIZE=$(call get_fmap_value,FMAP_SECTION_RECOVERY_MRC_CACHE_SIZE)
Fred Reitbergere66ce2f2023-07-05 15:43:19 -0400129APOB_NV_RO_BASE=$(call _tohex,$(call int-subtract, \
Fred Reitbergerdbf1b632023-06-30 13:44:14 -0400130 $(call get_fmap_value,FMAP_SECTION_RECOVERY_MRC_CACHE_START) $(FMAP_FLASH_START)))
Fred Reitberger097f5402023-02-24 13:27:13 -0500131else
132APOB_NV_RO_SIZE=$(APOB_NV_SIZE)
133APOB_NV_RO_BASE=$(APOB_NV_BASE)
134endif
Fred Reitberger2a1fc732023-07-17 09:09:42 -0400135endif # !CONFIG_SOC_AMD_COMMON_BLOCK_APOB_NV_DISABLE
Fred Reitberger097f5402023-02-24 13:27:13 -0500136
Zheng Baoa4284b02023-02-01 13:16:52 +0800137ifeq ($(CONFIG_AMDFW_SPLIT),y)
Matt DeVillier163dbdd2023-06-29 16:56:09 -0500138FMAP_AMDFW_BODY_LOCATION=$(call get_fmap_value,FMAP_SECTION_AMDFWBODY_START)
Zheng Baoa4284b02023-02-01 13:16:52 +0800139endif
140
Martin Roth1a3de8e2022-10-06 15:57:21 -0600141ifeq ($(CONFIG_VBOOT_STARTS_BEFORE_BOOTBLOCK),y)
142# type = 0x6B - PSP Shared memory location
143ifneq ($(CONFIG_PSP_SHAREDMEM_SIZE),0x0)
144PSP_SHAREDMEM_SIZE=$(CONFIG_PSP_SHAREDMEM_SIZE)
145PSP_SHAREDMEM_BASE=$(shell awk '$$3 == "_psp_sharedmem_dram" {printf "0x" $$1}' $(objcbfs)/bootblock.map)
146endif
147
148# type = 0x52 - PSP Bootloader Userspace Application (verstage)
149PSP_VERSTAGE_FILE=$(call strip_quotes,$(CONFIG_PSP_VERSTAGE_FILE))
150PSP_VERSTAGE_SIG_FILE=$(call strip_quotes,$(CONFIG_PSP_VERSTAGE_SIGNING_TOKEN))
151endif # CONFIG_VBOOT_STARTS_BEFORE_BOOTBLOCK
152
153ifeq ($(CONFIG_SEPARATE_SIGNED_PSPFW),y)
154SIGNED_AMDFW_A_POSITION=$(call int-subtract, \
Fred Reitbergerdbf1b632023-06-30 13:44:14 -0400155 $(call get_fmap_value,FMAP_SECTION_SIGNED_AMDFW_A_START) $(FMAP_FLASH_START))
Martin Roth1a3de8e2022-10-06 15:57:21 -0600156SIGNED_AMDFW_B_POSITION=$(call int-subtract, \
Fred Reitbergerdbf1b632023-06-30 13:44:14 -0400157 $(call get_fmap_value,FMAP_SECTION_SIGNED_AMDFW_B_START) $(FMAP_FLASH_START))
Martin Roth1a3de8e2022-10-06 15:57:21 -0600158SIGNED_AMDFW_A_FILE=$(obj)/amdfw_a.rom.signed
159SIGNED_AMDFW_B_FILE=$(obj)/amdfw_b.rom.signed
160endif # CONFIG_SEPARATE_SIGNED_PSPFW
161
162# Helper function to return a value with given bit set
163# Soft Fuse type = 0xb - See #55758 (NDA) for bit definitions.
164set-bit=$(call int-shift-left, 1 $(call _toint,$1))
165PSP_SOFTFUSE=$(shell A=$(call int-add, \
166 $(foreach bit,$(PSP_SOFTFUSE_BITS),$(call set-bit,$(bit)))); printf "0x%x" $$A)
167
168#
169# Build the arguments to amdfwtool (order is unimportant). Missing file names
170# result in empty OPT_ variables, i.e. the argument is not passed to amdfwtool.
171#
172
173add_opt_prefix=$(if $(call strip_quotes, $(1)), $(2) $(call strip_quotes, $(1)), )
174
175OPT_VERSTAGE_FILE=$(call add_opt_prefix, $(PSP_VERSTAGE_FILE), --verstage)
176OPT_VERSTAGE_SIG_FILE=$(call add_opt_prefix, $(PSP_VERSTAGE_SIG_FILE), --verstage_sig)
177
178OPT_PSP_APCB_FILES= $(if $(APCB_SOURCES), --instance 0 --apcb $(APCB_SOURCES)) \
179 $(if $(APCB_SOURCES_RECOVERY), --instance 10 --apcb $(APCB_SOURCES_RECOVERY)) \
180 $(if $(APCB_SOURCES_68), --instance 18 --apcb $(APCB_SOURCES_68))
181
182OPT_APOB_ADDR=$(call add_opt_prefix, $(PSP_APOB_BASE), --apob-base)
183OPT_PSP_BIOSBIN_FILE=$(call add_opt_prefix, $(PSP_BIOSBIN_FILE), --bios-bin)
184OPT_PSP_BIOSBIN_DEST=$(call add_opt_prefix, $(PSP_BIOSBIN_DEST), --bios-bin-dest)
185OPT_PSP_BIOSBIN_SIZE=$(call add_opt_prefix, $(PSP_BIOSBIN_SIZE), --bios-uncomp-size)
186
187OPT_PSP_SHAREDMEM_BASE=$(call add_opt_prefix, $(PSP_SHAREDMEM_BASE), --sharedmem)
188OPT_PSP_SHAREDMEM_SIZE=$(call add_opt_prefix, $(PSP_SHAREDMEM_SIZE), --sharedmem-size)
189OPT_APOB_NV_SIZE=$(call add_opt_prefix, $(APOB_NV_SIZE), --apob-nv-size)
190OPT_APOB_NV_BASE=$(call add_opt_prefix, $(APOB_NV_BASE),--apob-nv-base)
Fred Reitberger097f5402023-02-24 13:27:13 -0500191OPT_APOB_NV_RO_SIZE=$(call add_opt_prefix, $(APOB_NV_RO_SIZE), --apob-nv-size)
192OPT_APOB_NV_RO_BASE=$(call add_opt_prefix, $(APOB_NV_RO_BASE),--apob-nv-base)
Martin Roth1a3de8e2022-10-06 15:57:21 -0600193OPT_EFS_SPI_READ_MODE=$(call add_opt_prefix, $(CONFIG_EFS_SPI_READ_MODE), --spi-read-mode)
194OPT_EFS_SPI_SPEED=$(call add_opt_prefix, $(CONFIG_EFS_SPI_SPEED), --spi-speed)
195OPT_EFS_SPI_MICRON_FLAG=$(call add_opt_prefix, $(CONFIG_EFS_SPI_MICRON_FLAG), --spi-micron-flag)
196
197OPT_SIGNED_AMDFW_A_POSITION=$(call add_opt_prefix, $(SIGNED_AMDFW_A_POSITION), --signed-addr)
198OPT_SIGNED_AMDFW_A_FILE=$(call add_opt_prefix, $(SIGNED_AMDFW_A_FILE), --signed-output)
199OPT_SIGNED_AMDFW_B_POSITION=$(call add_opt_prefix, $(SIGNED_AMDFW_B_POSITION), --signed-addr)
200OPT_SIGNED_AMDFW_B_FILE=$(call add_opt_prefix, $(SIGNED_AMDFW_B_FILE), --signed-output)
201
202OPT_PSP_SOFTFUSE=$(call add_opt_prefix, $(PSP_SOFTFUSE), --soft-fuse)
203
204OPT_WHITELIST_FILE=$(call add_opt_prefix, $(PSP_WHITELIST_FILE), --whitelist)
205OPT_SPL_TABLE_FILE=$(call add_opt_prefix, $(SPL_TABLE_FILE), --spl-table)
206OPT_SPL_RW_AB_TABLE_FILE=$(call add_opt_prefix, $(SPL_RW_AB_TABLE_FILE), --spl-table)
207
208# If vboot uses 2 RW slots, then 2 copies of PSP binaries are redundant
209OPT_RECOVERY_AB_SINGLE_COPY=$(if $(CONFIG_VBOOT_SLOTS_RW_AB), --recovery-ab-single-copy)
210
Zheng Baoa4284b02023-02-01 13:16:52 +0800211OPT_AMDFW_BODY_LOCATION=$(call add_opt_prefix, $(FMAP_AMDFW_BODY_LOCATION), --body-location)
212
Fred Reitberger5f5e73c2023-07-17 09:12:39 -0400213MANIFEST_FILE=$(obj)/amdfw_manifest
214OPT_MANIFEST=$(call add_opt_prefix, $(MANIFEST_FILE), --output-manifest)
215
Martin Roth1a3de8e2022-10-06 15:57:21 -0600216AMDFW_COMMON_ARGS=$(OPT_PSP_APCB_FILES) \
217 $(OPT_APOB_ADDR) \
Martin Roth0acf59d2023-03-08 15:18:24 -0700218 $(OPT_DEBUG_AMDFWTOOL) \
Martin Roth1a3de8e2022-10-06 15:57:21 -0600219 $(OPT_PSP_BIOSBIN_FILE) \
220 $(OPT_PSP_BIOSBIN_DEST) \
221 $(OPT_PSP_BIOSBIN_SIZE) \
222 $(OPT_PSP_SOFTFUSE) \
223 $(OPT_PSP_LOAD_MP2_FW) \
224 --use-pspsecureos \
225 --load-s0i3 \
Martin Roth1a3de8e2022-10-06 15:57:21 -0600226 $(OPT_TOKEN_UNLOCK) \
227 $(OPT_WHITELIST_FILE) \
228 $(OPT_PSP_SHAREDMEM_BASE) \
229 $(OPT_PSP_SHAREDMEM_SIZE) \
230 $(OPT_EFS_SPI_READ_MODE) \
231 $(OPT_EFS_SPI_SPEED) \
232 $(OPT_EFS_SPI_MICRON_FLAG) \
233 --config $(CONFIG_AMDFW_CONFIG_FILE) \
Martin Roth1a3de8e2022-10-06 15:57:21 -0600234 --flashsize $(CONFIG_ROM_SIZE) \
Zheng Baoa4284b02023-02-01 13:16:52 +0800235 $(OPT_RECOVERY_AB_SINGLE_COPY) \
236 $(OPT_AMDFW_BODY_LOCATION)
Martin Roth1a3de8e2022-10-06 15:57:21 -0600237
238$(obj)/amdfw.rom: $(call strip_quotes, $(PSP_BIOSBIN_FILE)) \
239 $(PSP_VERSTAGE_FILE) \
240 $(PSP_VERSTAGE_SIG_FILE) \
241 $$(PSP_APCB_FILES) \
242 $(DEP_FILES) \
243 $(AMDFWTOOL) \
244 $(obj)/fmap_config.h \
245 $(objcbfs)/bootblock.elf # this target also creates the .map file
Martin Roth1a3de8e2022-10-06 15:57:21 -0600246 rm -f $@
247 @printf " AMDFWTOOL $(subst $(obj)/,,$(@))\n"
248 $(AMDFWTOOL) \
249 $(AMDFW_COMMON_ARGS) \
Fred Reitberger097f5402023-02-24 13:27:13 -0500250 $(OPT_APOB_NV_RO_SIZE) \
251 $(OPT_APOB_NV_RO_BASE) \
Martin Roth1a3de8e2022-10-06 15:57:21 -0600252 $(OPT_VERSTAGE_FILE) \
253 $(OPT_VERSTAGE_SIG_FILE) \
254 $(OPT_SPL_TABLE_FILE) \
Fred Reitberger5f5e73c2023-07-17 09:12:39 -0400255 $(OPT_MANIFEST) \
Zheng Bao6bc06982023-02-14 13:26:31 +0800256 --location $(CONFIG_AMD_FWM_POSITION) \
Martin Roth1a3de8e2022-10-06 15:57:21 -0600257 --output $@
258
Zheng Baoa4284b02023-02-01 13:16:52 +0800259ifeq ($(CONFIG_AMDFW_SPLIT),y)
260$(obj)/amdfw.rom.body: $(obj)/amdfw.rom
261$(call add_intermediate, add_amdfwbody, $(obj)/amdfw.rom.body)
262 $(CBFSTOOL) $(obj)/coreboot.pre write -r AMDFWBODY -f $(obj)/amdfw.rom.body --fill-upward
263endif
264
Martin Roth1a3de8e2022-10-06 15:57:21 -0600265$(PSP_BIOSBIN_FILE): $(PSP_ELF_FILE) $(AMDCOMPRESS)
266 rm -f $@
267 @printf " AMDCOMPRS $(subst $(obj)/,,$(@))\n"
268 $(AMDCOMPRESS) --infile $(PSP_ELF_FILE) --outfile $@ --compress \
269 --maxsize $(PSP_BIOSBIN_SIZE)
270
271$(obj)/amdfw_a.rom: $(obj)/amdfw.rom
272 rm -f $@
273 @printf " AMDFWTOOL $(subst $(obj)/,,$(@))\n"
274 $(AMDFWTOOL) \
275 $(AMDFW_COMMON_ARGS) \
276 $(OPT_APOB_NV_SIZE) \
277 $(OPT_APOB_NV_BASE) \
278 $(OPT_SPL_RW_AB_TABLE_FILE) \
279 $(OPT_SIGNED_AMDFW_A_POSITION) \
280 $(OPT_SIGNED_AMDFW_A_FILE) \
Fred Reitbergere66ce2f2023-07-05 15:43:19 -0400281 --location $(call _tohex,$(PHOENIX_FW_A_POSITION)) \
Martin Roth1a3de8e2022-10-06 15:57:21 -0600282 --anywhere \
283 --output $@
284
285$(obj)/amdfw_b.rom: $(obj)/amdfw.rom
286 rm -f $@
287 @printf " AMDFWTOOL $(subst $(obj)/,,$(@))\n"
288 $(AMDFWTOOL) \
289 $(AMDFW_COMMON_ARGS) \
290 $(OPT_APOB_NV_SIZE) \
291 $(OPT_APOB_NV_BASE) \
292 $(OPT_SPL_RW_AB_TABLE_FILE) \
293 $(OPT_SIGNED_AMDFW_B_POSITION) \
294 $(OPT_SIGNED_AMDFW_B_FILE) \
Fred Reitbergere66ce2f2023-07-05 15:43:19 -0400295 --location $(call _tohex,$(PHOENIX_FW_B_POSITION)) \
Martin Roth1a3de8e2022-10-06 15:57:21 -0600296 --anywhere \
297 --output $@
298
299
Fred Reitberger5f5e73c2023-07-17 09:12:39 -0400300$(MANIFEST_FILE): $(obj)/amdfw.rom
301cbfs-files-y += amdfw_manifest
302amdfw_manifest-file := $(MANIFEST_FILE)
303amdfw_manifest-type := raw
304
Martin Roth1a3de8e2022-10-06 15:57:21 -0600305ifeq ($(CONFIG_VBOOT_SLOTS_RW_AB)$(CONFIG_VBOOT_STARTS_BEFORE_BOOTBLOCK),yy)
306cbfs-files-y += apu/amdfw_a
307apu/amdfw_a-file := $(obj)/amdfw_a.rom
308apu/amdfw_a-position := $(AMD_FW_AB_POSITION)
309apu/amdfw_a-type := raw
310
311cbfs-files-y += apu/amdfw_b
312apu/amdfw_b-file := $(obj)/amdfw_b.rom
313apu/amdfw_b-position := $(AMD_FW_AB_POSITION)
314apu/amdfw_b-type := raw
315
316ifeq ($(CONFIG_SEPARATE_SIGNED_PSPFW),y)
317build_complete:: $(obj)/amdfw_a.rom $(obj)/amdfw_b.rom
318 @printf " Adding Signed ROM and HASH\n"
319 $(CBFSTOOL) $(obj)/coreboot.rom write -u -r SIGNED_AMDFW_A -i 0 -f $(obj)/amdfw_a.rom.signed
320 $(CBFSTOOL) $(obj)/coreboot.rom write -u -r SIGNED_AMDFW_B -i 0 -f $(obj)/amdfw_b.rom.signed
321 $(CBFSTOOL) $(obj)/coreboot.rom add -r FW_MAIN_A -f $(obj)/amdfw_a.rom.signed.hash \
322 -n apu/amdfw_a_hash -t raw
323 $(CBFSTOOL) $(obj)/coreboot.rom add -r FW_MAIN_B -f $(obj)/amdfw_b.rom.signed.hash \
324 -n apu/amdfw_b_hash -t raw
Karthikeyan Ramasubramanian647abfd2023-07-14 16:30:07 -0600325 if [ -n "$(wildcard $(obj)/amdfw_a.rom.signed.1.hash)" ]; then \
326 $(CBFSTOOL) $(obj)/coreboot.rom add -r FW_MAIN_A -f \
327 $(obj)/amdfw_a.rom.signed.1.hash -n apu/amdfw_a_hash1 -t raw; \
328 $(CBFSTOOL) $(obj)/coreboot.rom add -r FW_MAIN_B -f \
329 $(obj)/amdfw_b.rom.signed.1.hash -n apu/amdfw_b_hash1 -t raw; \
330 fi
331 if [ -n "$(wildcard $(obj)/amdfw_a.rom.signed.2.hash)" ]; then \
332 $(CBFSTOOL) $(obj)/coreboot.rom add -r FW_MAIN_A -f \
333 $(obj)/amdfw_a.rom.signed.2.hash -n apu/amdfw_a_hash2 -t raw; \
334 $(CBFSTOOL) $(obj)/coreboot.rom add -r FW_MAIN_B -f \
335 $(obj)/amdfw_b.rom.signed.2.hash -n apu/amdfw_b_hash2 -t raw; \
336 fi
Martin Roth1a3de8e2022-10-06 15:57:21 -0600337endif # CONFIG_SEPARATE_SIGNED_PSPFW
338endif
339
Martin Roth20646cd2023-01-04 21:27:06 -0700340endif # ($(CONFIG_SOC_AMD_PHOENIX),y)