<p>Zhuohao Lee has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/28426">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">mb/google/poppy/variants/rammus: add sku info into smbios table<br><br>This patch adds the mainboard.c in order to support the sku id in smbios<br>table where the sku id is queried from the eeprom via EC.<br><br>BUG=b:113714761<br>BRANCH=master<br>TEST=check the result of 'dmidecode'<br><br>Change-Id: I3413784cca1ac10a2468d84f2d06c0e1d701fdcb<br>Signed-off-by: Zhuohao Lee <zhuohao@chromium.org><br>---<br>M src/mainboard/google/poppy/variants/rammus/Makefile.inc<br>A src/mainboard/google/poppy/variants/rammus/include/variant/sku.h<br>A src/mainboard/google/poppy/variants/rammus/mainboard.c<br>3 files changed, 65 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/26/28426/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/mainboard/google/poppy/variants/rammus/Makefile.inc b/src/mainboard/google/poppy/variants/rammus/Makefile.inc</span><br><span>index eed7c44..9db2c21 100644</span><br><span>--- a/src/mainboard/google/poppy/variants/rammus/Makefile.inc</span><br><span>+++ b/src/mainboard/google/poppy/variants/rammus/Makefile.inc</span><br><span>@@ -6,3 +6,4 @@</span><br><span> </span><br><span> ramstage-y += gpio.c</span><br><span> ramstage-y += nhlt.c</span><br><span style="color: hsl(120, 100%, 40%);">+ramstage-y += mainboard.c</span><br><span>diff --git a/src/mainboard/google/poppy/variants/rammus/include/variant/sku.h b/src/mainboard/google/poppy/variants/rammus/include/variant/sku.h</span><br><span>new file mode 100644</span><br><span>index 0000000..9ed3a0f</span><br><span>--- /dev/null</span><br><span>+++ b/src/mainboard/google/poppy/variants/rammus/include/variant/sku.h</span><br><span>@@ -0,0 +1,21 @@</span><br><span style="color: hsl(120, 100%, 40%);">+/*</span><br><span style="color: hsl(120, 100%, 40%);">+ * This file is part of the coreboot project.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * Copyright 2018 Google Inc.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This program is free software; you can redistribute it and/or modify</span><br><span style="color: hsl(120, 100%, 40%);">+ * it under the terms of the GNU General Public License as published by</span><br><span style="color: hsl(120, 100%, 40%);">+ * the Free Software Foundation; version 2 of the License.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This program is distributed in the hope that it will be useful,</span><br><span style="color: hsl(120, 100%, 40%);">+ * but WITHOUT ANY WARRANTY; without even the implied warranty of</span><br><span style="color: hsl(120, 100%, 40%);">+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span><br><span style="color: hsl(120, 100%, 40%);">+ * GNU General Public License for more details.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#ifndef __MAINBOARD_SKU_H__</span><br><span style="color: hsl(120, 100%, 40%);">+#define __MAINBOARD_SKU_H__</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#define SKU_UNKNOWN     0xFFFFFFFF</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#endif /* __MAINBOARD_SKU_H__ */</span><br><span>diff --git a/src/mainboard/google/poppy/variants/rammus/mainboard.c b/src/mainboard/google/poppy/variants/rammus/mainboard.c</span><br><span>new file mode 100644</span><br><span>index 0000000..eb64ddf</span><br><span>--- /dev/null</span><br><span>+++ b/src/mainboard/google/poppy/variants/rammus/mainboard.c</span><br><span>@@ -0,0 +1,43 @@</span><br><span style="color: hsl(120, 100%, 40%);">+/*</span><br><span style="color: hsl(120, 100%, 40%);">+ * This file is part of the coreboot project.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * Copyright 2018 Google Inc.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This program is free software; you can redistribute it and/or modify</span><br><span style="color: hsl(120, 100%, 40%);">+ * it under the terms of the GNU General Public License as published by</span><br><span style="color: hsl(120, 100%, 40%);">+ * the Free Software Foundation; version 2 of the License.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This program is distributed in the hope that it will be useful,</span><br><span style="color: hsl(120, 100%, 40%);">+ * but WITHOUT ANY WARRANTY; without even the implied warranty of</span><br><span style="color: hsl(120, 100%, 40%);">+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span><br><span style="color: hsl(120, 100%, 40%);">+ * GNU General Public License for more details.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#include <baseboard/variants.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <ec/google/chromeec/ec.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <smbios.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <string.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <variant/sku.h></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+uint32_t variant_board_sku(void)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+    static uint32_t sku_id = SKU_UNKNOWN;</span><br><span style="color: hsl(120, 100%, 40%);">+ uint32_t id;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        if (sku_id != SKU_UNKNOWN)</span><br><span style="color: hsl(120, 100%, 40%);">+            return sku_id;</span><br><span style="color: hsl(120, 100%, 40%);">+        if (google_chromeec_cbi_get_sku_id(&id))</span><br><span style="color: hsl(120, 100%, 40%);">+          return SKU_UNKNOWN;</span><br><span style="color: hsl(120, 100%, 40%);">+   sku_id = id;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        return sku_id;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+const char *smbios_mainboard_sku(void)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+        static char sku_str[14]; /* sku{0..4294967295} */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   snprintf(sku_str, sizeof(sku_str), "sku%u", variant_board_sku());</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ return sku_str;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/28426">change 28426</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/28426"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I3413784cca1ac10a2468d84f2d06c0e1d701fdcb </div>
<div style="display:none"> Gerrit-Change-Number: 28426 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Zhuohao Lee <zhuohao@chromium.org> </div>