diff options
author | Simon Glass <sjg@chromium.org> | 2018-03-05 12:18:40 -0700 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2018-03-08 16:43:57 +0000 |
commit | b5c5177bc478a789b51abe73146d2d3027da4fde (patch) | |
tree | b22eedcc2896b76620817c7eef3482821db22594 /src/mainboard/google/kahlee/mainboard.c | |
parent | f393d43b97b83de500feaddcca52f02f9ecf1ceb (diff) | |
download | coreboot-b5c5177bc478a789b51abe73146d2d3027da4fde.tar.xz |
mb/google/kahlee: Add SKU support
We want to report the board SKU via the SMBIOS tables. Add support for
this, obtaining the ID itself from the EC.
BUG=b:74175244
BRANCH=none
TEST=manually on grunt with another CL:
mosys platform sku
0
Change-Id: I9e08d64df3f89d3703de047dd9ec8e1717e6b212
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://review.coreboot.org/25011
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'src/mainboard/google/kahlee/mainboard.c')
-rw-r--r-- | src/mainboard/google/kahlee/mainboard.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mainboard/google/kahlee/mainboard.c b/src/mainboard/google/kahlee/mainboard.c index 753a83ef70..e82569e485 100644 --- a/src/mainboard/google/kahlee/mainboard.c +++ b/src/mainboard/google/kahlee/mainboard.c @@ -13,6 +13,7 @@ * GNU General Public License for more details. */ +#include <string.h> #include <console/console.h> #include <device/device.h> #include <arch/acpi.h> @@ -21,6 +22,7 @@ #include <cbmem.h> #include <baseboard/variants.h> #include <boardid.h> +#include <smbios.h> #include <soc/nvs.h> #include <soc/pci_devs.h> #include <soc/smi.h> @@ -221,3 +223,18 @@ struct chip_operations mainboard_ops = { .enable_dev = kahlee_enable, .final = mainboard_final, }; + +/* Variants may override this function so see definitions in variants/ */ +uint8_t __attribute__((weak)) variant_board_sku(void) +{ + return 0; +} + +const char *smbios_mainboard_sku(void) +{ + static char sku_str[7]; /* sku{0..255} */ + + snprintf(sku_str, sizeof(sku_str), "sku%d", variant_board_sku()); + + return sku_str; +} |