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 <bernacki@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/74269
Reviewed-by: Himanshu Sahdev <himanshu.sahdev@intel.com>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/src/soc/amd/mendocino/Makefile.inc b/src/soc/amd/mendocino/Makefile.inc
index 8e33cf5..ac7ec6d 100644
--- a/src/soc/amd/mendocino/Makefile.inc
+++ b/src/soc/amd/mendocino/Makefile.inc
@@ -31,6 +31,7 @@
 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 0000000..3dd9b6a
--- /dev/null
+++ b/src/soc/amd/mendocino/manifest.c
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <bootstate.h>
+#include <cbfs.h>
+
+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);