<p>Julius Werner has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/22743">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">libpayload: Add SKU ID coreboot table support<br><br>This patch adds support to read the SKU ID entry from the coreboot table<br>that was recently added in coreboot.<br><br>Change-Id: I1c3b375da6119a4f8e8e7e25a11644becb90f927<br>Signed-off-by: Julius Werner <jwerner@chromium.org><br>---<br>M payloads/libpayload/include/coreboot_tables.h<br>M payloads/libpayload/include/sysinfo.h<br>M payloads/libpayload/libc/coreboot.c<br>3 files changed, 12 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/43/22743/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/payloads/libpayload/include/coreboot_tables.h b/payloads/libpayload/include/coreboot_tables.h<br>index 5bc56d0..6b6d1b4 100644<br>--- a/payloads/libpayload/include/coreboot_tables.h<br>+++ b/payloads/libpayload/include/coreboot_tables.h<br>@@ -239,6 +239,7 @@<br> <br> #define CB_TAG_BOARD_ID 0x0025<br> #define CB_TAG_RAM_CODE 0x0028<br>+#define CB_TAG_SKU_ID 0x002d<br> struct cb_strapping_id {<br> uint32_t tag;<br> uint32_t size;<br>diff --git a/payloads/libpayload/include/sysinfo.h b/payloads/libpayload/include/sysinfo.h<br>index b46d4b1..f221a15 100644<br>--- a/payloads/libpayload/include/sysinfo.h<br>+++ b/payloads/libpayload/include/sysinfo.h<br>@@ -112,6 +112,7 @@<br> #define UNDEFINED_STRAPPING_ID (~0)<br> u32 board_id;<br> u32 ram_code;<br>+ u32 sku_id;<br> <br> void *wifi_calibration;<br> uint64_t ramoops_buffer;<br>diff --git a/payloads/libpayload/libc/coreboot.c b/payloads/libpayload/libc/coreboot.c<br>index 1efde9a..d831b96 100644<br>--- a/payloads/libpayload/libc/coreboot.c<br>+++ b/payloads/libpayload/libc/coreboot.c<br>@@ -157,6 +157,12 @@<br> info->ram_code = ram_code->id_code;<br> }<br> <br>+static void cb_parse_sku_id(unsigned char *ptr, struct sysinfo_t *info)<br>+{<br>+ struct cb_strapping_id *const sku_id = (struct cb_strapping_id *)ptr;<br>+ info->sku_id = sku_id->id_code;<br>+}<br>+<br> #if IS_ENABLED(CONFIG_LP_NVRAM)<br> static void cb_parse_optiontable(void *ptr, struct sysinfo_t *info)<br> {<br>@@ -280,6 +286,7 @@<br> /* Initialize IDs as undefined in case they don't show up in table. */<br> info->board_id = UNDEFINED_STRAPPING_ID;<br> info->ram_code = UNDEFINED_STRAPPING_ID;<br>+ info->sku_id = UNDEFINED_STRAPPING_ID;<br> <br> /* Now, walk the tables. */<br> ptr += header->header_bytes;<br>@@ -380,6 +387,9 @@<br> case CB_TAG_RAM_CODE:<br> cb_parse_ram_code(ptr, info);<br> break;<br>+ case CB_TAG_SKU_ID:<br>+ cb_parse_sku_id(ptr, info);<br>+ break;<br> case CB_TAG_WIFI_CALIBRATION:<br> cb_parse_wifi_calibration(ptr, info);<br> break;<br></pre><p>To view, visit <a href="https://review.coreboot.org/22743">change 22743</a>. To unsubscribe, 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/22743"/><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: I1c3b375da6119a4f8e8e7e25a11644becb90f927 </div>
<div style="display:none"> Gerrit-Change-Number: 22743 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Julius Werner <jwerner@chromium.org> </div>