[coreboot-gerrit] Change in coreboot[master]: libpayload: Add SKU ID coreboot table support

Julius Werner (Code Review) gerrit at coreboot.org
Tue Dec 5 22:51:22 CET 2017


Julius Werner has uploaded this change for review. ( https://review.coreboot.org/22743


Change subject: libpayload: Add SKU ID coreboot table support
......................................................................

libpayload: Add SKU ID coreboot table support

This patch adds support to read the SKU ID entry from the coreboot table
that was recently added in coreboot.

Change-Id: I1c3b375da6119a4f8e8e7e25a11644becb90f927
Signed-off-by: Julius Werner <jwerner at chromium.org>
---
M payloads/libpayload/include/coreboot_tables.h
M payloads/libpayload/include/sysinfo.h
M payloads/libpayload/libc/coreboot.c
3 files changed, 12 insertions(+), 0 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/43/22743/1

diff --git a/payloads/libpayload/include/coreboot_tables.h b/payloads/libpayload/include/coreboot_tables.h
index 5bc56d0..6b6d1b4 100644
--- a/payloads/libpayload/include/coreboot_tables.h
+++ b/payloads/libpayload/include/coreboot_tables.h
@@ -239,6 +239,7 @@
 
 #define CB_TAG_BOARD_ID		0x0025
 #define CB_TAG_RAM_CODE		0x0028
+#define CB_TAG_SKU_ID		0x002d
 struct cb_strapping_id {
 	uint32_t tag;
 	uint32_t size;
diff --git a/payloads/libpayload/include/sysinfo.h b/payloads/libpayload/include/sysinfo.h
index b46d4b1..f221a15 100644
--- a/payloads/libpayload/include/sysinfo.h
+++ b/payloads/libpayload/include/sysinfo.h
@@ -112,6 +112,7 @@
 #define UNDEFINED_STRAPPING_ID (~0)
 	u32		board_id;
 	u32		ram_code;
+	u32		sku_id;
 
 	void		*wifi_calibration;
 	uint64_t	ramoops_buffer;
diff --git a/payloads/libpayload/libc/coreboot.c b/payloads/libpayload/libc/coreboot.c
index 1efde9a..d831b96 100644
--- a/payloads/libpayload/libc/coreboot.c
+++ b/payloads/libpayload/libc/coreboot.c
@@ -157,6 +157,12 @@
 	info->ram_code = ram_code->id_code;
 }
 
+static void cb_parse_sku_id(unsigned char *ptr, struct sysinfo_t *info)
+{
+	struct cb_strapping_id *const sku_id = (struct cb_strapping_id *)ptr;
+	info->sku_id = sku_id->id_code;
+}
+
 #if IS_ENABLED(CONFIG_LP_NVRAM)
 static void cb_parse_optiontable(void *ptr, struct sysinfo_t *info)
 {
@@ -280,6 +286,7 @@
 	/* Initialize IDs as undefined in case they don't show up in table. */
 	info->board_id = UNDEFINED_STRAPPING_ID;
 	info->ram_code = UNDEFINED_STRAPPING_ID;
+	info->sku_id = UNDEFINED_STRAPPING_ID;
 
 	/* Now, walk the tables. */
 	ptr += header->header_bytes;
@@ -380,6 +387,9 @@
 		case CB_TAG_RAM_CODE:
 			cb_parse_ram_code(ptr, info);
 			break;
+		case CB_TAG_SKU_ID:
+			cb_parse_sku_id(ptr, info);
+			break;
 		case CB_TAG_WIFI_CALIBRATION:
 			cb_parse_wifi_calibration(ptr, info);
 			break;

-- 
To view, visit https://review.coreboot.org/22743
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1c3b375da6119a4f8e8e7e25a11644becb90f927
Gerrit-Change-Number: 22743
Gerrit-PatchSet: 1
Gerrit-Owner: Julius Werner <jwerner at chromium.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20171205/fe61d410/attachment.html>


More information about the coreboot-gerrit mailing list