[coreboot-gerrit] Patch set updated for coreboot: vendorcode/google: add common smbios mainboard version support
Aaron Durbin (adurbin@chromium.org)
gerrit at coreboot.org
Tue Nov 8 17:25:42 CET 2016
Aaron Durbin (adurbin at chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17290
-gerrit
commit a0fb4b8878d8440bb1901b55f2b3863c2c99f612
Author: Aaron Durbin <adurbin at chromium.org>
Date: Tue Nov 8 10:04:04 2016 -0600
vendorcode/google: add common smbios mainboard version support
Provide an option to deliver the mainboard smbios version in the
form of 'rev%d' based on the board_id() value.
BUG=chromium:663243
Signed-off-by: Aaron Durbin <adurbin at chromium.org>
Change-Id: If0a34935f570612da6e0c950fd7e8f0d92b6984f
---
src/vendorcode/google/Kconfig | 8 ++++++++
src/vendorcode/google/Makefile.inc | 2 ++
src/vendorcode/google/smbios.c | 27 +++++++++++++++++++++++++++
3 files changed, 37 insertions(+)
diff --git a/src/vendorcode/google/Kconfig b/src/vendorcode/google/Kconfig
index f275e6c..a572f9b 100644
--- a/src/vendorcode/google/Kconfig
+++ b/src/vendorcode/google/Kconfig
@@ -13,3 +13,11 @@
##
source src/vendorcode/google/chromeos/Kconfig
+
+config GOOGLE_SMBIOS_MAINBOARD_VERSION
+ bool
+ default n
+ depends on GENERATE_SMBIOS_TABLES
+ help
+ Provide a common implementation mainboard version
+ which gets put 'rev%d' as the version.
diff --git a/src/vendorcode/google/Makefile.inc b/src/vendorcode/google/Makefile.inc
index 6e950a1..60ff84d 100644
--- a/src/vendorcode/google/Makefile.inc
+++ b/src/vendorcode/google/Makefile.inc
@@ -14,3 +14,5 @@
##
subdirs-$(CONFIG_CHROMEOS) += chromeos
+
+ramstage-$(CONFIG_GOOGLE_SMBIOS_MAINBOARD_VERSION) += smbios.c
diff --git a/src/vendorcode/google/smbios.c b/src/vendorcode/google/smbios.c
new file mode 100644
index 0000000..7b147cd
--- /dev/null
+++ b/src/vendorcode/google/smbios.c
@@ -0,0 +1,27 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2016 Google 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 <boardid.h>
+#include <smbios.h>
+#include <string.h>
+
+const char *smbios_mainboard_version(void)
+{
+ static char str[8];
+
+ snprintf(str, sizeof(str), "rev%d", board_id());
+
+ return str;
+}
More information about the coreboot-gerrit
mailing list