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 | |
Martin Roth | c7acf16 | 2020-05-28 00:44:50 -0600 | [diff] [blame] | 5 | subdirs-$(CONFIG_VBOOT_STARTS_BEFORE_BOOTBLOCK) += psp_verstage |
Kangheui Won | e20bc46 | 2021-04-06 16:55:48 +1000 | [diff] [blame] | 6 | subdirs-$(CONFIG_VBOOT_STARTS_BEFORE_BOOTBLOCK) += ../common/psp_verstage |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 7 | |
Felix Held | e7a0202 | 2020-12-10 02:05:47 +0100 | [diff] [blame] | 8 | # Beware that all-y also adds the compilation unit to verstage on PSP |
Felix Held | 1a341af | 2020-12-05 01:18:10 +0100 | [diff] [blame] | 9 | all-y += config.c |
Felix Held | 4074459 | 2020-12-09 16:12:41 +0100 | [diff] [blame] | 10 | all-y += aoac.c |
Felix Held | 1a341af | 2020-12-05 01:18:10 +0100 | [diff] [blame] | 11 | |
Felix Held | 0aada3c | 2020-11-24 22:55:53 +0100 | [diff] [blame] | 12 | bootblock-y += bootblock.c |
Felix Held | 187f59a | 2020-12-08 02:25:05 +0100 | [diff] [blame] | 13 | bootblock-y += early_fch.c |
Felix Held | 4667322 | 2020-04-04 02:37:04 +0200 | [diff] [blame] | 14 | bootblock-y += gpio.c |
Felix Held | aefcab7 | 2021-07-19 15:13:40 +0200 | [diff] [blame] | 15 | bootblock-y += i2c.c |
Martin Roth | 50cca76 | 2020-08-13 11:06:18 -0600 | [diff] [blame] | 16 | bootblock-y += reset.c |
Felix Held | aefcab7 | 2021-07-19 15:13:40 +0200 | [diff] [blame] | 17 | bootblock-y += uart.c |
Felix Held | 4667322 | 2020-04-04 02:37:04 +0200 | [diff] [blame] | 18 | |
Felix Held | dd73714 | 2021-03-26 00:44:35 +0100 | [diff] [blame] | 19 | romstage-y += fsp_m_params.c |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 20 | romstage-y += gpio.c |
Felix Held | aefcab7 | 2021-07-19 15:13:40 +0200 | [diff] [blame] | 21 | romstage-y += i2c.c |
Martin Roth | c7acf16 | 2020-05-28 00:44:50 -0600 | [diff] [blame] | 22 | romstage-y += reset.c |
Felix Held | aefcab7 | 2021-07-19 15:13:40 +0200 | [diff] [blame] | 23 | romstage-y += romstage.c |
Furquan Shaikh | ca481ee | 2020-06-13 00:16:26 -0700 | [diff] [blame] | 24 | romstage-y += uart.c |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 25 | |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 26 | verstage-y += i2c.c |
Martin Roth | c7acf16 | 2020-05-28 00:44:50 -0600 | [diff] [blame] | 27 | verstage_x86-y += gpio.c |
Martin Roth | c7acf16 | 2020-05-28 00:44:50 -0600 | [diff] [blame] | 28 | verstage_x86-y += reset.c |
Felix Held | aefcab7 | 2021-07-19 15:13:40 +0200 | [diff] [blame] | 29 | verstage_x86-y += uart.c |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 30 | |
Felix Held | aefcab7 | 2021-07-19 15:13:40 +0200 | [diff] [blame] | 31 | ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpi.c |
| 32 | ramstage-$(CONFIG_HAVE_ACPI_TABLES) += agesa_acpi.c |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 33 | ramstage-y += chip.c |
| 34 | ramstage-y += cpu.c |
Furquan Shaikh | 0c707d4 | 2020-07-08 16:54:40 -0700 | [diff] [blame] | 35 | ramstage-y += data_fabric.c |
Felix Held | 187f59a | 2020-12-08 02:25:05 +0100 | [diff] [blame] | 36 | ramstage-y += fch.c |
Felix Held | 793f371 | 2021-03-26 00:13:51 +0100 | [diff] [blame] | 37 | ramstage-y += fsp_s_params.c |
Felix Held | aefcab7 | 2021-07-19 15:13:40 +0200 | [diff] [blame] | 38 | ramstage-y += gpio.c |
Martin Roth | 86ba0d7 | 2020-02-05 16:46:30 -0700 | [diff] [blame] | 39 | ramstage-y += graphics.c |
Felix Held | aefcab7 | 2021-07-19 15:13:40 +0200 | [diff] [blame] | 40 | ramstage-y += i2c.c |
| 41 | ramstage-y += mca.c |
Furquan Shaikh | cff479e | 2020-07-08 15:47:19 -0700 | [diff] [blame] | 42 | ramstage-y += pcie_gpp.c |
Felix Held | aefcab7 | 2021-07-19 15:13:40 +0200 | [diff] [blame] | 43 | ramstage-y += reset.c |
| 44 | ramstage-y += root_complex.c |
| 45 | ramstage-y += sata.c |
| 46 | ramstage-y += soc_util.c |
| 47 | ramstage-y += uart.c |
Raul E Rangel | 0357ab7 | 2020-07-09 12:08:58 -0600 | [diff] [blame] | 48 | ramstage-y += xhci.c |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 49 | |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 50 | smm-y += smihandler.c |
Felix Held | 9412b3e | 2020-06-18 15:54:43 +0200 | [diff] [blame] | 51 | ifeq ($(CONFIG_DEBUG_SMI),y) |
| 52 | smm-y += uart.c |
Felix Held | 9412b3e | 2020-06-18 15:54:43 +0200 | [diff] [blame] | 53 | endif |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 54 | smm-y += gpio.c |
Marshall Dawson | 5c5049e | 2020-04-23 06:43:44 -0600 | [diff] [blame] | 55 | smm-y += smu.c |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 56 | |
Martin Roth | d7e3ead | 2019-04-22 16:32:58 -0600 | [diff] [blame] | 57 | CPPFLAGS_common += -I$(src)/soc/amd/picasso/include |
| 58 | CPPFLAGS_common += -I$(src)/soc/amd/picasso/acpi |
Marshall Dawson | 00a2208 | 2020-01-20 23:05:31 -0700 | [diff] [blame] | 59 | CPPFLAGS_common += -I$(src)/vendorcode/amd/fsp/picasso |
Martin Roth | 0f3ef70 | 2020-10-06 18:11:12 -0600 | [diff] [blame] | 60 | CPPFLAGS_common += -I$(src)/vendorcode/amd/fsp/picasso/include |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 61 | |
Raul E Rangel | cbaa835 | 2020-05-13 14:01:09 -0600 | [diff] [blame] | 62 | MAINBOARD_BLOBS_DIR:=$(top)/3rdparty/blobs/mainboard/$(MAINBOARDDIR) |
| 63 | |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 64 | # ROMSIG Normally At ROMBASE + 0x20000 |
| 65 | # Overridden by CONFIG_AMD_FWM_POSITION_INDEX |
| 66 | # +-----------+---------------+----------------+------------+ |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 67 | # |0x55AA55AA | | | | |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 68 | # +-----------+---------------+----------------+------------+ |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 69 | # | | PSPDIR ADDR | BIOSDIR ADDR | |
| 70 | # +-----------+---------------+----------------+ |
| 71 | |
Zheng Bao | 8516c21 | 2021-01-23 10:09:00 +0800 | [diff] [blame] | 72 | $(if $(CONFIG_AMD_FWM_POSITION_INDEX), ,\ |
| 73 | $(error Invalid AMD firmware position index. Check if the board sets a valid ROM size)) |
| 74 | |
Marshall Dawson | bc4c903 | 2019-06-11 12:18:20 -0600 | [diff] [blame] | 75 | PICASSO_FWM_POSITION=$(call int-add, \ |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 76 | $(call int-subtract, 0xffffffff \ |
| 77 | $(call int-shift-left, \ |
| 78 | 0x80000 $(CONFIG_AMD_FWM_POSITION_INDEX))) 0x20000 1) |
| 79 | |
Robert Zieba | b26d005 | 2022-01-24 16:37:47 -0700 | [diff] [blame] | 80 | # 0x40 accounts for the cbfs_file struct + filename + metadata structs, aligned to 64 bytes |
| 81 | # Building the cbfs image will fail if the offset isn't large enough |
| 82 | AMD_FW_AB_POSITION := 0x40 |
| 83 | |
| 84 | PICASSO_FW_A_POSITION=$(call int-add, \ |
| 85 | $(shell awk '$$2 == "FMAP_SECTION_FW_MAIN_A_START" {print $$3}' $(obj)/fmap_config.h) \ |
| 86 | $(AMD_FW_AB_POSITION)) |
| 87 | |
| 88 | PICASSO_FW_B_POSITION=$(call int-add, \ |
| 89 | $(shell awk '$$2 == "FMAP_SECTION_FW_MAIN_B_START" {print $$3}' $(obj)/fmap_config.h) \ |
| 90 | $(AMD_FW_AB_POSITION)) |
| 91 | |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 92 | # |
| 93 | # PSP Directory Table items |
| 94 | # |
| 95 | # Certain ordering requirements apply, however these are ensured by amdfwtool. |
| 96 | # For more information see "AMD Platform Security Processor BIOS Architecture |
| 97 | # Design Guide for AMD Family 17h Processors" (PID #55758, NDA only). |
| 98 | # |
| 99 | |
Zheng Bao | 3384e4a | 2020-10-06 12:03:11 +0800 | [diff] [blame] | 100 | FIRMWARE_LOCATION=$(shell grep -e FIRMWARE_LOCATION $(CONFIG_AMDFW_CONFIG_FILE) | awk '{print $$2}') |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 101 | |
Furquan Shaikh | 577db02 | 2020-04-24 15:52:04 -0700 | [diff] [blame] | 102 | ifeq ($(CONFIG_PSP_UNLOCK_SECURE_DEBUG),y) |
Furquan Shaikh | 318e583 | 2020-04-24 14:04:07 -0700 | [diff] [blame] | 103 | # Enable secure debug unlock |
| 104 | PSP_SOFTFUSE_BITS += 0 |
Zheng Bao | c5e28ab | 2020-10-28 11:38:09 +0800 | [diff] [blame] | 105 | OPT_TOKEN_UNLOCK="--token-unlock" |
Furquan Shaikh | 577db02 | 2020-04-24 15:52:04 -0700 | [diff] [blame] | 106 | endif |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 107 | |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 108 | ifeq ($(CONFIG_PSP_LOAD_MP2_FW),y) |
Zheng Bao | c5e28ab | 2020-10-28 11:38:09 +0800 | [diff] [blame] | 109 | OPT_PSP_LOAD_MP2_FW="--load-mp2-fw" |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 110 | else |
Furquan Shaikh | 318e583 | 2020-04-24 14:04:07 -0700 | [diff] [blame] | 111 | # Disable MP2 firmware loading |
| 112 | PSP_SOFTFUSE_BITS += 29 |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 113 | endif |
| 114 | |
Martin Roth | fdad5ad | 2021-04-16 11:36:01 -0600 | [diff] [blame] | 115 | # Use additional Soft Fuse bits specified in Kconfig |
Zheng Bao | 17022bb | 2021-05-13 22:38:05 +0800 | [diff] [blame] | 116 | PSP_SOFTFUSE_BITS += $(call strip_quotes, $(CONFIG_PSP_SOFTFUSE_BITS)) |
Martin Roth | fdad5ad | 2021-04-16 11:36:01 -0600 | [diff] [blame] | 117 | |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 118 | ifeq ($(CONFIG_PSP_LOAD_S0I3_FW),y) |
Zheng Bao | c5e28ab | 2020-10-28 11:38:09 +0800 | [diff] [blame] | 119 | OPT_PSP_LOAD_S0I3_FW="--load-s0i3" |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 120 | endif |
| 121 | |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 122 | # type = 0x3a |
| 123 | ifeq ($(CONFIG_HAVE_PSP_WHITELIST_FILE),y) |
| 124 | PSP_WHITELIST_FILE=$(CONFIG_PSP_WHITELIST_FILE) |
| 125 | endif |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 126 | # |
| 127 | # BIOS Directory Table items - proper ordering is managed by amdfwtool |
| 128 | # |
| 129 | |
| 130 | # type = 0x60 |
Rob Barnes | b2545cc | 2020-09-09 13:19:09 -0600 | [diff] [blame] | 131 | PSP_APCB_FILES=$(APCB_SOURCES) |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 132 | |
| 133 | # type = 0x61 |
Marshall Dawson | b768723 | 2020-01-20 19:56:30 -0700 | [diff] [blame] | 134 | PSP_APOB_BASE=$(CONFIG_PSP_APOB_DRAM_ADDRESS) |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 135 | |
| 136 | # type = 0x62 |
| 137 | PSP_BIOSBIN_FILE=$(obj)/amd_biospsp.img |
Felix Held | 4667322 | 2020-04-04 02:37:04 +0200 | [diff] [blame] | 138 | PSP_ELF_FILE=$(objcbfs)/bootblock.elf |
Zheng Bao | 944d00b | 2020-08-17 11:11:48 +0800 | [diff] [blame] | 139 | PSP_BIOSBIN_SIZE=$(shell $(READELF_bootblock) -l $(PSP_ELF_FILE) | grep LOAD | awk '{print $$5}') |
| 140 | PSP_BIOSBIN_DEST=$(shell $(READELF_bootblock) -l $(PSP_ELF_FILE) | grep LOAD | awk '{print $$3}') |
Marshall Dawson | b768723 | 2020-01-20 19:56:30 -0700 | [diff] [blame] | 141 | # type = 0x63 - construct APOB NV base/size from flash map |
Felix Held | 77a63ef | 2020-09-22 01:23:54 +0200 | [diff] [blame] | 142 | # The flashmap section used for this is expected to be named RW_MRC_CACHE |
Felix Held | 8ea26ae | 2021-03-08 16:42:11 +0100 | [diff] [blame] | 143 | APOB_NV_SIZE=$(shell awk '$$2 == "FMAP_SECTION_RW_MRC_CACHE_SIZE" {print $$3}' $(obj)/fmap_config.h) |
| 144 | APOB_NV_BASE=$(shell awk '$$2 == "FMAP_SECTION_RW_MRC_CACHE_START" {print $$3}' $(obj)/fmap_config.h) |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 145 | |
Martin Roth | 362eaf3 | 2020-06-14 10:38:32 -0600 | [diff] [blame] | 146 | ifeq ($(CONFIG_VBOOT_STARTS_BEFORE_BOOTBLOCK),y) |
| 147 | # type = 0x6B - PSP Shared memory location |
| 148 | ifneq ($(CONFIG_PSP_SHAREDMEM_SIZE),0x0) |
| 149 | PSP_SHAREDMEM_SIZE=$(CONFIG_PSP_SHAREDMEM_SIZE) |
Raul E Rangel | 42c5b01 | 2021-03-05 11:17:13 -0700 | [diff] [blame] | 150 | PSP_SHAREDMEM_BASE=$(shell awk '$$3 == "_psp_sharedmem_dram" {printf "0x" $$1}' $(objcbfs)/bootblock.map) |
Martin Roth | 362eaf3 | 2020-06-14 10:38:32 -0600 | [diff] [blame] | 151 | endif |
| 152 | |
| 153 | # type = 0x52 - PSP Bootloader Userspace Application (verstage) |
Martin Roth | de49833 | 2020-09-01 11:00:28 -0600 | [diff] [blame] | 154 | PSP_VERSTAGE_FILE=$(call strip_quotes,$(CONFIG_PSP_VERSTAGE_FILE)) |
Martin Roth | fe87d76 | 2020-09-01 11:04:21 -0600 | [diff] [blame] | 155 | PSP_VERSTAGE_SIG_FILE=$(call strip_quotes,$(CONFIG_PSP_VERSTAGE_SIGNING_TOKEN)) |
Martin Roth | 362eaf3 | 2020-06-14 10:38:32 -0600 | [diff] [blame] | 156 | endif # CONFIG_VBOOT_STARTS_BEFORE_BOOTBLOCK |
| 157 | |
Furquan Shaikh | 318e583 | 2020-04-24 14:04:07 -0700 | [diff] [blame] | 158 | |
| 159 | # Helper function to return a value with given bit set |
Martin Roth | fdad5ad | 2021-04-16 11:36:01 -0600 | [diff] [blame] | 160 | # Soft Fuse type = 0xb - See #55758 (NDA) for bit definitions. |
Furquan Shaikh | 318e583 | 2020-04-24 14:04:07 -0700 | [diff] [blame] | 161 | set-bit=$(call int-shift-left, 1 $(call _toint,$1)) |
| 162 | PSP_SOFTFUSE=$(shell A=$(call int-add, \ |
| 163 | $(foreach bit,$(PSP_SOFTFUSE_BITS),$(call set-bit,$(bit)))); printf "0x%x" $$A) |
| 164 | |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 165 | # |
| 166 | # Build the arguments to amdfwtool (order is unimportant). Missing file names |
| 167 | # result in empty OPT_ variables, i.e. the argument is not passed to amdfwtool. |
| 168 | # |
| 169 | |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 170 | add_opt_prefix=$(if $(call strip_quotes, $(1)), $(2) $(call strip_quotes, $(1)), ) |
| 171 | |
Martin Roth | 362eaf3 | 2020-06-14 10:38:32 -0600 | [diff] [blame] | 172 | OPT_VERSTAGE_FILE=$(call add_opt_prefix, $(PSP_VERSTAGE_FILE), --verstage) |
Martin Roth | fe87d76 | 2020-09-01 11:04:21 -0600 | [diff] [blame] | 173 | OPT_VERSTAGE_SIG_FILE=$(call add_opt_prefix, $(PSP_VERSTAGE_SIG_FILE), --verstage_sig) |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 174 | |
Raul E Rangel | cbaa835 | 2020-05-13 14:01:09 -0600 | [diff] [blame] | 175 | OPT_PSP_APCB_FILES=$(foreach i, $(shell seq $(words $(PSP_APCB_FILES))), \ |
| 176 | $(call add_opt_prefix, $(word $(i), $(PSP_APCB_FILES)), \ |
Zheng Bao | 5caca94 | 2020-12-04 16:39:38 +0800 | [diff] [blame] | 177 | --instance $(shell printf "%x" $$(($(i)-1))) --apcb ) ) |
| 178 | OPT_PSP_APCB_FILES_BK=$(foreach i, $(shell seq $(words $(PSP_APCB_FILES))), \ |
| 179 | $(call add_opt_prefix, $(word $(i), $(PSP_APCB_FILES)), \ |
| 180 | --instance $(shell printf "1%x" $$(($(i)-1))) --apcb ) ) |
Raul E Rangel | cbaa835 | 2020-05-13 14:01:09 -0600 | [diff] [blame] | 181 | |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 182 | OPT_APOB_ADDR=$(call add_opt_prefix, $(PSP_APOB_BASE), --apob-base) |
| 183 | OPT_PSP_BIOSBIN_FILE=$(call add_opt_prefix, $(PSP_BIOSBIN_FILE), --bios-bin) |
| 184 | OPT_PSP_BIOSBIN_DEST=$(call add_opt_prefix, $(PSP_BIOSBIN_DEST), --bios-bin-dest) |
| 185 | OPT_PSP_BIOSBIN_SIZE=$(call add_opt_prefix, $(PSP_BIOSBIN_SIZE), --bios-uncomp-size) |
Zheng Bao | c5e28ab | 2020-10-28 11:38:09 +0800 | [diff] [blame] | 186 | |
Martin Roth | 362eaf3 | 2020-06-14 10:38:32 -0600 | [diff] [blame] | 187 | OPT_PSP_SHAREDMEM_BASE=$(call add_opt_prefix, $(PSP_SHAREDMEM_BASE), --sharedmem) |
| 188 | OPT_PSP_SHAREDMEM_SIZE=$(call add_opt_prefix, $(PSP_SHAREDMEM_SIZE), --sharedmem-size) |
Martin Roth | 6e5f909 | 2020-06-25 17:31:54 -0600 | [diff] [blame] | 189 | OPT_APOB_NV_SIZE=$(call add_opt_prefix, $(APOB_NV_SIZE), --apob-nv-size) |
| 190 | OPT_APOB_NV_BASE=$(call add_opt_prefix, $(APOB_NV_BASE),--apob-nv-base) |
Matt Papageorge | 95c42c3 | 2020-07-08 11:33:48 -0500 | [diff] [blame] | 191 | OPT_EFS_SPI_READ_MODE=$(call add_opt_prefix, $(CONFIG_EFS_SPI_READ_MODE), --spi-read-mode) |
| 192 | OPT_EFS_SPI_SPEED=$(call add_opt_prefix, $(CONFIG_EFS_SPI_SPEED), --spi-speed) |
| 193 | OPT_EFS_SPI_MICRON_FLAG=$(call add_opt_prefix, $(CONFIG_EFS_SPI_MICRON_FLAG), --spi-micron-flag) |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 194 | |
Zheng Bao | c5e28ab | 2020-10-28 11:38:09 +0800 | [diff] [blame] | 195 | OPT_PSP_SOFTFUSE=$(call add_opt_prefix, $(PSP_SOFTFUSE), --soft-fuse) |
| 196 | |
Martin Roth | e2d0ba0 | 2020-07-29 16:37:57 -0600 | [diff] [blame] | 197 | ifeq ($(CONFIG_VBOOT),) |
| 198 | OPT_APOB0_NV_SIZE=$(OPT_APOB_NV_SIZE) |
| 199 | OPT_APOB0_NV_BASE=$(OPT_APOB_NV_BASE) |
| 200 | endif |
| 201 | |
Zheng Bao | c5e28ab | 2020-10-28 11:38:09 +0800 | [diff] [blame] | 202 | OPT_WHITELIST_FILE=$(call add_opt_prefix, $(PSP_WHITELIST_FILE), --whitelist) |
| 203 | |
| 204 | # Add all the files listed in the config file |
Zheng Bao | af2efbb | 2020-11-05 18:26:10 +0800 | [diff] [blame] | 205 | POUND_SIGN=$(call strip_quotes, "\#") |
| 206 | DEP_FILES= $(patsubst %,$(FIRMWARE_LOCATION)/%, $(shell sed -e /^$(POUND_SIGN)/d -e /^FIRMWARE_LOCATION/d $(CONFIG_AMDFW_CONFIG_FILE) | awk '{print $$2}' )) |
Zheng Bao | c5e28ab | 2020-10-28 11:38:09 +0800 | [diff] [blame] | 207 | |
| 208 | AMDFW_COMMON_ARGS=$(OPT_PSP_APCB_FILES) \ |
Zheng Bao | 5caca94 | 2020-12-04 16:39:38 +0800 | [diff] [blame] | 209 | $(OPT_PSP_APCB_FILES_BK) \ |
Martin Roth | 9aa8d11 | 2020-06-04 21:31:41 -0600 | [diff] [blame] | 210 | $(OPT_APOB_ADDR) \ |
Martin Roth | 9aa8d11 | 2020-06-04 21:31:41 -0600 | [diff] [blame] | 211 | $(OPT_PSP_BIOSBIN_FILE) \ |
| 212 | $(OPT_PSP_BIOSBIN_DEST) \ |
| 213 | $(OPT_PSP_BIOSBIN_SIZE) \ |
| 214 | $(OPT_PSP_SOFTFUSE) \ |
Felix Held | b03dc9c | 2021-02-12 21:59:47 +0100 | [diff] [blame] | 215 | --use-pspsecureos \ |
Zheng Bao | c5e28ab | 2020-10-28 11:38:09 +0800 | [diff] [blame] | 216 | $(OPT_PSP_LOAD_MP2_FW) \ |
| 217 | $(OPT_PSP_LOAD_S0I3_FW) \ |
Martin Roth | 9aa8d11 | 2020-06-04 21:31:41 -0600 | [diff] [blame] | 218 | $(OPT_WHITELIST_FILE) \ |
Martin Roth | 9aa8d11 | 2020-06-04 21:31:41 -0600 | [diff] [blame] | 219 | $(OPT_PSP_SHAREDMEM_BASE) \ |
| 220 | $(OPT_PSP_SHAREDMEM_SIZE) \ |
| 221 | --combo-capable \ |
| 222 | $(OPT_TOKEN_UNLOCK) \ |
Matt Papageorge | 95c42c3 | 2020-07-08 11:33:48 -0500 | [diff] [blame] | 223 | $(OPT_EFS_SPI_READ_MODE) \ |
| 224 | $(OPT_EFS_SPI_SPEED) \ |
| 225 | $(OPT_EFS_SPI_MICRON_FLAG) \ |
Zheng Bao | c5e28ab | 2020-10-28 11:38:09 +0800 | [diff] [blame] | 226 | --config $(CONFIG_AMDFW_CONFIG_FILE) \ |
Matt Papageorge | 95c42c3 | 2020-07-08 11:33:48 -0500 | [diff] [blame] | 227 | --soc-name "Picasso" \ |
Martin Roth | 9aa8d11 | 2020-06-04 21:31:41 -0600 | [diff] [blame] | 228 | --flashsize $(CONFIG_ROM_SIZE) |
| 229 | |
Zheng Bao | c5e28ab | 2020-10-28 11:38:09 +0800 | [diff] [blame] | 230 | $(obj)/amdfw.rom: $(call strip_quotes, $(PSP_BIOSBIN_FILE)) \ |
Martin Roth | 362eaf3 | 2020-06-14 10:38:32 -0600 | [diff] [blame] | 231 | $(PSP_VERSTAGE_FILE) \ |
Martin Roth | fe87d76 | 2020-09-01 11:04:21 -0600 | [diff] [blame] | 232 | $(PSP_VERSTAGE_SIG_FILE) \ |
Raul E Rangel | cbaa835 | 2020-05-13 14:01:09 -0600 | [diff] [blame] | 233 | $$(PSP_APCB_FILES) \ |
Zheng Bao | c5e28ab | 2020-10-28 11:38:09 +0800 | [diff] [blame] | 234 | $(DEP_FILES) \ |
Marshall Dawson | b768723 | 2020-01-20 19:56:30 -0700 | [diff] [blame] | 235 | $(AMDFWTOOL) \ |
Raul E Rangel | 42c5b01 | 2021-03-05 11:17:13 -0700 | [diff] [blame] | 236 | $(obj)/fmap_config.h \ |
| 237 | $(objcbfs)/bootblock.elf # this target also creates the .map file |
Rob Barnes | b2545cc | 2020-09-09 13:19:09 -0600 | [diff] [blame] | 238 | $(if $(PSP_APCB_FILES), ,$(error APCB_SOURCES is not set)) |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 239 | rm -f $@ |
| 240 | @printf " AMDFWTOOL $(subst $(obj)/,,$(@))\n" |
| 241 | $(AMDFWTOOL) \ |
Martin Roth | 9aa8d11 | 2020-06-04 21:31:41 -0600 | [diff] [blame] | 242 | $(AMDFW_COMMON_ARGS) \ |
Martin Roth | e2d0ba0 | 2020-07-29 16:37:57 -0600 | [diff] [blame] | 243 | $(OPT_APOB0_NV_SIZE) \ |
| 244 | $(OPT_APOB0_NV_BASE) \ |
Martin Roth | 7c4956d | 2020-09-01 11:05:53 -0600 | [diff] [blame] | 245 | $(OPT_VERSTAGE_FILE) \ |
Martin Roth | fe87d76 | 2020-09-01 11:04:21 -0600 | [diff] [blame] | 246 | $(OPT_VERSTAGE_SIG_FILE) \ |
Martin Roth | 9aa8d11 | 2020-06-04 21:31:41 -0600 | [diff] [blame] | 247 | --location $(shell printf "%#x" $(PICASSO_FWM_POSITION)) \ |
| 248 | --output $@ |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 249 | |
Felix Held | 4667322 | 2020-04-04 02:37:04 +0200 | [diff] [blame] | 250 | $(PSP_BIOSBIN_FILE): $(PSP_ELF_FILE) $(AMDCOMPRESS) |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 251 | rm -f $@ |
| 252 | @printf " AMDCOMPRS $(subst $(obj)/,,$(@))\n" |
Felix Held | 4667322 | 2020-04-04 02:37:04 +0200 | [diff] [blame] | 253 | $(AMDCOMPRESS) --infile $(PSP_ELF_FILE) --outfile $@ --compress \ |
Marshall Dawson | 6261141 | 2019-06-19 11:46:06 -0600 | [diff] [blame] | 254 | --maxsize $(PSP_BIOSBIN_SIZE) |
| 255 | |
Martin Roth | 9aa8d11 | 2020-06-04 21:31:41 -0600 | [diff] [blame] | 256 | $(obj)/amdfw_a.rom: $(obj)/amdfw.rom |
| 257 | rm -f $@ |
| 258 | @printf " AMDFWTOOL $(subst $(obj)/,,$(@))\n" |
| 259 | $(AMDFWTOOL) \ |
| 260 | $(AMDFW_COMMON_ARGS) \ |
Martin Roth | e2d0ba0 | 2020-07-29 16:37:57 -0600 | [diff] [blame] | 261 | $(OPT_APOB_NV_SIZE) \ |
| 262 | $(OPT_APOB_NV_BASE) \ |
Robert Zieba | b26d005 | 2022-01-24 16:37:47 -0700 | [diff] [blame] | 263 | --location $(shell printf "%#x" $(PICASSO_FW_A_POSITION)) \ |
Martin Roth | 9aa8d11 | 2020-06-04 21:31:41 -0600 | [diff] [blame] | 264 | --anywhere \ |
| 265 | --output $@ |
| 266 | |
| 267 | $(obj)/amdfw_b.rom: $(obj)/amdfw.rom |
| 268 | rm -f $@ |
| 269 | @printf " AMDFWTOOL $(subst $(obj)/,,$(@))\n" |
| 270 | $(AMDFWTOOL) \ |
| 271 | $(AMDFW_COMMON_ARGS) \ |
Martin Roth | e2d0ba0 | 2020-07-29 16:37:57 -0600 | [diff] [blame] | 272 | $(OPT_APOB_NV_SIZE) \ |
| 273 | $(OPT_APOB_NV_BASE) \ |
Robert Zieba | b26d005 | 2022-01-24 16:37:47 -0700 | [diff] [blame] | 274 | --location $(shell printf "%#x" $(PICASSO_FW_B_POSITION)) \ |
Martin Roth | 9aa8d11 | 2020-06-04 21:31:41 -0600 | [diff] [blame] | 275 | --anywhere \ |
| 276 | --output $@ |
| 277 | |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 278 | cbfs-files-y += apu/amdfw |
| 279 | apu/amdfw-file := $(obj)/amdfw.rom |
Marshall Dawson | bc4c903 | 2019-06-11 12:18:20 -0600 | [diff] [blame] | 280 | apu/amdfw-position := $(PICASSO_FWM_POSITION) |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 281 | apu/amdfw-type := raw |
| 282 | |
Martin Roth | 9aa8d11 | 2020-06-04 21:31:41 -0600 | [diff] [blame] | 283 | ifeq ($(CONFIG_VBOOT_SLOTS_RW_AB)$(CONFIG_VBOOT_STARTS_BEFORE_BOOTBLOCK),yy) |
| 284 | cbfs-files-y += apu/amdfw_a |
| 285 | apu/amdfw_a-file := $(obj)/amdfw_a.rom |
Robert Zieba | b26d005 | 2022-01-24 16:37:47 -0700 | [diff] [blame] | 286 | apu/amdfw_a-position := $(AMD_FW_AB_POSITION) |
Martin Roth | 9aa8d11 | 2020-06-04 21:31:41 -0600 | [diff] [blame] | 287 | apu/amdfw_a-type := raw |
| 288 | |
| 289 | cbfs-files-y += apu/amdfw_b |
| 290 | apu/amdfw_b-file := $(obj)/amdfw_b.rom |
Robert Zieba | b26d005 | 2022-01-24 16:37:47 -0700 | [diff] [blame] | 291 | apu/amdfw_b-position := $(AMD_FW_AB_POSITION) |
Martin Roth | 9aa8d11 | 2020-06-04 21:31:41 -0600 | [diff] [blame] | 292 | apu/amdfw_b-type := raw |
| 293 | endif |
| 294 | |
Zheng Bao | 13d6a46 | 2021-01-20 11:05:38 +0800 | [diff] [blame] | 295 | cpu_microcode_bins += $(wildcard ${FIRMWARE_LOCATION}/UcodePatch_*.bin) |
Zheng Bao | 6ba591b | 2020-06-09 09:47:06 +0800 | [diff] [blame] | 296 | |
Martin Roth | 1f33762 | 2019-04-22 16:08:31 -0600 | [diff] [blame] | 297 | endif # ($(CONFIG_SOC_AMD_PICASSO),y) |