amdfwtool: Add --output-manifest option

Passing this option tells amdfwtool to create a text file, containing
the versions of the blobs below:
- PSP bootloader (type 0x01),
- SMU firmware (type 0x08),
- AGESA bootloader 0 (type 0x30),
- PSP bootloader AB (type 0x73).

Created file can be embedded into CBFS which allows to read the version
of blobs at runtime. This way version of blobs used to build the
coreboot image can be verified at runtime and also from the binary file.

Format of manifest file is following:

    $ cat build/amdfw_manifest
    type: 0x01 ver:00.35.00.13
    type: 0x08 ver:00.5a.23.a6
    type: 0x30 ver:2a.14.b0.10
    type: 0x73 ver:00.35.00.13

BUG=b:224780134
TEST=Tested on Skyrim device

Change-Id: Idaa3a02ace524f44cfa656e34308bd896016dff6
Signed-off-by: Grzegorz Bernacki <bernacki@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/74266
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com>
This commit is contained in:
Grzegorz Bernacki
2023-04-05 09:35:42 +00:00
committed by Felix Held
parent 298732e190
commit dfdf81c32e
2 changed files with 76 additions and 5 deletions

View File

@@ -358,6 +358,7 @@ typedef struct _amd_fw_entry {
bool skip_hashing;
uint32_t num_hash_entries;
amd_fw_entry_hash *hash_entries;
bool generate_manifest;
} amd_fw_entry;
/* Most PSP binaries, if not all, have the following header format. */
@@ -375,7 +376,9 @@ struct amd_fw_header {
uint32_t comp_size;
/* Starting MDN fw_id is populated instead of fw_type. */
uint16_t fw_id;
uint8_t reserved_5a[18];
uint8_t reserved_5a[6];
uint8_t version[4];
uint8_t reserved_64[8];
uint32_t size_total;
uint8_t reserved_70[12];
/* Starting MDN fw_id is populated instead of fw_type. fw_type will still be around