amdfwtool: Take a config file instead of command line parameters

To verify the consistency, see if timeless builds with and without
this patch result in identical coreboot.rom files.

BUG=b:154032833
TEST=Build & boot on mandolin

Change-Id: Icae73d0730106aab687486e555ba947796e5e757
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/42859
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nikolai Vyssotski <nikolai.vyssotski@amd.corp-partner.google.com>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
This commit is contained in:
Zheng Bao
2020-10-28 11:38:09 +08:00
committed by Felix Held
parent 1cd013bec5
commit c5e28abaf8
15 changed files with 786 additions and 559 deletions

View File

@@ -63,6 +63,10 @@ config HUDSON_PSP
bool
default y if CPU_AMD_PI_00730F01 || CPU_AMD_PI_00660F01
config AMDFW_CONFIG_FILE
string "AMD PSP Firmware config file"
default "src/southbridge/amd/pi/hudson/fw_avl.cfg" if CPU_AMD_PI_00730F01
config HUDSON_XHCI_FWM_FILE
string "XHCI firmware path and filename"
default "3rdparty/blobs/southbridge/amd/avalon/xhci.bin" if SOUTHBRIDGE_AMD_PI_AVALON

View File

@@ -78,14 +78,9 @@ endif
ifeq ($(CONFIG_HUDSON_PSP), y)
ifeq ($(CONFIG_CPU_AMD_PI_00730F01), y)
FIRMWARE_LOCATE=$(dir $(call strip_quotes, $(CONFIG_AMD_PUBKEY_FILE)))
FIRMWARE_LOCATE=$(shell grep -e FIRMWARE_LOCATE $(CONFIG_AMDFW_CONFIG_FILE) | awk '{print $$2}')
FIRMWARE_TYPE=
PSPBTLDR_FILE=$(top)/$(FIRMWARE_LOCATE)/PspBootLoader.Bypass.sbin
#PSPRCVR_FILE=$(top)/$(FIRMWARE_LOCATE)/PspRecovery.sbin
#PSPSECUREOS_FILE=$(top)/$(FIRMWARE_LOCATE)/PspSecureOs.sbin
#PSPTRUSTLETS_FILE=$(top)/$(FIRMWARE_LOCATE)/trustlets.bin
#TRUSTLETKEY_FILE=$(top)/$(FIRMWARE_LOCATE)/Trustlet.tkn.cert
endif
ifeq ($(CONFIG_CPU_AMD_PI_00660F01), y)
@@ -102,9 +97,6 @@ endif
#PUBSIGNEDKEY_FILE=$(top)/$(FIRMWARE_LOCATE)/RtmPubSigned$(FIRMWARE_TYPE).key
#PSPNVRAM_FILE=$(top)/$(FIRMWARE_LOCATE)/PspNvram$(FIRMWARE_TYPE).bin
SMUFWM_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmware$(FIRMWARE_TYPE).sbin
SMUFWM_FN_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmware$(FIRMWARE_TYPE)_FN.sbin
SMUSCS_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuScs$(FIRMWARE_TYPE).bin
#PSPSECUREDEBUG_FILE=$(top)/$(FIRMWARE_LOCATE)/PspSecureDebug$(FIRMWARE_TYPE).Key
endif
@@ -128,21 +120,12 @@ OPT_TRUSTLETKEY_FILE=$(call add_opt_prefix, $(TRUSTLETKEY_FILE), --trustletkey)
OPT_SMUFIRMWARE2_FILE=$(call add_opt_prefix, $(SMUFIRMWARE2_FILE), --smufirmware2)
OPT_SMUSCS_FILE=$(call add_opt_prefix, $(SMUSCS_FILE), --smuscs)
# Add all the files listed in the config file
DEP_FILES=$(shell $(AMDFWTOOL) --config $(CONFIG_AMDFW_CONFIG_FILE) --depend)
$(obj)/amdfw.rom: $(call strip_quotes, $(CONFIG_HUDSON_XHCI_FWM_FILE)) \
$(call strip_quotes, $(CONFIG_HUDSON_IMC_FWM_FILE)) \
$(call strip_quotes, $(CONFIG_HUDSON_GEC_FWM_FILE)) \
$(call strip_quotes, $(CONFIG_AMD_PUBKEY_FILE)) \
$(call strip_quotes, $(PUBSIGNEDKEY_FILE)) \
$(call strip_quotes, $(PSPBTLDR_FILE)) \
$(call strip_quotes, $(PSPRCVR_FILE)) \
$(call strip_quotes, $(PSPSECUREOS_FILE)) \
$(call strip_quotes, $(PSPNVRAM_FILE)) \
$(call strip_quotes, $(SMUFWM_FILE)) \
$(call strip_quotes, $(SMUSCS_FILE)) \
$(call strip_quotes, $(PSPSECUREDEBUG_FILE)) \
$(call strip_quotes, $(PSPTRUSTLETS_FILE)) \
$(call strip_quotes, $(TRUSTLETKEY_FILE)) \
$(call strip_quotes, $(SMUFIRMWARE2_FILE)) \
$(call strip_quotes, $(AMD_PUBKEY2_FILE)) \
$(call strip_quotes, $(PUBSIGNEDKEY2_FILE)) \
$(call strip_quotes, $(PSPBTLDR2_FILE)) \
@@ -157,6 +140,7 @@ $(obj)/amdfw.rom: $(call strip_quotes, $(CONFIG_HUDSON_XHCI_FWM_FILE)) \
$(call strip_quotes, $(TRUSTLETKEY2_FILE)) \
$(call strip_quotes, $(SMUFIRMWARE2_2_FILE)) \
$(call strip_quotes, $(SMUFIRMWARE2_2_FN_FILE)) \
$(DEP_FILES) \
$(AMDFWTOOL)
rm -f $@
@printf " AMDFWTOOL $(subst $(obj)/,,$(@))\n"
@@ -164,18 +148,6 @@ $(obj)/amdfw.rom: $(call strip_quotes, $(CONFIG_HUDSON_XHCI_FWM_FILE)) \
$(OPT_HUDSON_XHCI_FWM_FILE) \
$(OPT_HUDSON_IMC_FWM_FILE) \
$(OPT_HUDSON_GEC_FWM_FILE) \
$(OPT_AMD_PUBKEY_FILE) \
$(OPT_PSPBTLDR_FILE) \
$(OPT_SMUFWM_FILE) \
$(OPT_PSPRCVR_FILE) \
$(OPT_PUBSIGNEDKEY_FILE) \
$(OPT_PSPSECUREOS_FILE) \
$(OPT_PSPNVRAM_FILE) \
$(OPT_PSPSECUREDEBUG_FILE) \
$(OPT_PSPTRUSTLETS_FILE) \
$(OPT_TRUSTLETKEY_FILE) \
$(OPT_SMUFIRMWARE2_FILE) \
$(OPT_SMUSCS_FILE) \
$(OPT_2AMD_PUBKEY_FILE) \
$(OPT_2PSPBTLDR_FILE) \
$(OPT_2SMUFWM_FILE) \
@@ -192,6 +164,7 @@ $(obj)/amdfw.rom: $(call strip_quotes, $(CONFIG_HUDSON_XHCI_FWM_FILE)) \
$(OPT_2SMUSCS_FILE) \
--flashsize $(CONFIG_ROM_SIZE) \
--location $(HUDSON_FWM_POSITION) \
--config $(CONFIG_AMDFW_CONFIG_FILE) \
--output $@
ifeq ($(CONFIG_AMDFW_OUTSIDE_CBFS),y)

View File

@@ -0,0 +1,8 @@
# PSP fw config file
FIRMWARE_LOCATE 3rdparty/blobs/southbridge/amd/avalon/PSP
#PSP
AMD_PUBKEY_FILE AmdPubKey.bin
PSPBTLDR_FILE PspBootLoader.Bypass.sbin
PSP_SMUFW1_SUB0_FILE SmuFirmware.sbin
SMUSCS_FILE SmuScs.bin