Johnny Lin has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/41809 )
Change subject: lib/coreboot_table: Add Intel FSP version for cbmem to display ......................................................................
lib/coreboot_table: Add Intel FSP version for cbmem to display
Add Intel FSP version to coreboot table LB_TAG_EXTRA_VERSION when FSP_ADD_VERSION_TO_CBMEM is selected.
Change-Id: I92a13ca91b9f66a7517cfd6784f3f692ff34e765 Signed-off-by: Johnny Lin johnny_lin@wiwynn.com --- M src/lib/coreboot_table.c 1 file changed, 23 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/09/41809/1
diff --git a/src/lib/coreboot_table.c b/src/lib/coreboot_table.c index 075bd04..51c1cc3 100644 --- a/src/lib/coreboot_table.c +++ b/src/lib/coreboot_table.c @@ -31,6 +31,9 @@ #include <vendorcode/google/chromeos/chromeos.h> #include <vendorcode/google/chromeos/gnvs.h> #endif +#if CONFIG(FSP_ADD_VERSION_TO_CBMEM) +#include <fsp/util.h> +#endif
static struct lb_header *lb_table_init(unsigned long addr) { @@ -408,6 +411,23 @@
}
+#if CONFIG(FSP_ADD_VERSION_TO_CBMEM) +/* Add FSP version to coreboot table LB_TAG_EXTRA_VERSION */ +static void lb_strings_fsp_version(struct lb_header *header) +{ + struct lb_string *rec; + size_t len; + char fsp_version[FSP_VER_LEN] = {0}; + + fsp_get_version(fsp_version); + rec = (struct lb_string *)lb_new_record(header); + rec->tag = LB_TAG_EXTRA_VERSION; + len = strlen(fsp_version); + rec->size = ALIGN_UP(sizeof(*rec) + len + 1, 8); + memcpy(rec->string, fsp_version, len+1); +} +#endif + static void lb_record_version_timestamp(struct lb_header *header) { struct lb_timestamp *rec; @@ -516,6 +536,9 @@
/* Record our various random string information */ lb_strings(head); +#if CONFIG(FSP_ADD_VERSION_TO_CBMEM) + lb_strings_fsp_version(head); +#endif lb_record_version_timestamp(head); /* Record our framebuffer */ lb_framebuffer(head);