util/amdfwtool: Support multiple firmware identifier types

Currently this tool generates a hash table to verify signed binaries,
with a 2 byte FWID as the only kind of identifier. Going forward some
binaries are going to adopt 16 byte UUID identifiers and more binaries
will follow in the future SoCs. Hence add support for handling multiple
firmware identifier types. While at this remove the unused fwid from the
PSP FW table.

BUG=b:277292697
TEST=Build BIOS image and boot to OS in Myst & Skyrim.

Change-Id: I5180dc0fe812b174b1d40fea9f00a85d6ef00f2f
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/76585
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
This commit is contained in:
Karthikeyan Ramasubramanian
2023-07-13 11:11:04 -06:00
committed by Martin L Roth
parent 71d60ce506
commit 24b5227091
3 changed files with 32 additions and 9 deletions

View File

@@ -330,6 +330,11 @@ typedef struct _ish_directory_table {
#define PSP_BOTH (PSP_LVL1 | PSP_LVL2)
#define PSP_BOTH_AB (PSP_LVL1_AB | PSP_LVL2_AB)
typedef enum _fwid_type {
FWID_TYPE_FWID = 0,
FWID_TYPE_UUID,
} fwid_type_t;
typedef struct _amd_fw_entry_hash {
uint16_t fw_id;
uint16_t subtype;
@@ -339,9 +344,6 @@ typedef struct _amd_fw_entry_hash {
typedef struct _amd_fw_entry {
amd_fw_type type;
/* Mendocino and later SoCs use fw_id instead of fw_type. fw_type is still around
for backwards compatibility. fw_id can be populated from the PSP binary file. */
uint16_t fw_id;
char *filename;
uint8_t subprog;
uint8_t inst;
@@ -358,6 +360,7 @@ typedef struct _amd_fw_entry {
include but not limited to: *iKek*, *.tkn, *.stkn */
bool skip_hashing;
uint8_t hash_tbl_id;
fwid_type_t fwid_type;
uint32_t num_hash_entries;
amd_fw_entry_hash *hash_entries;
bool generate_manifest;