Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 1 | # SPDX-License-Identifier: BSD-3-Clause |
| 2 | |
| 3 | # TODO: Move as much as possible to common |
Martin Roth | 20646cd | 2023-01-04 21:27:06 -0700 | [diff] [blame] | 4 | # TODO: Update for Phoenix |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 5 | |
Martin Roth | 20646cd | 2023-01-04 21:27:06 -0700 | [diff] [blame] | 6 | ifeq ($(CONFIG_SOC_AMD_PHOENIX),y) |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 7 | |
| 8 | subdirs-$(CONFIG_VBOOT_STARTS_BEFORE_BOOTBLOCK) += psp_verstage |
| 9 | |
| 10 | # Beware that all-y also adds the compilation unit to verstage on PSP |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 11 | all-y += aoac.c |
Felix Held | 46cd1b5 | 2023-04-01 01:21:27 +0200 | [diff] [blame^] | 12 | all-y += config.c |
| 13 | all-y += i2c.c |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 14 | |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 15 | bootblock-y += early_fch.c |
| 16 | bootblock-y += espi_util.c |
| 17 | bootblock-y += gpio.c |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 18 | bootblock-y += uart.c |
| 19 | |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 20 | verstage-y += espi_util.c |
| 21 | verstage_x86-y += gpio.c |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 22 | verstage_x86-y += uart.c |
| 23 | |
| 24 | romstage-y += fsp_m_params.c |
| 25 | romstage-y += gpio.c |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 26 | romstage-y += romstage.c |
Felix Held | 8f705b9 | 2023-02-06 19:56:35 +0100 | [diff] [blame] | 27 | romstage-y += soc_util.c |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 28 | romstage-y += uart.c |
| 29 | |
| 30 | ramstage-y += acpi.c |
| 31 | ramstage-y += agesa_acpi.c |
| 32 | ramstage-y += chip.c |
| 33 | ramstage-y += cpu.c |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 34 | ramstage-y += fch.c |
| 35 | ramstage-y += fsp_s_params.c |
| 36 | ramstage-y += gpio.c |
Ritul Guru | 4843ded | 2023-02-20 00:45:11 +0530 | [diff] [blame] | 37 | ramstage-y += graphics.c |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 38 | ramstage-y += mca.c |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 39 | ramstage-y += root_complex.c |
Felix Held | 8f705b9 | 2023-02-06 19:56:35 +0100 | [diff] [blame] | 40 | ramstage-y += soc_util.c |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 41 | ramstage-y += uart.c |
| 42 | ramstage-y += xhci.c |
| 43 | |
| 44 | smm-y += gpio.c |
| 45 | smm-y += smihandler.c |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 46 | smm-$(CONFIG_DEBUG_SMI) += uart.c |
| 47 | |
Martin Roth | 20646cd | 2023-01-04 21:27:06 -0700 | [diff] [blame] | 48 | CPPFLAGS_common += -I$(src)/soc/amd/phoenix/include |
| 49 | CPPFLAGS_common += -I$(src)/soc/amd/phoenix/acpi |
| 50 | CPPFLAGS_common += -I$(src)/vendorcode/amd/fsp/phoenix |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 51 | CPPFLAGS_common += -I$(src)/vendorcode/amd/fsp/common |
| 52 | |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 53 | # ROMSIG Normally At ROMBASE + 0x20000 |
| 54 | # Overridden by CONFIG_AMD_FWM_POSITION_INDEX |
| 55 | # +-----------+---------------+----------------+------------+ |
| 56 | # |0x55AA55AA | | | | |
| 57 | # +-----------+---------------+----------------+------------+ |
| 58 | # | | PSPDIR ADDR | BIOSDIR ADDR | |
| 59 | # +-----------+---------------+----------------+ |
| 60 | |
| 61 | $(if $(CONFIG_AMD_FWM_POSITION_INDEX), ,\ |
| 62 | $(error Invalid AMD firmware position index. Check if the board sets a valid ROM size)) |
| 63 | |
Martin Roth | b486fe9 | 2023-01-09 21:21:48 -0700 | [diff] [blame] | 64 | # Fixed EFS location |
| 65 | PHOENIX_FWM_POSITION=0xff020000 |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 66 | |
| 67 | # 0x40 accounts for the cbfs_file struct + filename + metadata structs, aligned to 64 bytes |
| 68 | # Building the cbfs image will fail if the offset isn't large enough |
| 69 | AMD_FW_AB_POSITION := 0x40 |
| 70 | |
Martin Roth | 20646cd | 2023-01-04 21:27:06 -0700 | [diff] [blame] | 71 | PHOENIX_FW_A_POSITION=$(call int-add, \ |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 72 | $(shell awk '$$2 == "FMAP_SECTION_FW_MAIN_A_START" {print $$3}' $(obj)/fmap_config.h) \ |
| 73 | $(AMD_FW_AB_POSITION)) |
| 74 | |
Martin Roth | 20646cd | 2023-01-04 21:27:06 -0700 | [diff] [blame] | 75 | PHOENIX_FW_B_POSITION=$(call int-add, \ |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 76 | $(shell awk '$$2 == "FMAP_SECTION_FW_MAIN_B_START" {print $$3}' $(obj)/fmap_config.h) \ |
| 77 | $(AMD_FW_AB_POSITION)) |
| 78 | # |
| 79 | # PSP Directory Table items |
| 80 | # |
| 81 | # Certain ordering requirements apply, however these are ensured by amdfwtool. |
| 82 | # For more information see "AMD Platform Security Processor BIOS Architecture |
| 83 | # Design Guide for AMD Family 17h Processors" (PID #55758, NDA only). |
| 84 | # |
| 85 | |
| 86 | ifeq ($(CONFIG_PSP_DISABLE_POSTCODES),y) |
| 87 | PSP_SOFTFUSE_BITS += 7 |
| 88 | endif |
| 89 | |
| 90 | ifeq ($(CONFIG_PSP_UNLOCK_SECURE_DEBUG),y) |
| 91 | # Enable secure debug unlock |
| 92 | PSP_SOFTFUSE_BITS += 0 |
| 93 | OPT_TOKEN_UNLOCK="--token-unlock" |
| 94 | endif |
| 95 | |
| 96 | ifeq ($(CONFIG_PSP_LOAD_MP2_FW),y) |
| 97 | OPT_PSP_LOAD_MP2_FW="--load-mp2-fw" |
| 98 | else |
| 99 | # Disable MP2 firmware loading |
| 100 | PSP_SOFTFUSE_BITS += 29 |
| 101 | endif |
| 102 | |
| 103 | # Use additional Soft Fuse bits specified in Kconfig |
| 104 | PSP_SOFTFUSE_BITS += $(call strip_quotes, $(CONFIG_PSP_SOFTFUSE_BITS)) |
| 105 | |
| 106 | # type = 0x3a |
| 107 | ifeq ($(CONFIG_HAVE_PSP_WHITELIST_FILE),y) |
| 108 | PSP_WHITELIST_FILE=$(CONFIG_PSP_WHITELIST_FILE) |
| 109 | endif |
| 110 | |
| 111 | # type = 0x55 |
| 112 | ifeq ($(CONFIG_HAVE_SPL_FILE),y) |
| 113 | SPL_TABLE_FILE=$(CONFIG_SPL_TABLE_FILE) |
| 114 | ifeq ($(CONFIG_HAVE_SPL_RW_AB_FILE),y) |
| 115 | SPL_RW_AB_TABLE_FILE=$(CONFIG_SPL_RW_AB_TABLE_FILE) |
| 116 | else |
| 117 | SPL_RW_AB_TABLE_FILE=$(CONFIG_SPL_TABLE_FILE) |
| 118 | endif |
| 119 | endif |
| 120 | |
| 121 | # |
| 122 | # BIOS Directory Table items - proper ordering is managed by amdfwtool |
| 123 | # |
| 124 | |
| 125 | # type = 0x60 |
| 126 | PSP_APCB_FILES=$(APCB_SOURCES) $(APCB_SOURCES_RECOVERY) |
| 127 | |
| 128 | # type = 0x61 |
| 129 | PSP_APOB_BASE=$(CONFIG_PSP_APOB_DRAM_ADDRESS) |
| 130 | |
| 131 | # type = 0x62 |
| 132 | PSP_BIOSBIN_FILE=$(obj)/amd_biospsp.img |
| 133 | PSP_ELF_FILE=$(objcbfs)/bootblock.elf |
Felix Held | 3b89c95 | 2022-11-22 20:02:46 +0100 | [diff] [blame] | 134 | PSP_BIOSBIN_SIZE=$(shell $(READELF_bootblock) -Wl $(PSP_ELF_FILE) | grep LOAD | awk '{print $$5}') |
| 135 | PSP_BIOSBIN_DEST=$(shell $(READELF_bootblock) -Wl $(PSP_ELF_FILE) | grep LOAD | awk '{print $$3}') |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 136 | |
| 137 | # type = 0x63 - construct APOB NV base/size from flash map |
| 138 | # The flashmap section used for this is expected to be named RW_MRC_CACHE |
| 139 | APOB_NV_SIZE=$(shell awk '$$2 == "FMAP_SECTION_RW_MRC_CACHE_SIZE" {print $$3}' $(obj)/fmap_config.h) |
| 140 | APOB_NV_BASE=$(shell awk '$$2 == "FMAP_SECTION_RW_MRC_CACHE_START" {print $$3}' $(obj)/fmap_config.h) |
| 141 | |
Zheng Bao | a4284b0 | 2023-02-01 13:16:52 +0800 | [diff] [blame] | 142 | ifeq ($(CONFIG_AMDFW_SPLIT),y) |
| 143 | FMAP_AMDFW_BODY_LOCATION=$(shell awk '$$2 == "FMAP_SECTION_AMDFWBODY_START" {print $$3}' $(obj)/fmap_config.h) |
| 144 | endif |
| 145 | |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -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) |
| 150 | PSP_SHAREDMEM_BASE=$(shell awk '$$3 == "_psp_sharedmem_dram" {printf "0x" $$1}' $(objcbfs)/bootblock.map) |
| 151 | endif |
| 152 | |
| 153 | # type = 0x52 - PSP Bootloader Userspace Application (verstage) |
| 154 | PSP_VERSTAGE_FILE=$(call strip_quotes,$(CONFIG_PSP_VERSTAGE_FILE)) |
| 155 | PSP_VERSTAGE_SIG_FILE=$(call strip_quotes,$(CONFIG_PSP_VERSTAGE_SIGNING_TOKEN)) |
| 156 | endif # CONFIG_VBOOT_STARTS_BEFORE_BOOTBLOCK |
| 157 | |
| 158 | ifeq ($(CONFIG_SEPARATE_SIGNED_PSPFW),y) |
| 159 | SIGNED_AMDFW_A_POSITION=$(call int-subtract, \ |
| 160 | $(shell awk '$$2 == "FMAP_SECTION_SIGNED_AMDFW_A_START" {print $$3}' $(obj)/fmap_config.h) \ |
| 161 | $(shell awk '$$2 == "FMAP_SECTION_FLASH_START" {print $$3}' $(obj)/fmap_config.h)) |
| 162 | SIGNED_AMDFW_B_POSITION=$(call int-subtract, \ |
| 163 | $(shell awk '$$2 == "FMAP_SECTION_SIGNED_AMDFW_B_START" {print $$3}' $(obj)/fmap_config.h) \ |
| 164 | $(shell awk '$$2 == "FMAP_SECTION_FLASH_START" {print $$3}' $(obj)/fmap_config.h)) |
| 165 | SIGNED_AMDFW_A_FILE=$(obj)/amdfw_a.rom.signed |
| 166 | SIGNED_AMDFW_B_FILE=$(obj)/amdfw_b.rom.signed |
| 167 | endif # CONFIG_SEPARATE_SIGNED_PSPFW |
| 168 | |
| 169 | # Helper function to return a value with given bit set |
| 170 | # Soft Fuse type = 0xb - See #55758 (NDA) for bit definitions. |
| 171 | set-bit=$(call int-shift-left, 1 $(call _toint,$1)) |
| 172 | PSP_SOFTFUSE=$(shell A=$(call int-add, \ |
| 173 | $(foreach bit,$(PSP_SOFTFUSE_BITS),$(call set-bit,$(bit)))); printf "0x%x" $$A) |
| 174 | |
| 175 | # |
| 176 | # Build the arguments to amdfwtool (order is unimportant). Missing file names |
| 177 | # result in empty OPT_ variables, i.e. the argument is not passed to amdfwtool. |
| 178 | # |
| 179 | |
| 180 | add_opt_prefix=$(if $(call strip_quotes, $(1)), $(2) $(call strip_quotes, $(1)), ) |
| 181 | |
| 182 | OPT_VERSTAGE_FILE=$(call add_opt_prefix, $(PSP_VERSTAGE_FILE), --verstage) |
| 183 | OPT_VERSTAGE_SIG_FILE=$(call add_opt_prefix, $(PSP_VERSTAGE_SIG_FILE), --verstage_sig) |
| 184 | |
| 185 | OPT_PSP_APCB_FILES= $(if $(APCB_SOURCES), --instance 0 --apcb $(APCB_SOURCES)) \ |
| 186 | $(if $(APCB_SOURCES_RECOVERY), --instance 10 --apcb $(APCB_SOURCES_RECOVERY)) \ |
| 187 | $(if $(APCB_SOURCES_68), --instance 18 --apcb $(APCB_SOURCES_68)) |
| 188 | |
| 189 | OPT_APOB_ADDR=$(call add_opt_prefix, $(PSP_APOB_BASE), --apob-base) |
| 190 | OPT_PSP_BIOSBIN_FILE=$(call add_opt_prefix, $(PSP_BIOSBIN_FILE), --bios-bin) |
| 191 | OPT_PSP_BIOSBIN_DEST=$(call add_opt_prefix, $(PSP_BIOSBIN_DEST), --bios-bin-dest) |
| 192 | OPT_PSP_BIOSBIN_SIZE=$(call add_opt_prefix, $(PSP_BIOSBIN_SIZE), --bios-uncomp-size) |
| 193 | |
| 194 | OPT_PSP_SHAREDMEM_BASE=$(call add_opt_prefix, $(PSP_SHAREDMEM_BASE), --sharedmem) |
| 195 | OPT_PSP_SHAREDMEM_SIZE=$(call add_opt_prefix, $(PSP_SHAREDMEM_SIZE), --sharedmem-size) |
| 196 | OPT_APOB_NV_SIZE=$(call add_opt_prefix, $(APOB_NV_SIZE), --apob-nv-size) |
| 197 | OPT_APOB_NV_BASE=$(call add_opt_prefix, $(APOB_NV_BASE),--apob-nv-base) |
| 198 | OPT_EFS_SPI_READ_MODE=$(call add_opt_prefix, $(CONFIG_EFS_SPI_READ_MODE), --spi-read-mode) |
| 199 | OPT_EFS_SPI_SPEED=$(call add_opt_prefix, $(CONFIG_EFS_SPI_SPEED), --spi-speed) |
| 200 | OPT_EFS_SPI_MICRON_FLAG=$(call add_opt_prefix, $(CONFIG_EFS_SPI_MICRON_FLAG), --spi-micron-flag) |
| 201 | |
| 202 | OPT_SIGNED_AMDFW_A_POSITION=$(call add_opt_prefix, $(SIGNED_AMDFW_A_POSITION), --signed-addr) |
| 203 | OPT_SIGNED_AMDFW_A_FILE=$(call add_opt_prefix, $(SIGNED_AMDFW_A_FILE), --signed-output) |
| 204 | OPT_SIGNED_AMDFW_B_POSITION=$(call add_opt_prefix, $(SIGNED_AMDFW_B_POSITION), --signed-addr) |
| 205 | OPT_SIGNED_AMDFW_B_FILE=$(call add_opt_prefix, $(SIGNED_AMDFW_B_FILE), --signed-output) |
| 206 | |
| 207 | OPT_PSP_SOFTFUSE=$(call add_opt_prefix, $(PSP_SOFTFUSE), --soft-fuse) |
| 208 | |
| 209 | OPT_WHITELIST_FILE=$(call add_opt_prefix, $(PSP_WHITELIST_FILE), --whitelist) |
| 210 | OPT_SPL_TABLE_FILE=$(call add_opt_prefix, $(SPL_TABLE_FILE), --spl-table) |
| 211 | OPT_SPL_RW_AB_TABLE_FILE=$(call add_opt_prefix, $(SPL_RW_AB_TABLE_FILE), --spl-table) |
| 212 | |
| 213 | # If vboot uses 2 RW slots, then 2 copies of PSP binaries are redundant |
| 214 | OPT_RECOVERY_AB_SINGLE_COPY=$(if $(CONFIG_VBOOT_SLOTS_RW_AB), --recovery-ab-single-copy) |
| 215 | |
Zheng Bao | a4284b0 | 2023-02-01 13:16:52 +0800 | [diff] [blame] | 216 | OPT_AMDFW_BODY_LOCATION=$(call add_opt_prefix, $(FMAP_AMDFW_BODY_LOCATION), --body-location) |
| 217 | |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 218 | AMDFW_COMMON_ARGS=$(OPT_PSP_APCB_FILES) \ |
| 219 | $(OPT_APOB_ADDR) \ |
Martin Roth | 0acf59d | 2023-03-08 15:18:24 -0700 | [diff] [blame] | 220 | $(OPT_DEBUG_AMDFWTOOL) \ |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 221 | $(OPT_PSP_BIOSBIN_FILE) \ |
| 222 | $(OPT_PSP_BIOSBIN_DEST) \ |
| 223 | $(OPT_PSP_BIOSBIN_SIZE) \ |
| 224 | $(OPT_PSP_SOFTFUSE) \ |
| 225 | $(OPT_PSP_LOAD_MP2_FW) \ |
| 226 | --use-pspsecureos \ |
| 227 | --load-s0i3 \ |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 228 | $(OPT_TOKEN_UNLOCK) \ |
| 229 | $(OPT_WHITELIST_FILE) \ |
| 230 | $(OPT_PSP_SHAREDMEM_BASE) \ |
| 231 | $(OPT_PSP_SHAREDMEM_SIZE) \ |
| 232 | $(OPT_EFS_SPI_READ_MODE) \ |
| 233 | $(OPT_EFS_SPI_SPEED) \ |
| 234 | $(OPT_EFS_SPI_MICRON_FLAG) \ |
| 235 | --config $(CONFIG_AMDFW_CONFIG_FILE) \ |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 236 | --flashsize $(CONFIG_ROM_SIZE) \ |
Zheng Bao | a4284b0 | 2023-02-01 13:16:52 +0800 | [diff] [blame] | 237 | $(OPT_RECOVERY_AB_SINGLE_COPY) \ |
| 238 | $(OPT_AMDFW_BODY_LOCATION) |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 239 | |
| 240 | $(obj)/amdfw.rom: $(call strip_quotes, $(PSP_BIOSBIN_FILE)) \ |
| 241 | $(PSP_VERSTAGE_FILE) \ |
| 242 | $(PSP_VERSTAGE_SIG_FILE) \ |
| 243 | $$(PSP_APCB_FILES) \ |
| 244 | $(DEP_FILES) \ |
| 245 | $(AMDFWTOOL) \ |
| 246 | $(obj)/fmap_config.h \ |
| 247 | $(objcbfs)/bootblock.elf # this target also creates the .map file |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 248 | rm -f $@ |
| 249 | @printf " AMDFWTOOL $(subst $(obj)/,,$(@))\n" |
| 250 | $(AMDFWTOOL) \ |
| 251 | $(AMDFW_COMMON_ARGS) \ |
| 252 | $(OPT_APOB_NV_SIZE) \ |
| 253 | $(OPT_APOB_NV_BASE) \ |
| 254 | $(OPT_VERSTAGE_FILE) \ |
| 255 | $(OPT_VERSTAGE_SIG_FILE) \ |
| 256 | $(OPT_SPL_TABLE_FILE) \ |
Martin Roth | 20646cd | 2023-01-04 21:27:06 -0700 | [diff] [blame] | 257 | --location $(shell printf "%#x" $(PHOENIX_FWM_POSITION)) \ |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 258 | --output $@ |
| 259 | |
Zheng Bao | a4284b0 | 2023-02-01 13:16:52 +0800 | [diff] [blame] | 260 | ifeq ($(CONFIG_AMDFW_SPLIT),y) |
| 261 | $(obj)/amdfw.rom.body: $(obj)/amdfw.rom |
| 262 | $(call add_intermediate, add_amdfwbody, $(obj)/amdfw.rom.body) |
| 263 | $(CBFSTOOL) $(obj)/coreboot.pre write -r AMDFWBODY -f $(obj)/amdfw.rom.body --fill-upward |
| 264 | endif |
| 265 | |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 266 | $(PSP_BIOSBIN_FILE): $(PSP_ELF_FILE) $(AMDCOMPRESS) |
| 267 | rm -f $@ |
| 268 | @printf " AMDCOMPRS $(subst $(obj)/,,$(@))\n" |
| 269 | $(AMDCOMPRESS) --infile $(PSP_ELF_FILE) --outfile $@ --compress \ |
| 270 | --maxsize $(PSP_BIOSBIN_SIZE) |
| 271 | |
| 272 | $(obj)/amdfw_a.rom: $(obj)/amdfw.rom |
| 273 | rm -f $@ |
| 274 | @printf " AMDFWTOOL $(subst $(obj)/,,$(@))\n" |
| 275 | $(AMDFWTOOL) \ |
| 276 | $(AMDFW_COMMON_ARGS) \ |
| 277 | $(OPT_APOB_NV_SIZE) \ |
| 278 | $(OPT_APOB_NV_BASE) \ |
| 279 | $(OPT_SPL_RW_AB_TABLE_FILE) \ |
| 280 | $(OPT_SIGNED_AMDFW_A_POSITION) \ |
| 281 | $(OPT_SIGNED_AMDFW_A_FILE) \ |
Martin Roth | 20646cd | 2023-01-04 21:27:06 -0700 | [diff] [blame] | 282 | --location $(shell printf "%#x" $(PHOENIX_FW_A_POSITION)) \ |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 283 | --anywhere \ |
| 284 | --output $@ |
| 285 | |
| 286 | $(obj)/amdfw_b.rom: $(obj)/amdfw.rom |
| 287 | rm -f $@ |
| 288 | @printf " AMDFWTOOL $(subst $(obj)/,,$(@))\n" |
| 289 | $(AMDFWTOOL) \ |
| 290 | $(AMDFW_COMMON_ARGS) \ |
| 291 | $(OPT_APOB_NV_SIZE) \ |
| 292 | $(OPT_APOB_NV_BASE) \ |
| 293 | $(OPT_SPL_RW_AB_TABLE_FILE) \ |
| 294 | $(OPT_SIGNED_AMDFW_B_POSITION) \ |
| 295 | $(OPT_SIGNED_AMDFW_B_FILE) \ |
Martin Roth | 20646cd | 2023-01-04 21:27:06 -0700 | [diff] [blame] | 296 | --location $(shell printf "%#x" $(PHOENIX_FW_B_POSITION)) \ |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 297 | --anywhere \ |
| 298 | --output $@ |
| 299 | |
| 300 | |
Martin Roth | 1a3de8e | 2022-10-06 15:57:21 -0600 | [diff] [blame] | 301 | ifeq ($(CONFIG_VBOOT_SLOTS_RW_AB)$(CONFIG_VBOOT_STARTS_BEFORE_BOOTBLOCK),yy) |
| 302 | cbfs-files-y += apu/amdfw_a |
| 303 | apu/amdfw_a-file := $(obj)/amdfw_a.rom |
| 304 | apu/amdfw_a-position := $(AMD_FW_AB_POSITION) |
| 305 | apu/amdfw_a-type := raw |
| 306 | |
| 307 | cbfs-files-y += apu/amdfw_b |
| 308 | apu/amdfw_b-file := $(obj)/amdfw_b.rom |
| 309 | apu/amdfw_b-position := $(AMD_FW_AB_POSITION) |
| 310 | apu/amdfw_b-type := raw |
| 311 | |
| 312 | ifeq ($(CONFIG_SEPARATE_SIGNED_PSPFW),y) |
| 313 | build_complete:: $(obj)/amdfw_a.rom $(obj)/amdfw_b.rom |
| 314 | @printf " Adding Signed ROM and HASH\n" |
| 315 | $(CBFSTOOL) $(obj)/coreboot.rom write -u -r SIGNED_AMDFW_A -i 0 -f $(obj)/amdfw_a.rom.signed |
| 316 | $(CBFSTOOL) $(obj)/coreboot.rom write -u -r SIGNED_AMDFW_B -i 0 -f $(obj)/amdfw_b.rom.signed |
| 317 | $(CBFSTOOL) $(obj)/coreboot.rom add -r FW_MAIN_A -f $(obj)/amdfw_a.rom.signed.hash \ |
| 318 | -n apu/amdfw_a_hash -t raw |
| 319 | $(CBFSTOOL) $(obj)/coreboot.rom add -r FW_MAIN_B -f $(obj)/amdfw_b.rom.signed.hash \ |
| 320 | -n apu/amdfw_b_hash -t raw |
| 321 | endif # CONFIG_SEPARATE_SIGNED_PSPFW |
| 322 | endif |
| 323 | |
Martin Roth | 20646cd | 2023-01-04 21:27:06 -0700 | [diff] [blame] | 324 | endif # ($(CONFIG_SOC_AMD_PHOENIX),y) |