summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLouis Collard <louiscollard@chromium.org>2018-07-06 16:38:38 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-09-05 16:11:01 -0700
commit98045b7fa94ad11803af540677b2cde5a337be80 (patch)
tree5f4e14722e93d57e501f64559afadae2de1f3e49 /include
parent87b6fed80dbb08e548105c6f2019b1d57c598ea7 (diff)
downloadchrome-ec-98045b7fa94ad11803af540677b2cde5a337be80.tar.gz
cr50: Add commands to get/set serial number bits.
Allocates 16 bytes of INFO1 space, in the 'board' section, and after the current Board ID data, to store the serial number data for use by zero-touch enrollment. Adds a console command to read / set this data. Adds TPM vendor commands to set initial sn data, and update it during RMA. CQ-DEPEND=CL:*657450 BUG=b:111195266 TEST=tested locally on soraka BRANCH=none Change-Id: I752aefad9654742b7719156202f29d635d2306df Signed-off-by: Louis Collard <louiscollard@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1127574 Reviewed-by: Andrey Pronin <apronin@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/config.h6
-rw-r--r--include/tpm_vendor_cmds.h21
2 files changed, 27 insertions, 0 deletions
diff --git a/include/config.h b/include/config.h
index 0aedd97799..6d8cf67d6e 100644
--- a/include/config.h
+++ b/include/config.h
@@ -3613,6 +3613,12 @@
#undef CONFIG_BOARD_ID_SUPPORT
/*
+ * Define this if serial number support is required. For g chip based boards
+ * it allows a verifiable serial number to be stored / certified.
+ */
+#undef CONFIG_SN_BITS_SUPPORT
+
+/*
* Define this to enable Cros Board Info support. I2C_EEPROM_PORT and
* I2C_EEPROM_ADDR must be defined as well.
*/
diff --git a/include/tpm_vendor_cmds.h b/include/tpm_vendor_cmds.h
index 16fa071a6b..a3b260cf05 100644
--- a/include/tpm_vendor_cmds.h
+++ b/include/tpm_vendor_cmds.h
@@ -80,6 +80,27 @@ enum vendor_cmd_cc {
* it will response with the current tpm_mode value in uint8_t format.
*/
VENDOR_CC_TPM_MODE = 40,
+ /*
+ * Initializes INFO1 SN data space, and sets SN hash. Takes three
+ * int32 as parameters, which are written as the SN hash.
+ */
+ VENDOR_CC_SN_SET_HASH = 41,
+ /*
+ * Increments the RMA count in the INFO1 SN data space. The space must
+ * have been previously initialized with the _SET_HASH command above for
+ * this to succeed. Takes one byte as parameter, which indicates the
+ * number to increment the RMA count by; this is typically 1 or 0.
+ *
+ * Incrementing the RMA count by 0 will set the RMA indicator, but not
+ * incremement the count. This is useful to mark that a device has been
+ * RMA'd, but that we were not able to log the new serial number.
+ *
+ * Incrementing the count by the maximum RMA count (currently 7) will
+ * always set the RMA count to the maximum value, regardless of the
+ * previous value. This can be used with any device, regardless of
+ * current state, to mark it as RMA'd but with an unknown RMA count.
+ */
+ VENDOR_CC_SN_INC_RMA = 42,
LAST_VENDOR_COMMAND = 65535,
};