summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@google.com>2018-05-15 19:02:38 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-06-07 16:52:16 -0700
commitb67ef05de08f036c22b3aab049ecf36bc28c681c (patch)
tree5b04ffcf4bc7c67d3678d9acb95f2151f1547853 /include
parente04ee44c13f36523df3706fa36eafb4ad1563ff6 (diff)
downloadchrome-ec-b67ef05de08f036c22b3aab049ecf36bc28c681c.tar.gz
cr50: add vendor command to get wp setting
When debugging HW write protect you can use the AP to tell what the actual HW write protect setting is, but you can't tell what cr50 thinks the HW write protect setting is. This change adds cr50 support for getting the HW write protect using a vendor command. This adds 98 bytes BUG=b:77543904 BRANCH=cr50 TEST=none Change-Id: I7410ecca557ad1fcf78e521623c4444b452fbc42 Signed-off-by: Mary Ruthven <mruthven@google.com> Reviewed-on: https://chromium-review.googlesource.com/1060641 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Mary Ruthven <mruthven@chromium.org> Reviewed-by: Mary Ruthven <mruthven@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/tpm_vendor_cmds.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/tpm_vendor_cmds.h b/include/tpm_vendor_cmds.h
index b6b32c3ef7..2ecef80e57 100644
--- a/include/tpm_vendor_cmds.h
+++ b/include/tpm_vendor_cmds.h
@@ -63,6 +63,12 @@ enum vendor_cmd_cc {
* the 'ccd reset' console command is run.
*/
VENDOR_CC_RESET_FACTORY = 38,
+ /*
+ * Get the write protect setting. This will return a single byte with
+ * bits communicating the write protect setting as described by the
+ * WPV subcommands.
+ */
+ VENDOR_CC_WP = 39,
LAST_VENDOR_COMMAND = 65535,
};
@@ -154,4 +160,13 @@ struct vendor_cc_spi_hash_request {
/* Maximum size of a response = SHA-256 hash or 1-32 bytes of data */
#define SPI_HASH_MAX_RESPONSE_BYTES 32
+/*
+ * Subcommand code, used to set write protect.
+ */
+#define WPV_UPDATE (1 << 0)
+#define WPV_ENABLE (1 << 1)
+#define WPV_FORCE (1 << 2)
+#define WPV_ATBOOT_SET (1 << 3)
+#define WPV_ATBOOT_ENABLE (1 << 4)
+
#endif /* __INCLUDE_TPM_VENDOR_CMDS_H */