From 5ca1343b5fb3b07452e8c70868a11d5758c50339 Mon Sep 17 00:00:00 2001 From: Zheng Bao Date: Sun, 16 Oct 2022 20:18:40 +0800 Subject: amdfwtool: Add definition of instance for PSP entry Change-Id: I9f6250fd0e26cfae2cc2128ca9413a5621d2df0c Signed-off-by: Zheng Bao Reviewed-on: https://review.coreboot.org/c/coreboot/+/69044 Tested-by: build bot (Jenkins) Reviewed-by: Martin L Roth --- util/amdfwtool/amdfwtool.h | 12 +++++++++++- util/amdfwtool/data_parse.c | 4 +++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/util/amdfwtool/amdfwtool.h b/util/amdfwtool/amdfwtool.h index 3afa80e49a..a4ebbcd974 100644 --- a/util/amdfwtool/amdfwtool.h +++ b/util/amdfwtool/amdfwtool.h @@ -166,7 +166,16 @@ typedef struct _psp_directory_header { typedef struct _psp_directory_entry { uint8_t type; uint8_t subprog; - uint16_t rsvd; + union { + uint16_t rsvd; + struct { + uint8_t rom_id:2; + uint8_t writable:1; + uint8_t inst:4; + uint8_t rsvd_1:1; + uint8_t rsvd_2:8; + } __attribute__((packed)); + }; uint32_t size; uint64_t addr:62; /* or a value in some cases */ uint64_t address_mode:2; @@ -300,6 +309,7 @@ typedef struct _amd_fw_entry { uint16_t fw_id; char *filename; uint8_t subprog; + uint8_t inst; uint64_t dest; size_t size; int level; diff --git a/util/amdfwtool/data_parse.c b/util/amdfwtool/data_parse.c index 17284c3a4e..a28a7eb168 100644 --- a/util/amdfwtool/data_parse.c +++ b/util/amdfwtool/data_parse.c @@ -106,6 +106,7 @@ static uint8_t find_register_fw_filename_psp_dir(char *fw_name, char *filename, amd_fw_type fw_type = AMD_FW_INVALID; amd_fw_entry *psp_tableptr; uint8_t subprog; + uint8_t instance = 0; if (strcmp(fw_name, "PSPBTLDR_WL_FILE") == 0) { if (cb_config->have_whitelist) { @@ -380,7 +381,8 @@ static uint8_t find_register_fw_filename_psp_dir(char *fw_name, char *filename, if (fw_type != AMD_FW_SKIP && fw_type != AMD_FW_INVALID) { while (psp_tableptr->type != AMD_FW_INVALID) { /* instance are not used in PSP table */ - if (psp_tableptr->type == fw_type && psp_tableptr->subprog == subprog) { + if (psp_tableptr->type == fw_type && psp_tableptr->subprog == subprog + && psp_tableptr->inst == instance) { psp_tableptr->filename = filename; SET_LEVEL(psp_tableptr, level_to_set, PSP, cb_config->recovery_ab); -- cgit v1.2.3