1## SPDX-License-Identifier: BSD-3-Clause 2 3# Copyright (c) 2012, Advanced Micro Devices, Inc. 4# 2013 - 2014, Sage Electronic Engineering, LLC 5 6bootblock-y += bootblock.c 7bootblock-y += early_setup.c 8bootblock-$(CONFIG_USBDEBUG) += enable_usbdebug.c 9 10romstage-y += early_setup.c 11romstage-y += enable_usbdebug.c 12romstage-$(CONFIG_HUDSON_IMC_FWM) += imc.c 13romstage-y += smbus.c 14romstage-y += smbus_spd.c 15 16verstage-y += early_setup.c 17 18ramstage-y += enable_usbdebug.c 19ramstage-$(CONFIG_HAVE_ACPI_TABLES) += fadt.c 20ramstage-y += hda.c 21ramstage-y += hudson.c 22ramstage-y += ide.c 23ramstage-$(CONFIG_HUDSON_IMC_FWM) += imc.c 24ramstage-y += lpc.c 25ramstage-y += pci.c 26ramstage-y += pcie.c 27ramstage-y += sata.c 28ramstage-y += sd.c 29ramstage-y += sm.c 30ramstage-$(CONFIG_HAVE_SMI_HANDLER) += smi.c 31ramstage-$(CONFIG_HAVE_SMI_HANDLER) += smi_util.c 32ramstage-y += usb.c 33 34all-y += reset.c 35 36smm-y += smihandler.c 37smm-y += smi_util.c 38 39CPPFLAGS_common += -I$(src)/southbridge/amd/pi/hudson/include 40 41# ROMSIG At ROMBASE + 0x20000: 42# +-----------+---------------+----------------+------------+ 43# |0x55AA55AA |EC ROM Address |GEC ROM Address |USB3 ROM | 44# +-----------+---------------+----------------+------------+ 45# |PSPDIR ADDR| 46# +-----------+ 47# 48# EC ROM should be 64K aligned. 49 50ifeq ($(CONFIG_AMDFW_OUTSIDE_CBFS),y) 51HUDSON_FWM_POSITION=$(call int-add, $(call int-subtract, 0xffffffff $(CONFIG_ROM_SIZE)) 0x20000 1) 52else 53HUDSON_FWM_POSITION=0xfff20000 54endif 55 56ifeq ($(CONFIG_HUDSON_PSP), y) 57 58ifeq ($(CONFIG_CPU_AMD_PI_00730F01), y) 59FIRMWARE_TYPE= 60 61endif 62 63#PUBSIGNEDKEY_FILE=$(top)/$(FIRMWARE_LOCATION)/RtmPubSigned$(FIRMWARE_TYPE).key 64#PSPNVRAM_FILE=$(top)/$(FIRMWARE_LOCATION)/PspNvram$(FIRMWARE_TYPE).bin 65#PSPSECUREDEBUG_FILE=$(top)/$(FIRMWARE_LOCATION)/PspSecureDebug$(FIRMWARE_TYPE).Key 66 67endif 68 69add_opt_prefix=$(if $(call strip_quotes, $(1)), $(2) $(call strip_quotes, $(1)), ) 70 71OPT_HUDSON_XHCI_FWM_FILE=$(call add_opt_prefix, $(CONFIG_HUDSON_XHCI_FWM_FILE), --xhci) 72OPT_HUDSON_IMC_FWM_FILE=$(call add_opt_prefix, $(CONFIG_HUDSON_IMC_FWM_FILE), --imc) 73OPT_HUDSON_GEC_FWM_FILE=$(call add_opt_prefix, $(CONFIG_HUDSON_GEC_FWM_FILEddd), --gec) 74 75OPT_AMD_PUBKEY_FILE=$(call add_opt_prefix, $(CONFIG_AMD_PUBKEY_FILE), --pubkey) 76OPT_PSPBTLDR_FILE=$(call add_opt_prefix, $(PSPBTLDR_FILE), --bootloader) 77OPT_SMUFWM_FILE=$(call add_opt_prefix, $(SMUFWM_FILE), --smufirmware) 78OPT_PSPRCVR_FILE=$(call add_opt_prefix, $(PSPRCVR_FILE), --recovery) 79OPT_PUBSIGNEDKEY_FILE=$(call add_opt_prefix, $(PUBSIGNEDKEY_FILE), --rtmpubkey) 80OPT_PSPSECUREOS_FILE=$(call add_opt_prefix, $(PSPSECUREOS_FILE), --secureos) 81OPT_PSPNVRAM_FILE=$(call add_opt_prefix, $(PSPNVRAM_FILE), --nvram) 82OPT_PSPSECUREDEBUG_FILE=$(call add_opt_prefix, $(PSPSECUREDEBUG_FILE), --securedebug) 83OPT_PSPTRUSTLETS_FILE=$(call add_opt_prefix, $(PSPTRUSTLETS_FILE), --trustlets) 84OPT_TRUSTLETKEY_FILE=$(call add_opt_prefix, $(TRUSTLETKEY_FILE), --trustletkey) 85OPT_SMUFIRMWARE2_FILE=$(call add_opt_prefix, $(SMUFIRMWARE2_FILE), --smufirmware2) 86OPT_SMUSCS_FILE=$(call add_opt_prefix, $(SMUSCS_FILE), --smuscs) 87 88$(obj)/amdfw.rom: $(call strip_quotes, $(CONFIG_HUDSON_XHCI_FWM_FILE)) \ 89 $(call strip_quotes, $(CONFIG_HUDSON_IMC_FWM_FILE)) \ 90 $(call strip_quotes, $(CONFIG_HUDSON_GEC_FWM_FILE)) \ 91 $(call strip_quotes, $(AMD_PUBKEY2_FILE)) \ 92 $(call strip_quotes, $(PUBSIGNEDKEY2_FILE)) \ 93 $(call strip_quotes, $(PSPBTLDR2_FILE)) \ 94 $(call strip_quotes, $(SMUFWM2_FILE)) \ 95 $(call strip_quotes, $(SMUFWM2_FN_FILE)) \ 96 $(call strip_quotes, $(PSPRCVR2_FILE)) \ 97 $(call strip_quotes, $(PSPSECUREOS2_FILE)) \ 98 $(call strip_quotes, $(PSPNVRAM2_FILE)) \ 99 $(call strip_quotes, $(SMUSCS2_FILE)) \ 100 $(call strip_quotes, $(PSPSECUREDEBUG2_FILE)) \ 101 $(call strip_quotes, $(PSPTRUSTLETS2_FILE)) \ 102 $(call strip_quotes, $(TRUSTLETKEY2_FILE)) \ 103 $(call strip_quotes, $(SMUFIRMWARE2_2_FILE)) \ 104 $(call strip_quotes, $(SMUFIRMWARE2_2_FN_FILE)) \ 105 $(DEP_FILES) \ 106 $(AMDFWTOOL) 107 rm -f $@ 108 @printf " AMDFWTOOL $(subst $(obj)/,,$(@))\n" 109 $(AMDFWTOOL) \ 110 $(OPT_HUDSON_XHCI_FWM_FILE) \ 111 $(OPT_HUDSON_IMC_FWM_FILE) \ 112 $(OPT_HUDSON_GEC_FWM_FILE) \ 113 $(OPT_2AMD_PUBKEY_FILE) \ 114 $(OPT_2PSPBTLDR_FILE) \ 115 $(OPT_2SMUFWM_FILE) \ 116 $(OPT_2SMUFWM_FN_FILE) \ 117 $(OPT_2PSPRCVR_FILE) \ 118 $(OPT_2PUBSIGNEDKEY_FILE) \ 119 $(OPT_2PSPSECUREOS_FILE) \ 120 $(OPT_2PSPNVRAM_FILE) \ 121 $(OPT_2PSPSECUREDEBUG_FILE) \ 122 $(OPT_2PSPTRUSTLETS_FILE) \ 123 $(OPT_2TRUSTLETKEY_FILE) \ 124 $(OPT_2SMUFIRMWARE2_FILE) \ 125 $(OPT_2SMUFIRMWARE2_FN_FILE) \ 126 $(OPT_2SMUSCS_FILE) \ 127 --flashsize $(CONFIG_ROM_SIZE) \ 128 --location $(HUDSON_FWM_POSITION) \ 129 --config $(CONFIG_AMDFW_CONFIG_FILE) \ 130 --output $@ 131 132ifeq ($(CONFIG_AMDFW_OUTSIDE_CBFS),y) 133$(call add_intermediate, add_amdfw, $(obj)/amdfw.rom) 134 printf " DD Adding AMD Firmware\n" 135 dd if=$(obj)/amdfw.rom \ 136 of=$< conv=notrunc bs=1 seek=131072 >/dev/null 2>&1 137 138else # ifeq ($(CONFIG_AMDFW_OUTSIDE_CBFS),y) 139 140cbfs-files-y += apu/amdfw 141apu/amdfw-file := $(obj)/amdfw.rom 142apu/amdfw-position := $(HUDSON_FWM_POSITION) 143apu/amdfw-type := raw 144 145endif # ifeq ($(CONFIG_AMDFW_OUTSIDE_CBFS),y) 146