From b5c5177bc478a789b51abe73146d2d3027da4fde Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 5 Mar 2018 12:18:40 -0700 Subject: 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 Reviewed-on: https://review.coreboot.org/25011 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin Reviewed-by: Paul Menzel --- src/mainboard/google/kahlee/mainboard.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/mainboard/google/kahlee/mainboard.c') 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 #include #include #include @@ -21,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -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; +} -- cgit v1.2.3