summaryrefslogtreecommitdiff
path: root/include/ec_commands.h
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@chromium.org>2015-12-01 18:42:23 -0800
committerchrome-bot <chrome-bot@chromium.org>2016-01-25 21:46:48 -0800
commit81efb83e95f1711e71e4c8c6125fe8c256bf7772 (patch)
treeda60ef6a0dc2d67dddec5c4066ef9fe5bdfa5ba9 /include/ec_commands.h
parent97713dba84a45d78445c9e50f28054c6d7ee5011 (diff)
downloadchrome-ec-81efb83e95f1711e71e4c8c6125fe8c256bf7772.tar.gz
ec: Add temporary secure storage for the host during boot
This adds a temporary secure storage interface for the EC to be able to store small amounts of data from the host that is locked until the chipset resets. This is used by pre-memory verified boot on x86 systems where we need to know which RW slot to boot and what the hash is to ensure that we can resume from S3 safely. BUG=chrome-os-partner:46049 BRANCH=none TEST=tested on glados and samus Change-Id: I5fa91046437479bcae69a8fca4c989b0ef554bbf Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/315222 Commit-Ready: Aaron Durbin <adurbin@chromium.org> Tested-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'include/ec_commands.h')
-rw-r--r--include/ec_commands.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h
index 7901745e9e..9434a5df45 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -942,6 +942,8 @@ enum ec_feature_code {
EC_FEATURE_USB_MUX = 23,
/* Motion Sensor code has an internal software FIFO */
EC_FEATURE_MOTION_SENSE_FIFO = 24,
+ /* Support temporary secure vstore */
+ EC_FEATURE_VSTORE = 25,
};
#define EC_FEATURE_MASK_0(event_code) (1UL << (event_code % 32))
@@ -2123,6 +2125,50 @@ struct ec_response_port80_last_boot {
} __packed;
/*****************************************************************************/
+/* Temporary secure storage for host verified boot use */
+
+/* Number of bytes in a vstore slot */
+#define EC_VSTORE_SLOT_SIZE 64
+
+/* Maximum number of vstore slots */
+#define EC_VSTORE_SLOT_MAX 32
+
+/* Get persistent storage info */
+#define EC_CMD_VSTORE_INFO 0x49
+
+struct ec_response_vstore_info {
+ /* Indicates which slots are locked */
+ uint32_t slot_locked;
+ /* Total number of slots available */
+ uint8_t slot_count;
+} __packed;
+
+/*
+ * Read temporary secure storage
+ *
+ * Response is EC_VSTORE_SLOT_SIZE bytes of data.
+ */
+#define EC_CMD_VSTORE_READ 0x4a
+
+struct ec_params_vstore_read {
+ uint8_t slot; /* Slot to read from */
+} __packed;
+
+struct ec_response_vstore_read {
+ uint8_t data[EC_VSTORE_SLOT_SIZE];
+} __packed;
+
+/*
+ * Write temporary secure storage and lock it.
+ */
+#define EC_CMD_VSTORE_WRITE 0x4b
+
+struct ec_params_vstore_write {
+ uint8_t slot; /* Slot to write to */
+ uint8_t data[EC_VSTORE_SLOT_SIZE];
+} __packed;
+
+/*****************************************************************************/
/* Thermal engine commands. Note that there are two implementations. We'll
* reuse the command number, but the data and behavior is incompatible.
* Version 0 is what originally shipped on Link.