Matt DeVillier has uploaded this change for review.
mb/google/glados/var/lars: Set SKU ID based on VPD
LARS has two variants, LARS and LILI, which are differentiated via
the customization_id field in the VPD. To make differentiation easier
outside of ChromeOS (ie, for Windows/Linux drivers), set the SKU ID
based on VPD so it can be easily read via SMBIOS.
Modeled after similar code in google/reef (snappy variant).
TEST=build/boot lili variant, verify sku1 populated in SMBIOS tables.
Change-Id: I148462b6f86b25fa8db26ea6e1537d1a5e47984b
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
---
M src/mainboard/google/glados/variants/lars/variant.c
1 file changed, 44 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/54/68754/1
diff --git a/src/mainboard/google/glados/variants/lars/variant.c b/src/mainboard/google/glados/variants/lars/variant.c
index a4e42b1..aead670 100644
--- a/src/mainboard/google/glados/variants/lars/variant.c
+++ b/src/mainboard/google/glados/variants/lars/variant.c
@@ -3,7 +3,9 @@
#include <stdint.h>
#include <string.h>
#include <baseboard/variant.h>
+#include <drivers/vpd/vpd.h>
#include <fsp/soc_binding.h>
+#include <smbios.h>
#define K4E6E304EB_MEM_ID 0x5
@@ -14,6 +16,9 @@
#define MEM_SINGLE_CHANB 0xb
#define MEM_SINGLE_CHANC 0xc
+#define VPD_KEY_CUSTOMIZATION_ID "customization_id"
+#define VPD_CUSTOMIZATION_LEN 32
+
void variant_memory_init_params(FSPM_UPD *mupd, const int spd_index)
{
FSP_M_CONFIG *mem_cfg;
@@ -63,3 +68,23 @@
&& spd_index != MEM_SINGLE_CHANB
&& spd_index != MEM_SINGLE_CHANC);
}
+
+/* SKU ID enumeration */
+#define SKU_LARS "sku0"
+#define SKU_LILI "sku1"
+
+const char *smbios_system_sku(void)
+{
+ if (!CONFIG(VPD))
+ return SKU_LARS;
+
+ static char customization_id[VPD_CUSTOMIZATION_LEN];
+ if (!vpd_gets(VPD_KEY_CUSTOMIZATION_ID, customization_id,
+ VPD_CUSTOMIZATION_LEN, VPD_RO))
+ return SKU_LARS;
+
+ if (strstr(customization_id, "LILI"))
+ return SKU_LILI;
+
+ return SKU_LARS;
+}
To view, visit change 68754. To unsubscribe, or for help writing mail filters, visit settings.