aboutsummaryrefslogtreecommitdiff
path: root/src/vendorcode/google/smbios.c
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2016-11-08 10:04:04 -0600
committerAaron Durbin <adurbin@chromium.org>2016-11-09 16:52:06 +0100
commit15d2a79a1a50c9321267bfe1a8ee2be8767315a1 (patch)
treecaebb34c8821648ac10ee205dfa1147d0cb5410b /src/vendorcode/google/smbios.c
parent5577a475fcb22671aae2b483a1372b677c016cb9 (diff)
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 Change-Id: If0a34935f570612da6e0c950fd7e8f0d92b6984f Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/17290 Reviewed-by: Furquan Shaikh <furquan@google.com> Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/vendorcode/google/smbios.c')
-rw-r--r--src/vendorcode/google/smbios.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/vendorcode/google/smbios.c b/src/vendorcode/google/smbios.c
new file mode 100644
index 0000000000..7b147cdfe4
--- /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;
+}