Felix Held | 4a8cd72 | 2020-04-18 22:26:39 +0200 | [diff] [blame] | 1 | # SPDX-License-Identifier: BSD-3-Clause |
Felix Held | 4a8cd72 | 2020-04-18 22:26:39 +0200 | [diff] [blame] | 2 | |
Martin Roth | 1f33762 | 2019-04-22 16:08:31 -0600 | [diff] [blame] | 3 | ifeq ($(CONFIG_SOC_AMD_PICASSO),y) |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 4 | |
| 5 | subdirs-y += ../../../cpu/amd/mtrr/ |
| 6 | subdirs-y += ../../../cpu/x86/tsc |
| 7 | subdirs-y += ../../../cpu/x86/lapic |
| 8 | subdirs-y += ../../../cpu/x86/cache |
| 9 | subdirs-y += ../../../cpu/x86/mtrr |
| 10 | subdirs-y += ../../../cpu/x86/pae |
| 11 | subdirs-y += ../../../cpu/x86/smm |
| 12 | |
Felix Held | 4667322 | 2020-04-04 02:37:04 +0200 | [diff] [blame] | 13 | bootblock-y += bootblock/pre_c.S |
| 14 | bootblock-y += bootblock/bootblock.c |
| 15 | bootblock-y += southbridge.c |
| 16 | bootblock-y += i2c.c |
| 17 | bootblock-$(CONFIG_PICASSO_UART) += uart.c |
| 18 | bootblock-y += tsc_freq.c |
| 19 | bootblock-y += gpio.c |
| 20 | bootblock-y += smi_util.c |
Furquan Shaikh | 033aa0d | 2020-05-09 14:26:37 -0700 | [diff] [blame^] | 21 | bootblock-y += config.c |
Felix Held | 4667322 | 2020-04-04 02:37:04 +0200 | [diff] [blame] | 22 | |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 23 | romstage-y += i2c.c |
| 24 | romstage-y += romstage.c |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 25 | romstage-y += gpio.c |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 26 | romstage-y += pmutil.c |
Kyösti Mälkki | 047a9e4 | 2019-08-03 21:28:40 +0300 | [diff] [blame] | 27 | romstage-y += memmap.c |
Marshall Dawson | bc4c903 | 2019-06-11 12:18:20 -0600 | [diff] [blame] | 28 | romstage-$(CONFIG_PICASSO_UART) += uart.c |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 29 | romstage-y += tsc_freq.c |
| 30 | romstage-y += southbridge.c |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 31 | romstage-$(CONFIG_HAVE_SMI_HANDLER) += smi_util.c |
Martin Roth | 97bd2a7 | 2020-02-17 13:17:19 -0700 | [diff] [blame] | 32 | romstage-y += soc_util.c |
Marshall Dawson | 5a73fc3 | 2020-01-24 09:42:57 -0700 | [diff] [blame] | 33 | romstage-y += psp.c |
Raul E Rangel | e04c2c4 | 2020-04-30 16:26:30 -0600 | [diff] [blame] | 34 | romstage-y += mtrr.c |
Furquan Shaikh | 033aa0d | 2020-05-09 14:26:37 -0700 | [diff] [blame^] | 35 | romstage-y += config.c |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 36 | |
| 37 | verstage-y += gpio.c |
| 38 | verstage-y += i2c.c |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 39 | verstage-y += pmutil.c |
Furquan Shaikh | 033aa0d | 2020-05-09 14:26:37 -0700 | [diff] [blame^] | 40 | verstage-y += config.c |
Marshall Dawson | bc4c903 | 2019-06-11 12:18:20 -0600 | [diff] [blame] | 41 | verstage-$(CONFIG_PICASSO_UART) += uart.c |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 42 | verstage-y += tsc_freq.c |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 43 | |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 44 | ramstage-y += i2c.c |
| 45 | ramstage-y += chip.c |
| 46 | ramstage-y += cpu.c |
| 47 | ramstage-y += mca.c |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 48 | ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpi.c |
| 49 | ramstage-y += gpio.c |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 50 | ramstage-y += southbridge.c |
| 51 | ramstage-y += northbridge.c |
| 52 | ramstage-y += pmutil.c |
Marshall Dawson | 3edc9e2 | 2019-08-16 08:45:20 -0600 | [diff] [blame] | 53 | ramstage-y += acp.c |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 54 | ramstage-y += sata.c |
Kyösti Mälkki | 047a9e4 | 2019-08-03 21:28:40 +0300 | [diff] [blame] | 55 | ramstage-y += memmap.c |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 56 | ramstage-$(CONFIG_HAVE_SMI_HANDLER) += smi.c |
| 57 | ramstage-$(CONFIG_HAVE_SMI_HANDLER) += smi_util.c |
Marshall Dawson | bc4c903 | 2019-06-11 12:18:20 -0600 | [diff] [blame] | 58 | ramstage-$(CONFIG_PICASSO_UART) += uart.c |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 59 | ramstage-y += usb.c |
| 60 | ramstage-y += tsc_freq.c |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 61 | ramstage-y += finalize.c |
Martin Roth | 97bd2a7 | 2020-02-17 13:17:19 -0700 | [diff] [blame] | 62 | ramstage-y += soc_util.c |
Marshall Dawson | 5a73fc3 | 2020-01-24 09:42:57 -0700 | [diff] [blame] | 63 | ramstage-y += psp.c |
Aaron Durbin | 89e51e6 | 2020-04-09 14:16:55 -0600 | [diff] [blame] | 64 | ramstage-y += fsp_params.c |
Furquan Shaikh | 033aa0d | 2020-05-09 14:26:37 -0700 | [diff] [blame^] | 65 | ramstage-y += config.c |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 66 | |
Kyösti Mälkki | 9db3987 | 2019-12-13 18:11:05 +0200 | [diff] [blame] | 67 | all-y += reset.c |
| 68 | |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 69 | smm-y += smihandler.c |
| 70 | smm-y += smi_util.c |
| 71 | smm-y += tsc_freq.c |
| 72 | smm-$(CONFIG_DEBUG_SMI) += uart.c |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 73 | smm-y += gpio.c |
Marshall Dawson | 5a73fc3 | 2020-01-24 09:42:57 -0700 | [diff] [blame] | 74 | smm-y += psp.c |
Furquan Shaikh | 033aa0d | 2020-05-09 14:26:37 -0700 | [diff] [blame^] | 75 | smm-y += config.c |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 76 | |
Martin Roth | d7e3ead | 2019-04-22 16:32:58 -0600 | [diff] [blame] | 77 | CPPFLAGS_common += -I$(src)/soc/amd/picasso |
| 78 | CPPFLAGS_common += -I$(src)/soc/amd/picasso/include |
| 79 | CPPFLAGS_common += -I$(src)/soc/amd/picasso/acpi |
Marshall Dawson | 00a2208 | 2020-01-20 23:05:31 -0700 | [diff] [blame] | 80 | CPPFLAGS_common += -I$(src)/vendorcode/amd/fsp/picasso |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 81 | |
| 82 | # ROMSIG Normally At ROMBASE + 0x20000 |
| 83 | # Overridden by CONFIG_AMD_FWM_POSITION_INDEX |
| 84 | # +-----------+---------------+----------------+------------+ |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 85 | # |0x55AA55AA | | | | |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 86 | # +-----------+---------------+----------------+------------+ |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 87 | # | | PSPDIR ADDR | BIOSDIR ADDR | |
| 88 | # +-----------+---------------+----------------+ |
| 89 | |
Marshall Dawson | bc4c903 | 2019-06-11 12:18:20 -0600 | [diff] [blame] | 90 | PICASSO_FWM_POSITION=$(call int-add, \ |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 91 | $(call int-subtract, 0xffffffff \ |
| 92 | $(call int-shift-left, \ |
| 93 | 0x80000 $(CONFIG_AMD_FWM_POSITION_INDEX))) 0x20000 1) |
| 94 | |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 95 | # |
| 96 | # PSP Directory Table items |
| 97 | # |
| 98 | # Certain ordering requirements apply, however these are ensured by amdfwtool. |
| 99 | # For more information see "AMD Platform Security Processor BIOS Architecture |
| 100 | # Design Guide for AMD Family 17h Processors" (PID #55758, NDA only). |
| 101 | # |
| 102 | |
| 103 | # type = 0x0 |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 104 | FIRMWARE_LOCATE=$(dir $(call strip_quotes, $(CONFIG_AMD_PUBKEY_FILE))) |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 105 | |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 106 | # type = 0x1 |
| 107 | ifeq ($(CONFIG_HAVE_PSP_WHITELIST_FILE),y) |
| 108 | PSPBTLDR_FILE=$(top)/$(FIRMWARE_LOCATE)/PspBootLoader_WL_RV.sbin |
| 109 | else |
| 110 | PSPBTLDR_FILE=$(top)/$(FIRMWARE_LOCATE)/PspBootLoader_prod_RV.sbin |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 111 | endif |
| 112 | |
Furquan Shaikh | 9094410 | 2020-04-23 23:34:17 -0700 | [diff] [blame] | 113 | # types = 0x8 and 0x12 |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 114 | PSP_SMUFW1_SUB1_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmwareRV2.csbin |
| 115 | PSP_SMUFW1_SUB2_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmwarePCO.csbin |
| 116 | PSP_SMUFW2_SUB1_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmware2RV2.csbin |
| 117 | PSP_SMUFW2_SUB2_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmware2PCO.csbin |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 118 | |
Furquan Shaikh | 577db02 | 2020-04-24 15:52:04 -0700 | [diff] [blame] | 119 | ifeq ($(CONFIG_PSP_UNLOCK_SECURE_DEBUG),y) |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 120 | # type = 0x9 |
| 121 | PSP_SEC_DBG_KEY_FILE=$(top)/$(FIRMWARE_LOCATE)/RavenSecureDebug_PublicKey.bin |
Furquan Shaikh | 577db02 | 2020-04-24 15:52:04 -0700 | [diff] [blame] | 122 | # type = 0x13 |
| 123 | PSP_SEC_DEBUG_FILE=$(top)/$(FIRMWARE_LOCATE)/secure_unlock_prod_RV.sbin |
Furquan Shaikh | 318e583 | 2020-04-24 14:04:07 -0700 | [diff] [blame] | 124 | # Enable secure debug unlock |
| 125 | PSP_SOFTFUSE_BITS += 0 |
Furquan Shaikh | 577db02 | 2020-04-24 15:52:04 -0700 | [diff] [blame] | 126 | PSP_TOKEN_UNLOCK="--token-unlock" |
| 127 | endif |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 128 | |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 129 | ifeq ($(CONFIG_USE_PSPSCUREOS),y) |
Furquan Shaikh | 4e8b639 | 2020-04-23 19:48:28 -0700 | [diff] [blame] | 130 | # types = 0x2 |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 131 | PSPSCUREOS_FILE=$(top)/$(FIRMWARE_LOCATE)/psp_os_combined_prod_RV.sbin |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 132 | endif |
| 133 | |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 134 | # type = 0x21 |
| 135 | PSP_IKEK_FILE=$(top)/$(FIRMWARE_LOCATE)/PspIkekRV.bin |
| 136 | |
| 137 | # type = 0x24 |
| 138 | PSP_SECG1_FILE=$(top)/$(FIRMWARE_LOCATE)/security_policy_RV2_FP5_AM4.sbin |
| 139 | PSP_SECG2_FILE=$(top)/$(FIRMWARE_LOCATE)/security_policy_PCO_FP5_AM4.sbin |
| 140 | |
| 141 | ifeq ($(CONFIG_PSP_LOAD_MP2_FW),y) |
| 142 | # type = 0x25 |
| 143 | PSP_MP2FW1_FILE=$(top)/$(FIRMWARE_LOCATE)/MP2I2CFWRV2.sbin |
| 144 | PSP_MP2FW2_FILE=$(top)/$(FIRMWARE_LOCATE)/MP2I2CFWPCO.sbin |
| 145 | # BIOS type = 0x6a |
| 146 | PSP_MP2CFG_FILE=$(top)/$(FIRMWARE_LOCATE)/MP2FWConfig.sbin |
| 147 | else |
Furquan Shaikh | 318e583 | 2020-04-24 14:04:07 -0700 | [diff] [blame] | 148 | # Disable MP2 firmware loading |
| 149 | PSP_SOFTFUSE_BITS += 29 |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 150 | endif |
| 151 | |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 152 | # type = 0x28 |
| 153 | PSP_DRIVERS_FILE=$(top)/$(FIRMWARE_LOCATE)/drv_sys_prod_RV.sbin |
| 154 | |
| 155 | ifeq ($(CONFIG_PSP_LOAD_S0I3_FW),y) |
| 156 | PSP_S0I3_FILE=$(top)/$(FIRMWARE_LOCATE)/dr_agesa_prod_RV.sbin |
| 157 | endif |
| 158 | |
| 159 | # types = 0x30 - 0x37 |
| 160 | PSP_ABL0_FILE=$(top)/$(FIRMWARE_LOCATE)/AgesaBootloader0_prod_RV.csbin |
| 161 | PSP_ABL1_FILE=$(top)/$(FIRMWARE_LOCATE)/AgesaBootloader1_prod_RV.csbin |
| 162 | PSP_ABL2_FILE=$(top)/$(FIRMWARE_LOCATE)/AgesaBootloader2_prod_RV.csbin |
| 163 | PSP_ABL3_FILE=$(top)/$(FIRMWARE_LOCATE)/AgesaBootloader3_prod_RV.csbin |
| 164 | PSP_ABL4_FILE=$(top)/$(FIRMWARE_LOCATE)/AgesaBootloader4_prod_RV.csbin |
| 165 | PSP_ABL5_FILE=$(top)/$(FIRMWARE_LOCATE)/AgesaBootloader5_prod_RV.csbin |
| 166 | PSP_ABL6_FILE=$(top)/$(FIRMWARE_LOCATE)/AgesaBootloader6_prod_RV.csbin |
| 167 | PSP_ABL7_FILE=$(top)/$(FIRMWARE_LOCATE)/AgesaBootloader7_prod_RV.csbin |
| 168 | |
| 169 | # type = 0x3a |
| 170 | ifeq ($(CONFIG_HAVE_PSP_WHITELIST_FILE),y) |
| 171 | PSP_WHITELIST_FILE=$(CONFIG_PSP_WHITELIST_FILE) |
| 172 | endif |
| 173 | |
| 174 | # |
| 175 | # BIOS Directory Table items - proper ordering is managed by amdfwtool |
| 176 | # |
| 177 | |
| 178 | # type = 0x60 |
Marshall Dawson | 4357a82 | 2019-09-25 11:07:56 -0600 | [diff] [blame] | 179 | PSP_APCB0_FILE=$(call strip_quotes, $(CONFIG_PSP_APCB_FILE)) |
| 180 | PSP_APCB1_FILE=$(call strip_quotes, $(CONFIG_PSP_APCB1_FILE)) |
| 181 | PSP_APCB2_FILE=$(call strip_quotes, $(CONFIG_PSP_APCB2_FILE)) |
| 182 | PSP_APCB3_FILE=$(call strip_quotes, $(CONFIG_PSP_APCB3_FILE)) |
| 183 | PSP_APCB4_FILE=$(call strip_quotes, $(CONFIG_PSP_APCB4_FILE)) |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 184 | |
| 185 | # type = 0x61 |
| 186 | PSP_APOB_BASE=$(CONFIG_PSP_APOB_DESTINATION) |
| 187 | |
| 188 | # type = 0x62 |
| 189 | PSP_BIOSBIN_FILE=$(obj)/amd_biospsp.img |
Felix Held | 4667322 | 2020-04-04 02:37:04 +0200 | [diff] [blame] | 190 | PSP_ELF_FILE=$(objcbfs)/bootblock.elf |
| 191 | # TODO(b/154957411): Refactor amdfwtool to extract the address and size from |
| 192 | # the elf file. |
| 193 | PSP_BIOSBIN_SIZE=$(CONFIG_C_ENV_BOOTBLOCK_SIZE) |
| 194 | # This address must match the BOOTBLOCK logic in arch/x86/memlayout.ld. |
| 195 | PSP_BIOSBIN_DEST=$(shell printf "%x" $(call int-subtract, $(call int-add, $(CONFIG_X86_RESET_VECTOR) 0x10) $(PSP_BIOSBIN_SIZE))) |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 196 | |
| 197 | # type = 0x63 |
Marshall Dawson | cca7486 | 2019-12-12 12:38:45 -0700 | [diff] [blame] | 198 | ifeq ($(CONFIG_HAVE_ACPI_RESUME),y) |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 199 | PSP_APOBNV_BASE=$(CONFIG_PSP_APOB_NV_ADDRESS) |
| 200 | PSP_APOBNV_SIZE=$(CONFIG_PSP_APOB_NV_SIZE) |
Marshall Dawson | cca7486 | 2019-12-12 12:38:45 -0700 | [diff] [blame] | 201 | endif |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 202 | |
| 203 | # type2 = 0x64, 0x65 |
| 204 | PSP_PMUI_FILE1=$(top)/$(FIRMWARE_LOCATE)/Appb_Rv_1D_Ddr4_Udimm_Imem.csbin |
| 205 | PSP_PMUI_FILE2=$(top)/$(FIRMWARE_LOCATE)/Appb_Rv_2D_Ddr4_Imem.csbin |
| 206 | PSP_PMUI_FILE3=$(top)/$(FIRMWARE_LOCATE)/Appb_Rv2_1D_ddr4_Udimm_Imem.csbin |
| 207 | PSP_PMUI_FILE4=$(top)/$(FIRMWARE_LOCATE)/Appb_Rv2_2D_ddr4_Udimm_Imem.csbin |
| 208 | PSP_PMUD_FILE1=$(top)/$(FIRMWARE_LOCATE)/Appb_Rv_1D_Ddr4_Udimm_Dmem.csbin |
| 209 | PSP_PMUD_FILE2=$(top)/$(FIRMWARE_LOCATE)/Appb_Rv_2D_Ddr4_Dmem.csbin |
| 210 | PSP_PMUD_FILE3=$(top)/$(FIRMWARE_LOCATE)/Appb_Rv2_1D_ddr4_Udimm_Dmem.csbin |
| 211 | PSP_PMUD_FILE4=$(top)/$(FIRMWARE_LOCATE)/Appb_Rv2_2D_ddr4_Udimm_Dmem.csbin |
| 212 | |
| 213 | # type = 0x66 |
| 214 | PSP_UCODE_FILE1=$(top)/$(FIRMWARE_LOCATE)/UcodePatch_PCO_B1.bin |
| 215 | PSP_UCODE_FILE2=$(top)/$(FIRMWARE_LOCATE)/UcodePatch_PCO_B0.bin |
| 216 | PSP_UCODE_FILE3=$(top)/$(FIRMWARE_LOCATE)/UcodePatch_RV2_A0.bin |
| 217 | |
Furquan Shaikh | 318e583 | 2020-04-24 14:04:07 -0700 | [diff] [blame] | 218 | # type = 0xb - See #55758 (NDA) for bit definitions. |
| 219 | PSP_SOFTFUSE_BITS += 28 |
| 220 | |
| 221 | # Helper function to return a value with given bit set |
| 222 | set-bit=$(call int-shift-left, 1 $(call _toint,$1)) |
| 223 | PSP_SOFTFUSE=$(shell A=$(call int-add, \ |
| 224 | $(foreach bit,$(PSP_SOFTFUSE_BITS),$(call set-bit,$(bit)))); printf "0x%x" $$A) |
| 225 | |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 226 | # |
| 227 | # Build the arguments to amdfwtool (order is unimportant). Missing file names |
| 228 | # result in empty OPT_ variables, i.e. the argument is not passed to amdfwtool. |
| 229 | # |
| 230 | |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 231 | add_opt_prefix=$(if $(call strip_quotes, $(1)), $(2) $(call strip_quotes, $(1)), ) |
| 232 | |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 233 | OPT_AMD_PUBKEY_FILE=$(call add_opt_prefix, $(CONFIG_AMD_PUBKEY_FILE), --pubkey) |
| 234 | OPT_PSPBTLDR_FILE=$(call add_opt_prefix, $(PSPBTLDR_FILE), --bootloader) |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 235 | OPT_SMUFW1_SUB1_FILE=$(call add_opt_prefix, $(PSP_SMUFW1_SUB1_FILE), --subprogram 1 --smufirmware) |
| 236 | OPT_SMUFW1_SUB2_FILE=$(call add_opt_prefix, $(PSP_SMUFW1_SUB2_FILE), --subprogram 2 --smufirmware) |
| 237 | OPT_SMUFW2_SUB1_FILE=$(call add_opt_prefix, $(PSP_SMUFW2_SUB1_FILE), --subprogram 1 --smufirmware2) |
| 238 | OPT_SMUFW2_SUB2_FILE=$(call add_opt_prefix, $(PSP_SMUFW2_SUB2_FILE), --subprogram 2 --smufirmware2) |
| 239 | OPT_PSP_SEC_DBG_KEY_FILE=$(call add_opt_prefix, $(PSP_SEC_DBG_KEY_FILE), --securedebug) |
Furquan Shaikh | 577db02 | 2020-04-24 15:52:04 -0700 | [diff] [blame] | 240 | OPT_TOKEN_UNLOCK=$(call add_opt_prefix, $(PSP_TOKEN_UNLOCK), "") |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 241 | OPT_PSP_SOFTFUSE=$(call add_opt_prefix, $(PSP_SOFTFUSE), --soft-fuse) |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 242 | OPT_PSPSCUREOS_FILE=$(call add_opt_prefix, $(PSPSCUREOS_FILE), --secureos) |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 243 | OPT_SEC_DEBUG_FILE=$(call add_opt_prefix, $(PSP_SEC_DEBUG_FILE), --secdebug) |
| 244 | OPT_IKEK_FILE=$(call add_opt_prefix, $(PSP_IKEK_FILE), --ikek) |
| 245 | OPT_SECG1_FILE=$(call add_opt_prefix, $(PSP_SECG1_FILE), --subprog 1 --sec-gasket) |
| 246 | OPT_SECG2_FILE=$(call add_opt_prefix, $(PSP_SECG2_FILE), --subprog 2 --sec-gasket) |
| 247 | OPT_MP2FW1_FILE=$(call add_opt_prefix, $(PSP_MP2FW1_FILE), --subprog 1 --mp2-fw) |
| 248 | OPT_MP2FW2_FILE=$(call add_opt_prefix, $(PSP_MP2FW2_FILE), --subprog 2 --mp2-fw) |
| 249 | OPT_DRIVERS_FILE=$(call add_opt_prefix, $(PSP_DRIVERS_FILE), --drv-entry-pts) |
| 250 | OPT_PSP_S0I3_FILE=$(call add_opt_prefix, $(PSP_S0I3_FILE), --s0i3drv) |
| 251 | OPT_ABL0_FILE=$(call add_opt_prefix, $(PSP_ABL0_FILE), --abl-image) |
| 252 | OPT_ABL1_FILE=$(call add_opt_prefix, $(PSP_ABL1_FILE), --abl-image) |
| 253 | OPT_ABL2_FILE=$(call add_opt_prefix, $(PSP_ABL2_FILE), --abl-image) |
| 254 | OPT_ABL3_FILE=$(call add_opt_prefix, $(PSP_ABL3_FILE), --abl-image) |
| 255 | OPT_ABL4_FILE=$(call add_opt_prefix, $(PSP_ABL4_FILE), --abl-image) |
| 256 | OPT_ABL5_FILE=$(call add_opt_prefix, $(PSP_ABL5_FILE), --abl-image) |
| 257 | OPT_ABL6_FILE=$(call add_opt_prefix, $(PSP_ABL6_FILE), --abl-image) |
| 258 | OPT_ABL7_FILE=$(call add_opt_prefix, $(PSP_ABL7_FILE), --abl-image) |
| 259 | OPT_WHITELIST_FILE=$(call add_opt_prefix, $(PSP_WHITELIST_FILE), --whitelist) |
| 260 | |
Marshall Dawson | 4357a82 | 2019-09-25 11:07:56 -0600 | [diff] [blame] | 261 | OPT_PSP_APCB0_FILE=$(call add_opt_prefix, $(PSP_APCB0_FILE), --instance 0 --apcb) |
| 262 | OPT_PSP_APCB1_FILE=$(call add_opt_prefix, $(PSP_APCB1_FILE), --instance 1 --apcb) |
| 263 | OPT_PSP_APCB2_FILE=$(call add_opt_prefix, $(PSP_APCB2_FILE), --instance 2 --apcb) |
| 264 | OPT_PSP_APCB3_FILE=$(call add_opt_prefix, $(PSP_APCB3_FILE), --instance 3 --apcb) |
| 265 | OPT_PSP_APCB4_FILE=$(call add_opt_prefix, $(PSP_APCB4_FILE), --instance 4 --apcb) |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 266 | OPT_APOB_ADDR=$(call add_opt_prefix, $(PSP_APOB_BASE), --apob-base) |
| 267 | OPT_PSP_BIOSBIN_FILE=$(call add_opt_prefix, $(PSP_BIOSBIN_FILE), --bios-bin) |
| 268 | OPT_PSP_BIOSBIN_DEST=$(call add_opt_prefix, $(PSP_BIOSBIN_DEST), --bios-bin-dest) |
| 269 | OPT_PSP_BIOSBIN_SIZE=$(call add_opt_prefix, $(PSP_BIOSBIN_SIZE), --bios-uncomp-size) |
| 270 | OPT_APOBNV_ADDR=$(call add_opt_prefix, $(PSP_APOBNV_BASE), --apob-nv-base) |
| 271 | OPT_APOBNV_SIZE=$(call add_opt_prefix, $(PSP_APOBNV_SIZE), --apob-nv-size) |
| 272 | OPT_PSP_PMUI_FILE1=$(call add_opt_prefix, $(PSP_PMUI_FILE1), --subprogram 0 --instance 1 --pmu-inst) |
| 273 | OPT_PSP_PMUI_FILE2=$(call add_opt_prefix, $(PSP_PMUI_FILE2), --subprogram 0 --instance 4 --pmu-inst) |
| 274 | OPT_PSP_PMUI_FILE3=$(call add_opt_prefix, $(PSP_PMUI_FILE3), --subprogram 1 --instance 1 --pmu-inst) |
| 275 | OPT_PSP_PMUI_FILE4=$(call add_opt_prefix, $(PSP_PMUI_FILE4), --subprogram 1 --instance 4 --pmu-inst) |
| 276 | OPT_PSP_PMUD_FILE1=$(call add_opt_prefix, $(PSP_PMUD_FILE1), --subprogram 0 --instance 1 --pmu-data) |
| 277 | OPT_PSP_PMUD_FILE2=$(call add_opt_prefix, $(PSP_PMUD_FILE2), --subprogram 0 --instance 4 --pmu-data) |
| 278 | OPT_PSP_PMUD_FILE3=$(call add_opt_prefix, $(PSP_PMUD_FILE3), --subprogram 1 --instance 1 --pmu-data) |
| 279 | OPT_PSP_PMUD_FILE4=$(call add_opt_prefix, $(PSP_PMUD_FILE4), --subprogram 1 --instance 4 --pmu-data) |
| 280 | OPT_PSP_UCODE_FILE1=$(call add_opt_prefix, $(PSP_UCODE_FILE1), --instance 0 --ucode) |
| 281 | OPT_PSP_UCODE_FILE2=$(call add_opt_prefix, $(PSP_UCODE_FILE2), --instance 1 --ucode) |
| 282 | OPT_PSP_UCODE_FILE3=$(call add_opt_prefix, $(PSP_UCODE_FILE3), --instance 2 --ucode) |
| 283 | OPT_MP2CFG_FILE=$(call add_opt_prefix, $(PSP_MP2CFG_FILE), --mp2-config) |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 284 | |
Marshall Dawson | 19ea016 | 2019-06-11 12:34:04 -0600 | [diff] [blame] | 285 | $(obj)/amdfw.rom: $(call strip_quotes, $(CONFIG_AMD_PUBKEY_FILE)) \ |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 286 | $(call strip_quotes, $(PSPBTLDR_FILE)) \ |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 287 | $(call strip_quotes, $(PSPSCUREOS_FILE)) \ |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 288 | $(call strip_quotes, $(PSP_SEC_DBG_KEY_FILE)) \ |
Marshall Dawson | 4357a82 | 2019-09-25 11:07:56 -0600 | [diff] [blame] | 289 | $(call strip_quotes, $(PSP_APCB0_FILE)) \ |
| 290 | $(call strip_quotes, $(PSP_APCB1_FILE)) \ |
| 291 | $(call strip_quotes, $(PSP_APCB2_FILE)) \ |
| 292 | $(call strip_quotes, $(PSP_APCB3_FILE)) \ |
| 293 | $(call strip_quotes, $(PSP_APCB4_FILE)) \ |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 294 | $(call strip_quotes, $(PSP_BIOSBIN_FILE)) \ |
| 295 | $(call strip_quotes, $(PSP_PMUI_FILE1)) \ |
| 296 | $(call strip_quotes, $(PSP_PMUI_FILE2)) \ |
| 297 | $(call strip_quotes, $(PSP_PMUI_FILE3)) \ |
| 298 | $(call strip_quotes, $(PSP_PMUI_FILE4)) \ |
| 299 | $(call strip_quotes, $(PSP_PMUD_FILE1)) \ |
| 300 | $(call strip_quotes, $(PSP_PMUD_FILE2)) \ |
| 301 | $(call strip_quotes, $(PSP_PMUD_FILE3)) \ |
| 302 | $(call strip_quotes, $(PSP_PMUD_FILE4)) \ |
| 303 | $(call strip_quotes, $(PSP_UCODE_FILE1)) \ |
| 304 | $(call strip_quotes, $(PSP_UCODE_FILE2)) \ |
| 305 | $(call strip_quotes, $(PSP_UCODE_FILE3)) \ |
| 306 | $(call strip_quotes, $(PSP_MP2CFG_FILE)) \ |
| 307 | $(call strip_quotes, $(PSP_SMUFW1_SUB1_FILE)) \ |
| 308 | $(call strip_quotes, $(PSP_SMUFW1_SUB2_FILE)) \ |
| 309 | $(call strip_quotes, $(PSP_SMUFW2_SUB1_FILE)) \ |
| 310 | $(call strip_quotes, $(PSP_SMUFW2_SUB2_FILE)) \ |
| 311 | $(call strip_quotes, $(PSP_ABL0_FILE)) \ |
| 312 | $(call strip_quotes, $(PSP_ABL1_FILE)) \ |
| 313 | $(call strip_quotes, $(PSP_ABL2_FILE)) \ |
| 314 | $(call strip_quotes, $(PSP_ABL3_FILE)) \ |
| 315 | $(call strip_quotes, $(PSP_ABL4_FILE)) \ |
| 316 | $(call strip_quotes, $(PSP_ABL5_FILE)) \ |
| 317 | $(call strip_quotes, $(PSP_ABL6_FILE)) \ |
| 318 | $(call strip_quotes, $(PSP_ABL7_FILE)) \ |
| 319 | $(call strip_quotes, $(PSP_WHITELIST_FILE)) \ |
| 320 | $(call strip_quotes, $(PSP_SECG1_FILE)) \ |
| 321 | $(call strip_quotes, $(PSP_SECG2_FILE)) \ |
| 322 | $(call_strip_quotes, $(PSP_DRIVERS_FILE)) \ |
| 323 | $(call_strip_quotes, $(PSP_S0I3_FILE)) \ |
| 324 | $(call_strip_quotes, $(PSP_IKEK_FILE)) \ |
| 325 | $(call_strip_quotes, $(PSP_SEC_DEBUG_FILE)) \ |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 326 | $(AMDFWTOOL) |
| 327 | rm -f $@ |
| 328 | @printf " AMDFWTOOL $(subst $(obj)/,,$(@))\n" |
| 329 | $(AMDFWTOOL) \ |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 330 | $(OPT_AMD_PUBKEY_FILE) \ |
| 331 | $(OPT_PSPBTLDR_FILE) \ |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 332 | $(OPT_PSPSCUREOS_FILE) \ |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 333 | $(OPT_PSP_SEC_DBG_KEY_FILE) \ |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 334 | $(OPT_SMUFW1_SUB2_FILE) \ |
| 335 | $(OPT_SMUFW2_SUB2_FILE) \ |
| 336 | $(OPT_SMUFW1_SUB1_FILE) \ |
| 337 | $(OPT_SMUFW2_SUB1_FILE) \ |
Marshall Dawson | 4357a82 | 2019-09-25 11:07:56 -0600 | [diff] [blame] | 338 | $(OPT_PSP_APCB0_FILE) \ |
| 339 | $(OPT_PSP_APCB1_FILE) \ |
| 340 | $(OPT_PSP_APCB2_FILE) \ |
| 341 | $(OPT_PSP_APCB3_FILE) \ |
| 342 | $(OPT_PSP_APCB4_FILE) \ |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 343 | $(OPT_APOB_ADDR) \ |
| 344 | $(OPT_APOBNV_ADDR) \ |
| 345 | $(OPT_APOBNV_SIZE) \ |
| 346 | $(OPT_PSP_BIOSBIN_FILE) \ |
| 347 | $(OPT_PSP_BIOSBIN_DEST) \ |
| 348 | $(OPT_PSP_BIOSBIN_SIZE) \ |
| 349 | $(OPT_PSP_SOFTFUSE) \ |
| 350 | $(OPT_PSP_PMUI_FILE1) \ |
| 351 | $(OPT_PSP_PMUI_FILE2) \ |
| 352 | $(OPT_PSP_PMUI_FILE3) \ |
| 353 | $(OPT_PSP_PMUI_FILE4) \ |
| 354 | $(OPT_PSP_PMUD_FILE1) \ |
| 355 | $(OPT_PSP_PMUD_FILE2) \ |
| 356 | $(OPT_PSP_PMUD_FILE3) \ |
| 357 | $(OPT_PSP_PMUD_FILE4) \ |
| 358 | $(OPT_PSP_UCODE_FILE1) \ |
| 359 | $(OPT_PSP_UCODE_FILE2) \ |
| 360 | $(OPT_PSP_UCODE_FILE3) \ |
| 361 | $(OPT_MP2CFG_FILE) \ |
| 362 | $(OPT_ABL0_FILE) \ |
| 363 | $(OPT_ABL1_FILE) \ |
| 364 | $(OPT_ABL2_FILE) \ |
| 365 | $(OPT_ABL3_FILE) \ |
| 366 | $(OPT_ABL4_FILE) \ |
| 367 | $(OPT_ABL5_FILE) \ |
| 368 | $(OPT_ABL6_FILE) \ |
| 369 | $(OPT_ABL7_FILE) \ |
| 370 | $(OPT_WHITELIST_FILE) \ |
| 371 | $(OPT_SECG1_FILE) \ |
| 372 | $(OPT_SECG2_FILE) \ |
| 373 | $(OPT_MP2FW1_FILE) \ |
| 374 | $(OPT_MP2FW2_FILE) \ |
| 375 | $(OPT_DRIVERS_FILE) \ |
| 376 | $(OPT_PSP_S0I3_FILE) \ |
| 377 | $(OPT_IKEK_FILE) \ |
| 378 | $(OPT_SEC_DEBUG_FILE) \ |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 379 | --combo-capable \ |
Furquan Shaikh | 577db02 | 2020-04-24 15:52:04 -0700 | [diff] [blame] | 380 | $(OPT_TOKEN_UNLOCK) \ |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 381 | --flashsize $(CONFIG_ROM_SIZE) \ |
Marshall Dawson | bc4c903 | 2019-06-11 12:18:20 -0600 | [diff] [blame] | 382 | --location $(shell printf "0x%x" $(PICASSO_FWM_POSITION)) \ |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 383 | --output $@ |
| 384 | |
Felix Held | 4667322 | 2020-04-04 02:37:04 +0200 | [diff] [blame] | 385 | $(PSP_BIOSBIN_FILE): $(PSP_ELF_FILE) $(AMDCOMPRESS) |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 386 | rm -f $@ |
| 387 | @printf " AMDCOMPRS $(subst $(obj)/,,$(@))\n" |
Felix Held | 4667322 | 2020-04-04 02:37:04 +0200 | [diff] [blame] | 388 | $(AMDCOMPRESS) --infile $(PSP_ELF_FILE) --outfile $@ --compress \ |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 389 | --maxsize $(PSP_BIOSBIN_SIZE) |
| 390 | |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 391 | ifeq ($(CONFIG_AMDFW_OUTSIDE_CBFS),y) |
| 392 | PHONY+=add_amdfw |
| 393 | INTERMEDIATE+=add_amdfw |
| 394 | |
| 395 | # Calculate firmware position inside the ROM |
Marshall Dawson | bc4c903 | 2019-06-11 12:18:20 -0600 | [diff] [blame] | 396 | PICASSO_FWM_ROM_POSITION=$(call int-add, \ |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 397 | $(call int-subtract, $(CONFIG_ROM_SIZE) \ |
| 398 | $(call int-shift-left, \ |
| 399 | 0x80000 $(CONFIG_AMD_FWM_POSITION_INDEX))) 0x20000) |
| 400 | |
| 401 | add_amdfw: $(obj)/coreboot.pre $(obj)/amdfw.rom |
| 402 | printf " DD Adding AMD Firmware at ROM offset 0x%x\n" \ |
Marshall Dawson | bc4c903 | 2019-06-11 12:18:20 -0600 | [diff] [blame] | 403 | "$(PICASSO_FWM_ROM_POSITION)" |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 404 | dd oflag=seek_bytes \ |
| 405 | if=$(obj)/amdfw.rom \ |
| 406 | of=$(obj)/coreboot.pre conv=notrunc \ |
Marshall Dawson | bc4c903 | 2019-06-11 12:18:20 -0600 | [diff] [blame] | 407 | seek=$(PICASSO_FWM_ROM_POSITION) >/dev/null 2>&1 |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 408 | |
| 409 | else # ifeq ($(CONFIG_AMDFW_OUTSIDE_CBFS),y) |
| 410 | |
| 411 | cbfs-files-y += apu/amdfw |
| 412 | apu/amdfw-file := $(obj)/amdfw.rom |
Marshall Dawson | bc4c903 | 2019-06-11 12:18:20 -0600 | [diff] [blame] | 413 | apu/amdfw-position := $(PICASSO_FWM_POSITION) |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 414 | apu/amdfw-type := raw |
| 415 | |
| 416 | endif # ifeq ($(CONFIG_AMDFW_OUTSIDE_CBFS),y) |
| 417 | |
Martin Roth | 1f33762 | 2019-04-22 16:08:31 -0600 | [diff] [blame] | 418 | endif # ($(CONFIG_SOC_AMD_PICASSO),y) |