Martin Roth | 683bc5a | 2023-08-11 14:57:53 -0600 | [diff] [blame] | 1 | ## SPDX-License-Identifier: BSD-3-Clause |
| 2 | |
| 3 | # Copyright (c) 2012, Advanced Micro Devices, Inc. |
| 4 | # 2013 - 2014, Sage Electronic Engineering, LLC |
Kyösti Mälkki | e8b4da2 | 2014-10-21 18:22:32 +0300 | [diff] [blame] | 5 | |
Michał Żygowski | 8cee45c | 2019-11-23 18:03:46 +0100 | [diff] [blame] | 6 | bootblock-y += bootblock.c |
| 7 | bootblock-y += early_setup.c |
| 8 | bootblock-$(CONFIG_USBDEBUG) += enable_usbdebug.c |
Arthur Heymans | adc4753 | 2018-12-28 15:48:58 +0100 | [diff] [blame] | 9 | |
Marc Jones | 05b2f69 | 2017-05-03 15:52:09 -0600 | [diff] [blame] | 10 | romstage-y += early_setup.c |
Arthur Heymans | c63649b | 2019-11-16 12:13:03 +0100 | [diff] [blame] | 11 | romstage-y += enable_usbdebug.c |
Marc Jones | 05b2f69 | 2017-05-03 15:52:09 -0600 | [diff] [blame] | 12 | romstage-$(CONFIG_HUDSON_IMC_FWM) += imc.c |
| 13 | romstage-y += smbus.c |
| 14 | romstage-y += smbus_spd.c |
Marc Jones | 05b2f69 | 2017-05-03 15:52:09 -0600 | [diff] [blame] | 15 | |
| 16 | verstage-y += early_setup.c |
Marc Jones | 05b2f69 | 2017-05-03 15:52:09 -0600 | [diff] [blame] | 17 | |
Arthur Heymans | c63649b | 2019-11-16 12:13:03 +0100 | [diff] [blame] | 18 | ramstage-y += enable_usbdebug.c |
Marc Jones | 05b2f69 | 2017-05-03 15:52:09 -0600 | [diff] [blame] | 19 | ramstage-$(CONFIG_HAVE_ACPI_TABLES) += fadt.c |
Kyösti Mälkki | e8b4da2 | 2014-10-21 18:22:32 +0300 | [diff] [blame] | 20 | ramstage-y += hda.c |
Marc Jones | 05b2f69 | 2017-05-03 15:52:09 -0600 | [diff] [blame] | 21 | ramstage-y += hudson.c |
| 22 | ramstage-y += ide.c |
| 23 | ramstage-$(CONFIG_HUDSON_IMC_FWM) += imc.c |
| 24 | ramstage-y += lpc.c |
Kyösti Mälkki | e8b4da2 | 2014-10-21 18:22:32 +0300 | [diff] [blame] | 25 | ramstage-y += pci.c |
| 26 | ramstage-y += pcie.c |
Marc Jones | 05b2f69 | 2017-05-03 15:52:09 -0600 | [diff] [blame] | 27 | ramstage-y += sata.c |
| 28 | ramstage-y += sd.c |
| 29 | ramstage-y += sm.c |
| 30 | ramstage-$(CONFIG_HAVE_SMI_HANDLER) += smi.c |
| 31 | ramstage-$(CONFIG_HAVE_SMI_HANDLER) += smi_util.c |
Marc Jones | 05b2f69 | 2017-05-03 15:52:09 -0600 | [diff] [blame] | 32 | ramstage-y += usb.c |
Kyösti Mälkki | e8b4da2 | 2014-10-21 18:22:32 +0300 | [diff] [blame] | 33 | |
Kyösti Mälkki | 9db3987 | 2019-12-13 18:11:05 +0200 | [diff] [blame] | 34 | all-y += reset.c |
| 35 | |
Kyösti Mälkki | 9265f89 | 2019-07-07 23:58:34 +0300 | [diff] [blame] | 36 | smm-y += smihandler.c |
| 37 | smm-y += smi_util.c |
Kyösti Mälkki | e8b4da2 | 2014-10-21 18:22:32 +0300 | [diff] [blame] | 38 | |
Felix Held | 2768e36 | 2024-01-08 17:26:52 +0100 | [diff] [blame] | 39 | CPPFLAGS_common += -I$(src)/southbridge/amd/pi/hudson/include |
| 40 | |
Kyösti Mälkki | e8b4da2 | 2014-10-21 18:22:32 +0300 | [diff] [blame] | 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 | |
Kyösti Mälkki | 503f9fd | 2019-01-24 15:10:09 +0200 | [diff] [blame] | 50 | ifeq ($(CONFIG_AMDFW_OUTSIDE_CBFS),y) |
Ricardo Ribalda Delgado | baae959 | 2016-12-20 10:51:08 +0100 | [diff] [blame] | 51 | HUDSON_FWM_POSITION=$(call int-add, $(call int-subtract, 0xffffffff $(CONFIG_ROM_SIZE)) 0x20000 1) |
Kyösti Mälkki | 503f9fd | 2019-01-24 15:10:09 +0200 | [diff] [blame] | 52 | else |
| 53 | HUDSON_FWM_POSITION=0xfff20000 |
| 54 | endif |
Martin Roth | d12d65f | 2015-06-28 14:06:23 -0600 | [diff] [blame] | 55 | |
Kyösti Mälkki | e8b4da2 | 2014-10-21 18:22:32 +0300 | [diff] [blame] | 56 | ifeq ($(CONFIG_HUDSON_PSP), y) |
| 57 | |
Kyösti Mälkki | e8b4da2 | 2014-10-21 18:22:32 +0300 | [diff] [blame] | 58 | ifeq ($(CONFIG_CPU_AMD_PI_00730F01), y) |
Kyösti Mälkki | e8b4da2 | 2014-10-21 18:22:32 +0300 | [diff] [blame] | 59 | FIRMWARE_TYPE= |
Kyösti Mälkki | 8b8fbaf | 2019-01-24 15:07:37 +0200 | [diff] [blame] | 60 | |
Kyösti Mälkki | e8b4da2 | 2014-10-21 18:22:32 +0300 | [diff] [blame] | 61 | endif |
Kyösti Mälkki | 8b8fbaf | 2019-01-24 15:07:37 +0200 | [diff] [blame] | 62 | |
Zheng Bao | 3384e4a | 2020-10-06 12:03:11 +0800 | [diff] [blame] | 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 |
WANG Siyuan | f2dfef0 | 2015-05-20 14:41:01 +0800 | [diff] [blame] | 66 | |
Kyösti Mälkki | e8b4da2 | 2014-10-21 18:22:32 +0300 | [diff] [blame] | 67 | endif |
Zheng Bao | c64f21c | 2015-11-17 22:58:55 +0800 | [diff] [blame] | 68 | |
| 69 | add_opt_prefix=$(if $(call strip_quotes, $(1)), $(2) $(call strip_quotes, $(1)), ) |
| 70 | |
| 71 | OPT_HUDSON_XHCI_FWM_FILE=$(call add_opt_prefix, $(CONFIG_HUDSON_XHCI_FWM_FILE), --xhci) |
| 72 | OPT_HUDSON_IMC_FWM_FILE=$(call add_opt_prefix, $(CONFIG_HUDSON_IMC_FWM_FILE), --imc) |
| 73 | OPT_HUDSON_GEC_FWM_FILE=$(call add_opt_prefix, $(CONFIG_HUDSON_GEC_FWM_FILEddd), --gec) |
| 74 | |
Kyösti Mälkki | fa2786a | 2017-07-07 23:05:40 +0300 | [diff] [blame] | 75 | OPT_AMD_PUBKEY_FILE=$(call add_opt_prefix, $(CONFIG_AMD_PUBKEY_FILE), --pubkey) |
Martin Roth | de60e60 | 2017-09-07 13:52:19 -0600 | [diff] [blame] | 76 | OPT_PSPBTLDR_FILE=$(call add_opt_prefix, $(PSPBTLDR_FILE), --bootloader) |
| 77 | OPT_SMUFWM_FILE=$(call add_opt_prefix, $(SMUFWM_FILE), --smufirmware) |
| 78 | OPT_PSPRCVR_FILE=$(call add_opt_prefix, $(PSPRCVR_FILE), --recovery) |
| 79 | OPT_PUBSIGNEDKEY_FILE=$(call add_opt_prefix, $(PUBSIGNEDKEY_FILE), --rtmpubkey) |
Zheng Bao | 6252b60 | 2020-09-11 17:06:19 +0800 | [diff] [blame] | 80 | OPT_PSPSECUREOS_FILE=$(call add_opt_prefix, $(PSPSECUREOS_FILE), --secureos) |
Martin Roth | de60e60 | 2017-09-07 13:52:19 -0600 | [diff] [blame] | 81 | OPT_PSPNVRAM_FILE=$(call add_opt_prefix, $(PSPNVRAM_FILE), --nvram) |
| 82 | OPT_PSPSECUREDEBUG_FILE=$(call add_opt_prefix, $(PSPSECUREDEBUG_FILE), --securedebug) |
| 83 | OPT_PSPTRUSTLETS_FILE=$(call add_opt_prefix, $(PSPTRUSTLETS_FILE), --trustlets) |
| 84 | OPT_TRUSTLETKEY_FILE=$(call add_opt_prefix, $(TRUSTLETKEY_FILE), --trustletkey) |
| 85 | OPT_SMUFIRMWARE2_FILE=$(call add_opt_prefix, $(SMUFIRMWARE2_FILE), --smufirmware2) |
| 86 | OPT_SMUSCS_FILE=$(call add_opt_prefix, $(SMUSCS_FILE), --smuscs) |
Zheng Bao | c64f21c | 2015-11-17 22:58:55 +0800 | [diff] [blame] | 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)) \ |
Martin Roth | de60e60 | 2017-09-07 13:52:19 -0600 | [diff] [blame] | 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)) \ |
Zheng Bao | 6252b60 | 2020-09-11 17:06:19 +0800 | [diff] [blame] | 97 | $(call strip_quotes, $(PSPSECUREOS2_FILE)) \ |
Martin Roth | de60e60 | 2017-09-07 13:52:19 -0600 | [diff] [blame] | 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)) \ |
Zheng Bao | c5e28ab | 2020-10-28 11:38:09 +0800 | [diff] [blame] | 105 | $(DEP_FILES) \ |
Zheng Bao | c64f21c | 2015-11-17 22:58:55 +0800 | [diff] [blame] | 106 | $(AMDFWTOOL) |
| 107 | rm -f $@ |
Zheng Bao | a962e06 | 2015-12-08 23:41:37 +0800 | [diff] [blame] | 108 | @printf " AMDFWTOOL $(subst $(obj)/,,$(@))\n" |
Zheng Bao | c64f21c | 2015-11-17 22:58:55 +0800 | [diff] [blame] | 109 | $(AMDFWTOOL) \ |
| 110 | $(OPT_HUDSON_XHCI_FWM_FILE) \ |
| 111 | $(OPT_HUDSON_IMC_FWM_FILE) \ |
| 112 | $(OPT_HUDSON_GEC_FWM_FILE) \ |
Zheng Bao | c64f21c | 2015-11-17 22:58:55 +0800 | [diff] [blame] | 113 | $(OPT_2AMD_PUBKEY_FILE) \ |
| 114 | $(OPT_2PSPBTLDR_FILE) \ |
| 115 | $(OPT_2SMUFWM_FILE) \ |
Marshall Dawson | 0cd2cb6 | 2017-03-27 07:25:51 -0600 | [diff] [blame] | 116 | $(OPT_2SMUFWM_FN_FILE) \ |
Zheng Bao | c64f21c | 2015-11-17 22:58:55 +0800 | [diff] [blame] | 117 | $(OPT_2PSPRCVR_FILE) \ |
| 118 | $(OPT_2PUBSIGNEDKEY_FILE) \ |
Zheng Bao | 6252b60 | 2020-09-11 17:06:19 +0800 | [diff] [blame] | 119 | $(OPT_2PSPSECUREOS_FILE) \ |
Zheng Bao | c64f21c | 2015-11-17 22:58:55 +0800 | [diff] [blame] | 120 | $(OPT_2PSPNVRAM_FILE) \ |
| 121 | $(OPT_2PSPSECUREDEBUG_FILE) \ |
| 122 | $(OPT_2PSPTRUSTLETS_FILE) \ |
| 123 | $(OPT_2TRUSTLETKEY_FILE) \ |
| 124 | $(OPT_2SMUFIRMWARE2_FILE) \ |
Marshall Dawson | 0cd2cb6 | 2017-03-27 07:25:51 -0600 | [diff] [blame] | 125 | $(OPT_2SMUFIRMWARE2_FN_FILE) \ |
Zheng Bao | c64f21c | 2015-11-17 22:58:55 +0800 | [diff] [blame] | 126 | $(OPT_2SMUSCS_FILE) \ |
Martin Roth | d61b540 | 2016-11-08 11:49:58 -0700 | [diff] [blame] | 127 | --flashsize $(CONFIG_ROM_SIZE) \ |
Kyösti Mälkki | 503f9fd | 2019-01-24 15:10:09 +0200 | [diff] [blame] | 128 | --location $(HUDSON_FWM_POSITION) \ |
Zheng Bao | c5e28ab | 2020-10-28 11:38:09 +0800 | [diff] [blame] | 129 | --config $(CONFIG_AMDFW_CONFIG_FILE) \ |
Zheng Bao | c64f21c | 2015-11-17 22:58:55 +0800 | [diff] [blame] | 130 | --output $@ |
| 131 | |
Marshall Dawson | c6be0d8 | 2017-01-07 18:17:32 -0500 | [diff] [blame] | 132 | ifeq ($(CONFIG_AMDFW_OUTSIDE_CBFS),y) |
Patrick Georgi | 2cc5bcb | 2021-01-13 09:15:07 +0100 | [diff] [blame] | 133 | $(call add_intermediate, add_amdfw, $(obj)/amdfw.rom) |
Marshall Dawson | c6be0d8 | 2017-01-07 18:17:32 -0500 | [diff] [blame] | 134 | printf " DD Adding AMD Firmware\n" |
Patrick Georgi | 0b7d3a1 | 2021-01-13 09:16:41 +0100 | [diff] [blame] | 135 | dd if=$(obj)/amdfw.rom \ |
Arthur Heymans | 8ceef40 | 2021-07-06 16:20:09 +0200 | [diff] [blame] | 136 | of=$< conv=notrunc bs=1 seek=131072 >/dev/null 2>&1 |
Marshall Dawson | c6be0d8 | 2017-01-07 18:17:32 -0500 | [diff] [blame] | 137 | |
| 138 | else # ifeq ($(CONFIG_AMDFW_OUTSIDE_CBFS),y) |
| 139 | |
Zheng Bao | c64f21c | 2015-11-17 22:58:55 +0800 | [diff] [blame] | 140 | cbfs-files-y += apu/amdfw |
| 141 | apu/amdfw-file := $(obj)/amdfw.rom |
| 142 | apu/amdfw-position := $(HUDSON_FWM_POSITION) |
| 143 | apu/amdfw-type := raw |
Marshall Dawson | c6be0d8 | 2017-01-07 18:17:32 -0500 | [diff] [blame] | 144 | |
| 145 | endif # ifeq ($(CONFIG_AMDFW_OUTSIDE_CBFS),y) |