From dd50efd43a610ce795c6294e2893723a30d58c71 Mon Sep 17 00:00:00 2001 From: Grzegorz Bernacki Date: Wed, 5 Apr 2023 10:46:08 +0000 Subject: soc/amd/mendocino: Print content of manifest file This adds printing content of 'manifest' file at ramstage. It allows to learn about blobs version used to build the coreboot binary, which is useful when investigating bugs. Version data are stored in CBFS file, which was generated during coreboot build. If AMD FW blobs will be manually replaced in coreboot image, versions from CBFS file are no longer valid. Log: AMDFW blobs version: type: 0x01 ver:00.3c.01.18 type: 0x08 ver:00.5a.28.00 type: 0x30 ver:2b.25.b0.10 type: 0x73 ver:00.3c.01.18 BUG=b:224780134 TEST=Tested on Skyrim device Change-Id: I8df54b74cd987b4a3be635932d38ea178d0b0311 Signed-off-by: Grzegorz Bernacki Reviewed-on: https://review.coreboot.org/c/coreboot/+/74269 Reviewed-by: Himanshu Sahdev Reviewed-by: Karthik Ramasubramanian Reviewed-by: Eric Lai Tested-by: build bot (Jenkins) --- src/soc/amd/mendocino/Makefile.inc | 1 + src/soc/amd/mendocino/manifest.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 src/soc/amd/mendocino/manifest.c (limited to 'src') diff --git a/src/soc/amd/mendocino/Makefile.inc b/src/soc/amd/mendocino/Makefile.inc index 8e33cf5167..ac7ec6d734 100644 --- a/src/soc/amd/mendocino/Makefile.inc +++ b/src/soc/amd/mendocino/Makefile.inc @@ -31,6 +31,7 @@ ramstage-y += fsp_s_params.c ramstage-y += mca.c ramstage-y += root_complex.c ramstage-y += xhci.c +ramstage-y += manifest.c smm-y += gpio.c smm-y += smihandler.c diff --git a/src/soc/amd/mendocino/manifest.c b/src/soc/amd/mendocino/manifest.c new file mode 100644 index 0000000000..3dd9b6ae43 --- /dev/null +++ b/src/soc/amd/mendocino/manifest.c @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include + +static void print_blob_version(void *arg) +{ + char *version; + size_t size; + + version = cbfs_map("amdfw_manifest", &size); + + if (!version) { + printk(BIOS_WARNING, "Failed to get amdfw_manifest\n"); + return; + } + + printk(BIOS_INFO, "AMDFW blobs version:\n"); + printk(BIOS_INFO, "%.*s", (int)size, version); + + cbfs_unmap(version); +} + +BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_LOAD, BS_ON_ENTRY, print_blob_version, NULL); -- cgit v1.2.3