Jonathan Zhang has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/42022 )
Change subject: mb/facebook/watson: support firmware version ......................................................................
mb/facebook/watson: support firmware version
SMBIOS type 0 has a field for overall firmware version. This version is the semantic version of the entire host firmware, with coreboot being part of it.
In build/release process, overall firmware version is expected to be updated into version variable in VPD_RO flash region.
If "version" key is found in VPD_RO flash region, use its value to fill in SMBIOS type 0. Otherwise, generate a BIOS_ERR message, concatenate "cb_ver:" and coreboot_version to fill in SMBIOS type 0.
Signed-off-by: Jonathan Zhang jonzhang@fb.com Change-Id: I831fe7019ddd75beb6824b8e09445f339bf7cc8d --- M src/mainboard/facebook/watson/Makefile.inc A src/mainboard/facebook/watson/ramstage.c 2 files changed, 46 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/22/42022/1
diff --git a/src/mainboard/facebook/watson/Makefile.inc b/src/mainboard/facebook/watson/Makefile.inc index f1384f7..17a5918 100644 --- a/src/mainboard/facebook/watson/Makefile.inc +++ b/src/mainboard/facebook/watson/Makefile.inc @@ -14,5 +14,6 @@ ##
ramstage-y += irqroute.c +ramstage-y += ramstage.c
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/include diff --git a/src/mainboard/facebook/watson/ramstage.c b/src/mainboard/facebook/watson/ramstage.c new file mode 100644 index 0000000..f844d03 --- /dev/null +++ b/src/mainboard/facebook/watson/ramstage.c @@ -0,0 +1,45 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2013 Google Inc. + * Copyright (C) 2015 Intel Corp. + * Copyright (C) 2020 Facebook Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include <console/console.h> +#include <drivers/vpd/vpd.h> +#include <smbios.h> +#include <version.h> +#include <string.h> + +#define VER_LEN 20 + +/* + * If "version" key is found in VPD_RO, use its value as overall + * firmware version; otherwise use coreboot_version as overall + * firmware version. + */ +const char *smbios_mainboard_bios_version(void) +{ + static char version[VER_LEN] = {0}; + + if (vpd_gets("version", version, VER_LEN, VPD_RO)) { + printk(BIOS_DEBUG, "Got version from VPD: %s\n", version); + } else { + static char cb_ver[] = "cb_ver:"; + strcpy(version, cb_ver); + strncpy(version + strlen(cb_ver), coreboot_version, + VER_LEN - strlen(cb_ver) - 1); + printk(BIOS_ERR, "Unable to get version from VPD, use %s\n", version); + } + return version; +}
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42022 )
Change subject: mb/facebook/watson: support firmware version ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42022/1/src/mainboard/facebook/wats... File src/mainboard/facebook/watson/ramstage.c:
https://review.coreboot.org/c/coreboot/+/42022/1/src/mainboard/facebook/wats... PS1, Line 38: static char cb_ver[] = "cb_ver:"; static char array declaration should probably be static const char
Hello build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42022
to look at the new patch set (#2).
Change subject: mb/facebook/watson: support firmware version ......................................................................
mb/facebook/watson: support firmware version
SMBIOS type 0 has a field for overall firmware version. This version is the semantic version of the entire host firmware, with coreboot being part of it.
In build/release process, overall firmware version is expected to be updated into version variable in VPD_RO flash region.
If "version" key is found in VPD_RO flash region, use its value to fill in SMBIOS type 0. Otherwise, generate a BIOS_ERR message, concatenate "cb_ver:" and coreboot_version to fill in SMBIOS type 0.
Signed-off-by: Jonathan Zhang jonzhang@fb.com Change-Id: I831fe7019ddd75beb6824b8e09445f339bf7cc8d --- M src/mainboard/facebook/watson/Kconfig M src/mainboard/facebook/watson/Makefile.inc A src/mainboard/facebook/watson/ramstage.c 3 files changed, 47 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/22/42022/2
Jonathan Zhang has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42022 )
Change subject: mb/facebook/watson: support firmware version ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42022/1/src/mainboard/facebook/wats... File src/mainboard/facebook/watson/ramstage.c:
https://review.coreboot.org/c/coreboot/+/42022/1/src/mainboard/facebook/wats... PS1, Line 38: static char cb_ver[] = "cb_ver:";
static char array declaration should probably be static const char
Done
insomniac has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42022 )
Change subject: mb/facebook/watson: support firmware version ......................................................................
Patch Set 2:
This is being generalized in https://review.coreboot.org/c/coreboot/+/42029/
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42022 )
Change subject: mb/facebook/watson: support firmware version ......................................................................
Patch Set 2: Code-Review+1
(3 comments)
https://review.coreboot.org/c/coreboot/+/42022/2//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/42022/2//COMMIT_MSG@7 PS2, Line 7: mb/facebook/watson: support firmware version It’d be nice to have *SMBIOS* in there:
Set SMBIOS firmware version
Populate …
https://review.coreboot.org/c/coreboot/+/42022/2/src/mainboard/facebook/wats... File src/mainboard/facebook/watson/ramstage.c:
https://review.coreboot.org/c/coreboot/+/42022/2/src/mainboard/facebook/wats... PS2, Line 16: */ Use SPDX header?
https://review.coreboot.org/c/coreboot/+/42022/2/src/mainboard/facebook/wats... PS2, Line 29: * firmware version. Re-flow for 80 or 96 characters to fit in two lines?
Jonathan Zhang has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42022 )
Change subject: mb/facebook/watson: support firmware version ......................................................................
Patch Set 2:
(3 comments)
https://review.coreboot.org/c/coreboot/+/42022/2//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/42022/2//COMMIT_MSG@7 PS2, Line 7: mb/facebook/watson: support firmware version
It’d be nice to have *SMBIOS* in there: […]
Done
https://review.coreboot.org/c/coreboot/+/42022/2/src/mainboard/facebook/wats... File src/mainboard/facebook/watson/ramstage.c:
https://review.coreboot.org/c/coreboot/+/42022/2/src/mainboard/facebook/wats... PS2, Line 16: */
Use SPDX header?
This patch is for 4.11 branch. I intend to align with the style of rest of the files.
https://review.coreboot.org/c/coreboot/+/42022/2/src/mainboard/facebook/wats... PS2, Line 29: * firmware version.
Re-flow for 80 or 96 characters to fit in two lines?
Done
Jonathan Zhang has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42022 )
Change subject: mb/facebook/watson: support firmware version ......................................................................
Patch Set 2:
Patch Set 2:
This is being generalized in https://review.coreboot.org/c/coreboot/+/42029/
42029 is for master branch. This PR is for 4.11 branch (the watson board family is not supported by master branch any longer).
Jonathan Zhang has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42022 )
Change subject: mb/facebook/watson: support firmware version ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42022/2/src/mainboard/facebook/wats... File src/mainboard/facebook/watson/ramstage.c:
https://review.coreboot.org/c/coreboot/+/42022/2/src/mainboard/facebook/wats... PS2, Line 16: */
This patch is for 4.11 branch. I intend to align with the style of rest of the files.
Done
Jonathan Zhang has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/42022 )
Change subject: mb/facebook/watson: support firmware version ......................................................................
Abandoned
[CB:42029] is a better implementation. It should be merged into 4.11 branch after merged into master.