blob: 56f792c365c247c0e7b71c314967fd8d9a741057 [file] [log] [blame]
Martin Roth5c354b92019-04-22 14:55:16 -06001#*****************************************************************************
2#
Marshall Dawson62611412019-06-19 11:46:06 -06003# Copyright (c) 2012, 2016-2019 Advanced Micro Devices, Inc.
Martin Roth5c354b92019-04-22 14:55:16 -06004# 2013 - 2014 Sage Electronic Engineering, LLC
5# All rights reserved.
6#
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions are met:
9# * Redistributions of source code must retain the above copyright
10# notice, this list of conditions and the following disclaimer.
11# * Redistributions in binary form must reproduce the above copyright
12# notice, this list of conditions and the following disclaimer in the
13# documentation and/or other materials provided with the distribution.
14# * Neither the name of Advanced Micro Devices, Inc. nor the names of
15# its contributors may be used to endorse or promote products derived
16# from this software without specific prior written permission.
17#
18# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21# DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY
22# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28#
29#*****************************************************************************
Martin Roth1f337622019-04-22 16:08:31 -060030ifeq ($(CONFIG_SOC_AMD_PICASSO),y)
Martin Roth5c354b92019-04-22 14:55:16 -060031
32subdirs-y += ../../../cpu/amd/mtrr/
33subdirs-y += ../../../cpu/x86/tsc
34subdirs-y += ../../../cpu/x86/lapic
35subdirs-y += ../../../cpu/x86/cache
36subdirs-y += ../../../cpu/x86/mtrr
37subdirs-y += ../../../cpu/x86/pae
38subdirs-y += ../../../cpu/x86/smm
39
Martin Roth5c354b92019-04-22 14:55:16 -060040romstage-y += i2c.c
41romstage-y += romstage.c
Martin Roth5c354b92019-04-22 14:55:16 -060042romstage-y += gpio.c
Martin Roth5c354b92019-04-22 14:55:16 -060043romstage-y += pmutil.c
44romstage-y += reset.c
45romstage-y += smbus.c
Kyösti Mälkki047a9e42019-08-03 21:28:40 +030046romstage-y += memmap.c
Marshall Dawsonbc4c9032019-06-11 12:18:20 -060047romstage-$(CONFIG_PICASSO_UART) += uart.c
Martin Roth5c354b92019-04-22 14:55:16 -060048romstage-y += tsc_freq.c
49romstage-y += southbridge.c
Martin Roth5c354b92019-04-22 14:55:16 -060050romstage-$(CONFIG_HAVE_SMI_HANDLER) += smi_util.c
51
52verstage-y += gpio.c
53verstage-y += i2c.c
Martin Roth5c354b92019-04-22 14:55:16 -060054verstage-y += pmutil.c
55verstage-y += reset.c
Marshall Dawsonbc4c9032019-06-11 12:18:20 -060056verstage-$(CONFIG_PICASSO_UART) += uart.c
Martin Roth5c354b92019-04-22 14:55:16 -060057verstage-y += tsc_freq.c
Martin Roth5c354b92019-04-22 14:55:16 -060058
59postcar-y += monotonic_timer.c
Marshall Dawsonbc4c9032019-06-11 12:18:20 -060060postcar-$(CONFIG_PICASSO_UART) += uart.c
Kyösti Mälkki047a9e42019-08-03 21:28:40 +030061postcar-y += memmap.c
Martin Roth5c354b92019-04-22 14:55:16 -060062postcar-$(CONFIG_VBOOT_MEASURED_BOOT) += i2c.c
63postcar-y += tsc_freq.c
64
Martin Roth5c354b92019-04-22 14:55:16 -060065ramstage-y += i2c.c
66ramstage-y += chip.c
67ramstage-y += cpu.c
68ramstage-y += mca.c
Martin Roth5c354b92019-04-22 14:55:16 -060069ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpi.c
70ramstage-y += gpio.c
Martin Roth5c354b92019-04-22 14:55:16 -060071ramstage-y += southbridge.c
72ramstage-y += northbridge.c
73ramstage-y += pmutil.c
74ramstage-y += reset.c
75ramstage-y += sata.c
76ramstage-y += sm.c
77ramstage-y += smbus.c
Kyösti Mälkki047a9e42019-08-03 21:28:40 +030078ramstage-y += memmap.c
Martin Roth5c354b92019-04-22 14:55:16 -060079ramstage-$(CONFIG_HAVE_SMI_HANDLER) += smi.c
80ramstage-$(CONFIG_HAVE_SMI_HANDLER) += smi_util.c
Marshall Dawsonbc4c9032019-06-11 12:18:20 -060081ramstage-$(CONFIG_PICASSO_UART) += uart.c
Martin Roth5c354b92019-04-22 14:55:16 -060082ramstage-y += usb.c
83ramstage-y += tsc_freq.c
Martin Roth5c354b92019-04-22 14:55:16 -060084ramstage-y += finalize.c
Martin Roth5c354b92019-04-22 14:55:16 -060085
Martin Roth5c354b92019-04-22 14:55:16 -060086smm-y += smihandler.c
87smm-y += smi_util.c
88smm-y += tsc_freq.c
89smm-$(CONFIG_DEBUG_SMI) += uart.c
Martin Roth5c354b92019-04-22 14:55:16 -060090smm-y += gpio.c
91
Martin Rothd7e3ead2019-04-22 16:32:58 -060092CPPFLAGS_common += -I$(src)/soc/amd/picasso
93CPPFLAGS_common += -I$(src)/soc/amd/picasso/include
94CPPFLAGS_common += -I$(src)/soc/amd/picasso/acpi
Martin Roth5c354b92019-04-22 14:55:16 -060095
96# ROMSIG Normally At ROMBASE + 0x20000
97# Overridden by CONFIG_AMD_FWM_POSITION_INDEX
98# +-----------+---------------+----------------+------------+
Marshall Dawson62611412019-06-19 11:46:06 -060099# |0x55AA55AA | | | |
Martin Roth5c354b92019-04-22 14:55:16 -0600100# +-----------+---------------+----------------+------------+
Marshall Dawson62611412019-06-19 11:46:06 -0600101# | | PSPDIR ADDR | BIOSDIR ADDR |
102# +-----------+---------------+----------------+
103
Marshall Dawsonbc4c9032019-06-11 12:18:20 -0600104PICASSO_FWM_POSITION=$(call int-add, \
Martin Roth5c354b92019-04-22 14:55:16 -0600105 $(call int-subtract, 0xffffffff \
106 $(call int-shift-left, \
107 0x80000 $(CONFIG_AMD_FWM_POSITION_INDEX))) 0x20000 1)
108
Marshall Dawson62611412019-06-19 11:46:06 -0600109#
110# PSP Directory Table items
111#
112# Certain ordering requirements apply, however these are ensured by amdfwtool.
113# For more information see "AMD Platform Security Processor BIOS Architecture
114# Design Guide for AMD Family 17h Processors" (PID #55758, NDA only).
115#
116
117# type = 0x0
Martin Roth5c354b92019-04-22 14:55:16 -0600118FIRMWARE_LOCATE=$(dir $(call strip_quotes, $(CONFIG_AMD_PUBKEY_FILE)))
Martin Roth5c354b92019-04-22 14:55:16 -0600119
Marshall Dawson62611412019-06-19 11:46:06 -0600120# type = 0x1
121ifeq ($(CONFIG_HAVE_PSP_WHITELIST_FILE),y)
122PSPBTLDR_FILE=$(top)/$(FIRMWARE_LOCATE)/PspBootLoader_WL_RV.sbin
123else
124PSPBTLDR_FILE=$(top)/$(FIRMWARE_LOCATE)/PspBootLoader_prod_RV.sbin
Martin Roth5c354b92019-04-22 14:55:16 -0600125endif
126
Marshall Dawson62611412019-06-19 11:46:06 -0600127# type = 0x5
128PUBSIGNEDKEY_FILE=$(top)/$(FIRMWARE_LOCATE)/RtmPubSignedRV.key
Martin Roth5c354b92019-04-22 14:55:16 -0600129
Marshall Dawson62611412019-06-19 11:46:06 -0600130# types = 0x8 and 0x18
131PSP_SMUFW1_SUB1_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmwareRV2.csbin
132PSP_SMUFW1_SUB2_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmwarePCO.csbin
133PSP_SMUFW2_SUB1_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmware2RV2.csbin
134PSP_SMUFW2_SUB2_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmware2PCO.csbin
Martin Roth5c354b92019-04-22 14:55:16 -0600135
Marshall Dawson62611412019-06-19 11:46:06 -0600136# type = 0x9
137PSP_SEC_DBG_KEY_FILE=$(top)/$(FIRMWARE_LOCATE)/RavenSecureDebug_PublicKey.bin
Martin Roth5c354b92019-04-22 14:55:16 -0600138
Marshall Dawson62611412019-06-19 11:46:06 -0600139# type = 0xb - See #55758 (NDA) for bit definitions.
140PSP_SOFTFUSE="0x0000000010000001"
Martin Roth5c354b92019-04-22 14:55:16 -0600141
Marshall Dawson62611412019-06-19 11:46:06 -0600142ifeq ($(CONFIG_USE_PSPSCUREOS),y)
143# types = 0x2, 0xc
144PSPSCUREOS_FILE=$(top)/$(FIRMWARE_LOCATE)/psp_os_combined_prod_RV.sbin
145PSPTRUSTLETS_FILE=$(top)/$(FIRMWARE_LOCATE)/dr_ftpm_prod_RV.csbin
Martin Roth5c354b92019-04-22 14:55:16 -0600146endif
147
Marshall Dawson62611412019-06-19 11:46:06 -0600148# type = 0x13
149PSP_SEC_DEBUG_FILE=$(top)/$(FIRMWARE_LOCATE)/secure_unlock_prod_RV.sbin
150
151# type = 0x21
152PSP_IKEK_FILE=$(top)/$(FIRMWARE_LOCATE)/PspIkekRV.bin
153
154# type = 0x24
155PSP_SECG1_FILE=$(top)/$(FIRMWARE_LOCATE)/security_policy_RV2_FP5_AM4.sbin
156PSP_SECG2_FILE=$(top)/$(FIRMWARE_LOCATE)/security_policy_PCO_FP5_AM4.sbin
157
158ifeq ($(CONFIG_PSP_LOAD_MP2_FW),y)
159# type = 0x25
160PSP_MP2FW1_FILE=$(top)/$(FIRMWARE_LOCATE)/MP2I2CFWRV2.sbin
161PSP_MP2FW2_FILE=$(top)/$(FIRMWARE_LOCATE)/MP2I2CFWPCO.sbin
162# BIOS type = 0x6a
163PSP_MP2CFG_FILE=$(top)/$(FIRMWARE_LOCATE)/MP2FWConfig.sbin
164else
165PSP_SOFTFUSE="0x0000000030000001"
Martin Roth5c354b92019-04-22 14:55:16 -0600166endif
167
Marshall Dawson62611412019-06-19 11:46:06 -0600168# type = 0x28
169PSP_DRIVERS_FILE=$(top)/$(FIRMWARE_LOCATE)/drv_sys_prod_RV.sbin
170
171ifeq ($(CONFIG_PSP_LOAD_S0I3_FW),y)
172PSP_S0I3_FILE=$(top)/$(FIRMWARE_LOCATE)/dr_agesa_prod_RV.sbin
173endif
174
175# types = 0x30 - 0x37
176PSP_ABL0_FILE=$(top)/$(FIRMWARE_LOCATE)/AgesaBootloader0_prod_RV.csbin
177PSP_ABL1_FILE=$(top)/$(FIRMWARE_LOCATE)/AgesaBootloader1_prod_RV.csbin
178PSP_ABL2_FILE=$(top)/$(FIRMWARE_LOCATE)/AgesaBootloader2_prod_RV.csbin
179PSP_ABL3_FILE=$(top)/$(FIRMWARE_LOCATE)/AgesaBootloader3_prod_RV.csbin
180PSP_ABL4_FILE=$(top)/$(FIRMWARE_LOCATE)/AgesaBootloader4_prod_RV.csbin
181PSP_ABL5_FILE=$(top)/$(FIRMWARE_LOCATE)/AgesaBootloader5_prod_RV.csbin
182PSP_ABL6_FILE=$(top)/$(FIRMWARE_LOCATE)/AgesaBootloader6_prod_RV.csbin
183PSP_ABL7_FILE=$(top)/$(FIRMWARE_LOCATE)/AgesaBootloader7_prod_RV.csbin
184
185# type = 0x3a
186ifeq ($(CONFIG_HAVE_PSP_WHITELIST_FILE),y)
187PSP_WHITELIST_FILE=$(CONFIG_PSP_WHITELIST_FILE)
188endif
189
190#
191# BIOS Directory Table items - proper ordering is managed by amdfwtool
192#
193
194# type = 0x60
195PSP_APCB_FILE=$(call strip_quotes, $(CONFIG_PSP_APCB_FILE))
196
197# type = 0x61
198PSP_APOB_BASE=$(CONFIG_PSP_APOB_DESTINATION)
199
200# type = 0x62
201PSP_BIOSBIN_FILE=$(obj)/amd_biospsp.img
202PSP_BIOSBIN_DEST=$(CONFIG_ROMSTAGE_ADDR)
203PSP_BIOSBIN_SIZE=$(CONFIG_RAM_RESET_VECTOR_STAGE_SIZE)
204
205# type = 0x63
206PSP_APOBNV_BASE=$(CONFIG_PSP_APOB_NV_ADDRESS)
207PSP_APOBNV_SIZE=$(CONFIG_PSP_APOB_NV_SIZE)
208
209# type2 = 0x64, 0x65
210PSP_PMUI_FILE1=$(top)/$(FIRMWARE_LOCATE)/Appb_Rv_1D_Ddr4_Udimm_Imem.csbin
211PSP_PMUI_FILE2=$(top)/$(FIRMWARE_LOCATE)/Appb_Rv_2D_Ddr4_Imem.csbin
212PSP_PMUI_FILE3=$(top)/$(FIRMWARE_LOCATE)/Appb_Rv2_1D_ddr4_Udimm_Imem.csbin
213PSP_PMUI_FILE4=$(top)/$(FIRMWARE_LOCATE)/Appb_Rv2_2D_ddr4_Udimm_Imem.csbin
214PSP_PMUD_FILE1=$(top)/$(FIRMWARE_LOCATE)/Appb_Rv_1D_Ddr4_Udimm_Dmem.csbin
215PSP_PMUD_FILE2=$(top)/$(FIRMWARE_LOCATE)/Appb_Rv_2D_Ddr4_Dmem.csbin
216PSP_PMUD_FILE3=$(top)/$(FIRMWARE_LOCATE)/Appb_Rv2_1D_ddr4_Udimm_Dmem.csbin
217PSP_PMUD_FILE4=$(top)/$(FIRMWARE_LOCATE)/Appb_Rv2_2D_ddr4_Udimm_Dmem.csbin
218
219# type = 0x66
220PSP_UCODE_FILE1=$(top)/$(FIRMWARE_LOCATE)/UcodePatch_PCO_B1.bin
221PSP_UCODE_FILE2=$(top)/$(FIRMWARE_LOCATE)/UcodePatch_PCO_B0.bin
222PSP_UCODE_FILE3=$(top)/$(FIRMWARE_LOCATE)/UcodePatch_RV2_A0.bin
223
224#
225# Build the arguments to amdfwtool (order is unimportant). Missing file names
226# result in empty OPT_ variables, i.e. the argument is not passed to amdfwtool.
227#
228
Martin Roth5c354b92019-04-22 14:55:16 -0600229add_opt_prefix=$(if $(call strip_quotes, $(1)), $(2) $(call strip_quotes, $(1)), )
230
Martin Roth5c354b92019-04-22 14:55:16 -0600231OPT_AMD_PUBKEY_FILE=$(call add_opt_prefix, $(CONFIG_AMD_PUBKEY_FILE), --pubkey)
232OPT_PSPBTLDR_FILE=$(call add_opt_prefix, $(PSPBTLDR_FILE), --bootloader)
Martin Roth5c354b92019-04-22 14:55:16 -0600233OPT_PSPNVRAM_FILE=$(call add_opt_prefix, $(PSPNVRAM_FILE), --nvram)
Marshall Dawson62611412019-06-19 11:46:06 -0600234OPT_PUBSIGNEDKEY_FILE=$(call add_opt_prefix, $(PUBSIGNEDKEY_FILE), --rtmpubkey)
235OPT_SMUFW1_SUB1_FILE=$(call add_opt_prefix, $(PSP_SMUFW1_SUB1_FILE), --subprogram 1 --smufirmware)
236OPT_SMUFW1_SUB2_FILE=$(call add_opt_prefix, $(PSP_SMUFW1_SUB2_FILE), --subprogram 2 --smufirmware)
237OPT_SMUFW2_SUB1_FILE=$(call add_opt_prefix, $(PSP_SMUFW2_SUB1_FILE), --subprogram 1 --smufirmware2)
238OPT_SMUFW2_SUB2_FILE=$(call add_opt_prefix, $(PSP_SMUFW2_SUB2_FILE), --subprogram 2 --smufirmware2)
239OPT_PSP_SEC_DBG_KEY_FILE=$(call add_opt_prefix, $(PSP_SEC_DBG_KEY_FILE), --securedebug)
240OPT_PSP_SOFTFUSE=$(call add_opt_prefix, $(PSP_SOFTFUSE), --soft-fuse)
Martin Roth5c354b92019-04-22 14:55:16 -0600241OPT_PSPSCUREOS_FILE=$(call add_opt_prefix, $(PSPSCUREOS_FILE), --secureos)
242OPT_PSPTRUSTLETS_FILE=$(call add_opt_prefix, $(PSPTRUSTLETS_FILE), --trustlets)
Marshall Dawson62611412019-06-19 11:46:06 -0600243OPT_SEC_DEBUG_FILE=$(call add_opt_prefix, $(PSP_SEC_DEBUG_FILE), --secdebug)
244OPT_IKEK_FILE=$(call add_opt_prefix, $(PSP_IKEK_FILE), --ikek)
245OPT_SECG1_FILE=$(call add_opt_prefix, $(PSP_SECG1_FILE), --subprog 1 --sec-gasket)
246OPT_SECG2_FILE=$(call add_opt_prefix, $(PSP_SECG2_FILE), --subprog 2 --sec-gasket)
247OPT_MP2FW1_FILE=$(call add_opt_prefix, $(PSP_MP2FW1_FILE), --subprog 1 --mp2-fw)
248OPT_MP2FW2_FILE=$(call add_opt_prefix, $(PSP_MP2FW2_FILE), --subprog 2 --mp2-fw)
249OPT_DRIVERS_FILE=$(call add_opt_prefix, $(PSP_DRIVERS_FILE), --drv-entry-pts)
250OPT_PSP_S0I3_FILE=$(call add_opt_prefix, $(PSP_S0I3_FILE), --s0i3drv)
251OPT_ABL0_FILE=$(call add_opt_prefix, $(PSP_ABL0_FILE), --abl-image)
252OPT_ABL1_FILE=$(call add_opt_prefix, $(PSP_ABL1_FILE), --abl-image)
253OPT_ABL2_FILE=$(call add_opt_prefix, $(PSP_ABL2_FILE), --abl-image)
254OPT_ABL3_FILE=$(call add_opt_prefix, $(PSP_ABL3_FILE), --abl-image)
255OPT_ABL4_FILE=$(call add_opt_prefix, $(PSP_ABL4_FILE), --abl-image)
256OPT_ABL5_FILE=$(call add_opt_prefix, $(PSP_ABL5_FILE), --abl-image)
257OPT_ABL6_FILE=$(call add_opt_prefix, $(PSP_ABL6_FILE), --abl-image)
258OPT_ABL7_FILE=$(call add_opt_prefix, $(PSP_ABL7_FILE), --abl-image)
259OPT_WHITELIST_FILE=$(call add_opt_prefix, $(PSP_WHITELIST_FILE), --whitelist)
260
261OPT_PSP_APCB_FILE=$(call add_opt_prefix, $(PSP_APCB_FILE), --apcb)
262OPT_APOB_ADDR=$(call add_opt_prefix, $(PSP_APOB_BASE), --apob-base)
263OPT_PSP_BIOSBIN_FILE=$(call add_opt_prefix, $(PSP_BIOSBIN_FILE), --bios-bin)
264OPT_PSP_BIOSBIN_DEST=$(call add_opt_prefix, $(PSP_BIOSBIN_DEST), --bios-bin-dest)
265OPT_PSP_BIOSBIN_SIZE=$(call add_opt_prefix, $(PSP_BIOSBIN_SIZE), --bios-uncomp-size)
266OPT_APOBNV_ADDR=$(call add_opt_prefix, $(PSP_APOBNV_BASE), --apob-nv-base)
267OPT_APOBNV_SIZE=$(call add_opt_prefix, $(PSP_APOBNV_SIZE), --apob-nv-size)
268OPT_PSP_PMUI_FILE1=$(call add_opt_prefix, $(PSP_PMUI_FILE1), --subprogram 0 --instance 1 --pmu-inst)
269OPT_PSP_PMUI_FILE2=$(call add_opt_prefix, $(PSP_PMUI_FILE2), --subprogram 0 --instance 4 --pmu-inst)
270OPT_PSP_PMUI_FILE3=$(call add_opt_prefix, $(PSP_PMUI_FILE3), --subprogram 1 --instance 1 --pmu-inst)
271OPT_PSP_PMUI_FILE4=$(call add_opt_prefix, $(PSP_PMUI_FILE4), --subprogram 1 --instance 4 --pmu-inst)
272OPT_PSP_PMUD_FILE1=$(call add_opt_prefix, $(PSP_PMUD_FILE1), --subprogram 0 --instance 1 --pmu-data)
273OPT_PSP_PMUD_FILE2=$(call add_opt_prefix, $(PSP_PMUD_FILE2), --subprogram 0 --instance 4 --pmu-data)
274OPT_PSP_PMUD_FILE3=$(call add_opt_prefix, $(PSP_PMUD_FILE3), --subprogram 1 --instance 1 --pmu-data)
275OPT_PSP_PMUD_FILE4=$(call add_opt_prefix, $(PSP_PMUD_FILE4), --subprogram 1 --instance 4 --pmu-data)
276OPT_PSP_UCODE_FILE1=$(call add_opt_prefix, $(PSP_UCODE_FILE1), --instance 0 --ucode)
277OPT_PSP_UCODE_FILE2=$(call add_opt_prefix, $(PSP_UCODE_FILE2), --instance 1 --ucode)
278OPT_PSP_UCODE_FILE3=$(call add_opt_prefix, $(PSP_UCODE_FILE3), --instance 2 --ucode)
279OPT_MP2CFG_FILE=$(call add_opt_prefix, $(PSP_MP2CFG_FILE), --mp2-config)
Martin Roth5c354b92019-04-22 14:55:16 -0600280
Marshall Dawson19ea0162019-06-11 12:34:04 -0600281$(obj)/amdfw.rom: $(call strip_quotes, $(CONFIG_AMD_PUBKEY_FILE)) \
Martin Roth5c354b92019-04-22 14:55:16 -0600282 $(call strip_quotes, $(PUBSIGNEDKEY_FILE)) \
283 $(call strip_quotes, $(PSPBTLDR_FILE)) \
Martin Roth5c354b92019-04-22 14:55:16 -0600284 $(call strip_quotes, $(PSPSCUREOS_FILE)) \
Marshall Dawson62611412019-06-19 11:46:06 -0600285 $(call strip_quotes, $(PSP_SEC_DBG_KEY_FILE)) \
Martin Roth5c354b92019-04-22 14:55:16 -0600286 $(call strip_quotes, $(PSPTRUSTLETS_FILE)) \
Marshall Dawson62611412019-06-19 11:46:06 -0600287 $(call strip_quotes, $(PSP_APCB_FILE)) \
288 $(call strip_quotes, $(PSP_BIOSBIN_FILE)) \
289 $(call strip_quotes, $(PSP_PMUI_FILE1)) \
290 $(call strip_quotes, $(PSP_PMUI_FILE2)) \
291 $(call strip_quotes, $(PSP_PMUI_FILE3)) \
292 $(call strip_quotes, $(PSP_PMUI_FILE4)) \
293 $(call strip_quotes, $(PSP_PMUD_FILE1)) \
294 $(call strip_quotes, $(PSP_PMUD_FILE2)) \
295 $(call strip_quotes, $(PSP_PMUD_FILE3)) \
296 $(call strip_quotes, $(PSP_PMUD_FILE4)) \
297 $(call strip_quotes, $(PSP_UCODE_FILE1)) \
298 $(call strip_quotes, $(PSP_UCODE_FILE2)) \
299 $(call strip_quotes, $(PSP_UCODE_FILE3)) \
300 $(call strip_quotes, $(PSP_MP2CFG_FILE)) \
301 $(call strip_quotes, $(PSP_SMUFW1_SUB1_FILE)) \
302 $(call strip_quotes, $(PSP_SMUFW1_SUB2_FILE)) \
303 $(call strip_quotes, $(PSP_SMUFW2_SUB1_FILE)) \
304 $(call strip_quotes, $(PSP_SMUFW2_SUB2_FILE)) \
305 $(call strip_quotes, $(PSP_ABL0_FILE)) \
306 $(call strip_quotes, $(PSP_ABL1_FILE)) \
307 $(call strip_quotes, $(PSP_ABL2_FILE)) \
308 $(call strip_quotes, $(PSP_ABL3_FILE)) \
309 $(call strip_quotes, $(PSP_ABL4_FILE)) \
310 $(call strip_quotes, $(PSP_ABL5_FILE)) \
311 $(call strip_quotes, $(PSP_ABL6_FILE)) \
312 $(call strip_quotes, $(PSP_ABL7_FILE)) \
313 $(call strip_quotes, $(PSP_WHITELIST_FILE)) \
314 $(call strip_quotes, $(PSP_SECG1_FILE)) \
315 $(call strip_quotes, $(PSP_SECG2_FILE)) \
316 $(call_strip_quotes, $(PSP_DRIVERS_FILE)) \
317 $(call_strip_quotes, $(PSP_S0I3_FILE)) \
318 $(call_strip_quotes, $(PSP_IKEK_FILE)) \
319 $(call_strip_quotes, $(PSP_SEC_DEBUG_FILE)) \
Martin Roth5c354b92019-04-22 14:55:16 -0600320 $(AMDFWTOOL)
321 rm -f $@
322 @printf " AMDFWTOOL $(subst $(obj)/,,$(@))\n"
323 $(AMDFWTOOL) \
Martin Roth5c354b92019-04-22 14:55:16 -0600324 $(OPT_AMD_PUBKEY_FILE) \
325 $(OPT_PSPBTLDR_FILE) \
Martin Roth5c354b92019-04-22 14:55:16 -0600326 $(OPT_PUBSIGNEDKEY_FILE) \
327 $(OPT_PSPSCUREOS_FILE) \
Marshall Dawson62611412019-06-19 11:46:06 -0600328 $(OPT_PSP_SEC_DBG_KEY_FILE) \
Martin Roth5c354b92019-04-22 14:55:16 -0600329 $(OPT_PSPTRUSTLETS_FILE) \
Marshall Dawson62611412019-06-19 11:46:06 -0600330 $(OPT_SMUFW1_SUB2_FILE) \
331 $(OPT_SMUFW2_SUB2_FILE) \
332 $(OPT_SMUFW1_SUB1_FILE) \
333 $(OPT_SMUFW2_SUB1_FILE) \
334 $(OPT_PSP_APCB_FILE) \
335 $(OPT_APOB_ADDR) \
336 $(OPT_APOBNV_ADDR) \
337 $(OPT_APOBNV_SIZE) \
338 $(OPT_PSP_BIOSBIN_FILE) \
339 $(OPT_PSP_BIOSBIN_DEST) \
340 $(OPT_PSP_BIOSBIN_SIZE) \
341 $(OPT_PSP_SOFTFUSE) \
342 $(OPT_PSP_PMUI_FILE1) \
343 $(OPT_PSP_PMUI_FILE2) \
344 $(OPT_PSP_PMUI_FILE3) \
345 $(OPT_PSP_PMUI_FILE4) \
346 $(OPT_PSP_PMUD_FILE1) \
347 $(OPT_PSP_PMUD_FILE2) \
348 $(OPT_PSP_PMUD_FILE3) \
349 $(OPT_PSP_PMUD_FILE4) \
350 $(OPT_PSP_UCODE_FILE1) \
351 $(OPT_PSP_UCODE_FILE2) \
352 $(OPT_PSP_UCODE_FILE3) \
353 $(OPT_MP2CFG_FILE) \
354 $(OPT_ABL0_FILE) \
355 $(OPT_ABL1_FILE) \
356 $(OPT_ABL2_FILE) \
357 $(OPT_ABL3_FILE) \
358 $(OPT_ABL4_FILE) \
359 $(OPT_ABL5_FILE) \
360 $(OPT_ABL6_FILE) \
361 $(OPT_ABL7_FILE) \
362 $(OPT_WHITELIST_FILE) \
363 $(OPT_SECG1_FILE) \
364 $(OPT_SECG2_FILE) \
365 $(OPT_MP2FW1_FILE) \
366 $(OPT_MP2FW2_FILE) \
367 $(OPT_DRIVERS_FILE) \
368 $(OPT_PSP_S0I3_FILE) \
369 $(OPT_IKEK_FILE) \
370 $(OPT_SEC_DEBUG_FILE) \
Martin Roth5c354b92019-04-22 14:55:16 -0600371 --combo-capable \
Marshall Dawson62611412019-06-19 11:46:06 -0600372 --token-unlock \
Martin Roth5c354b92019-04-22 14:55:16 -0600373 --flashsize $(CONFIG_ROM_SIZE) \
Marshall Dawsonbc4c9032019-06-11 12:18:20 -0600374 --location $(shell printf "0x%x" $(PICASSO_FWM_POSITION)) \
Martin Roth5c354b92019-04-22 14:55:16 -0600375 --output $@
376
Marshall Dawson62611412019-06-19 11:46:06 -0600377USE_BIOS_FILE=$(obj)/cbfs/fallback/romstage.elf
378$(PSP_BIOSBIN_FILE): $(obj)/cbfs/fallback/romstage.elf $(AMDCOMPRESS)
379 rm -f $@
380 @printf " AMDCOMPRS $(subst $(obj)/,,$(@))\n"
381 $(AMDCOMPRESS) --infile $(USE_BIOS_FILE) --outfile $@ --compress \
382 --maxsize $(PSP_BIOSBIN_SIZE)
383
Martin Roth5c354b92019-04-22 14:55:16 -0600384ifeq ($(CONFIG_AMDFW_OUTSIDE_CBFS),y)
385PHONY+=add_amdfw
386INTERMEDIATE+=add_amdfw
387
388# Calculate firmware position inside the ROM
Marshall Dawsonbc4c9032019-06-11 12:18:20 -0600389PICASSO_FWM_ROM_POSITION=$(call int-add, \
Martin Roth5c354b92019-04-22 14:55:16 -0600390 $(call int-subtract, $(CONFIG_ROM_SIZE) \
391 $(call int-shift-left, \
392 0x80000 $(CONFIG_AMD_FWM_POSITION_INDEX))) 0x20000)
393
394add_amdfw: $(obj)/coreboot.pre $(obj)/amdfw.rom
395 printf " DD Adding AMD Firmware at ROM offset 0x%x\n" \
Marshall Dawsonbc4c9032019-06-11 12:18:20 -0600396 "$(PICASSO_FWM_ROM_POSITION)"
Marshall Dawson62611412019-06-19 11:46:06 -0600397 dd oflag=seek_bytes \
398 if=$(obj)/amdfw.rom \
399 of=$(obj)/coreboot.pre conv=notrunc \
Marshall Dawsonbc4c9032019-06-11 12:18:20 -0600400 seek=$(PICASSO_FWM_ROM_POSITION) >/dev/null 2>&1
Martin Roth5c354b92019-04-22 14:55:16 -0600401
402else # ifeq ($(CONFIG_AMDFW_OUTSIDE_CBFS),y)
403
404cbfs-files-y += apu/amdfw
405apu/amdfw-file := $(obj)/amdfw.rom
Marshall Dawsonbc4c9032019-06-11 12:18:20 -0600406apu/amdfw-position := $(PICASSO_FWM_POSITION)
Martin Roth5c354b92019-04-22 14:55:16 -0600407apu/amdfw-type := raw
408
409endif # ifeq ($(CONFIG_AMDFW_OUTSIDE_CBFS),y)
410
Martin Roth1f337622019-04-22 16:08:31 -0600411endif # ($(CONFIG_SOC_AMD_PICASSO),y)