summaryrefslogtreecommitdiff
path: root/include/tpm_vendor_cmds.h
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2019-03-14 11:25:09 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-03-28 11:16:55 -0700
commit705595bb681f362a5e34fb377d21fa8bfa605f9d (patch)
tree9c0a5f963f6ff81b9bb59698e2a382dbae206a03 /include/tpm_vendor_cmds.h
parente0d934828ef95a702a2a491a9219a1a55cc997cc (diff)
downloadchrome-ec-705595bb681f362a5e34fb377d21fa8bfa605f9d.tar.gz
cr50: add vendor command for retrieving flash elog
We want to be able to retrieve flash log contents using the vendor command channel. The input parameter of the command is the timestamp of the last retrieved log event, or zero of the AP wants to start over. The response is the next entry after the one requested by the AP, or an empty message if there are no newer log messages. BRANCH=cr50, cr50-mp BUG=b:63760920 TEST=with the upcoming gsctools changes observed the ability to retrieve flash log messages. Change-Id: I7a5438daab780c80f77cc7ebda5b719814b46489 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1525146 Reviewed-by: Namyoon Woo <namyoon@chromium.org>
Diffstat (limited to 'include/tpm_vendor_cmds.h')
-rw-r--r--include/tpm_vendor_cmds.h41
1 files changed, 24 insertions, 17 deletions
diff --git a/include/tpm_vendor_cmds.h b/include/tpm_vendor_cmds.h
index 9c344d6f55..62db64e82a 100644
--- a/include/tpm_vendor_cmds.h
+++ b/include/tpm_vendor_cmds.h
@@ -134,7 +134,22 @@ enum vendor_cmd_cc {
LAST_VENDOR_COMMAND = 65535,
};
-/* Error codes reported by extension and vendor commands. */
+/*
+ * Error codes reported by extension and vendor commands.
+ *
+ * As defined by the TPM2 spec, the TPM response code is all zero for success,
+ * and errors are a little complicated:
+ *
+ * Bits 31:12 must be zero.
+ *
+ * Bit 11 S=0 Error
+ * Bit 10 T=1 Vendor defined response code
+ * Bit 9 r=0 reserved
+ * Bit 8 V=1 Conforms to TPMv2 spec
+ * Bit 7 F=0 Confirms to Table 14, Format-Zero Response Codes
+ * Bits 6:0 num 128 possible failure reasons
+ */
+
enum vendor_cmd_rc {
/* EXTENSION_HASH error codes */
/* Attempt to start a session on an active handle. */
@@ -156,8 +171,15 @@ enum vendor_cmd_rc {
VENDOR_RC_IN_PROGRESS = 9,
VENDOR_RC_PASSWORD_REQUIRED = 10,
- /* Only 7 bits available; max is 127 */
+ /* Maximum possible failure reason. */
VENDOR_RC_NO_SUCH_COMMAND = 127,
+
+ /*
+ * Bits 10 and 8 set, this is to be ORed with the rest of the error
+ * values to make the combined value compliant with the spec
+ * requirements.
+ */
+ VENDOR_RC_ERR = 0x500,
};
/*
@@ -172,21 +194,6 @@ enum vendor_cmd_rc {
/* Our vendor-specific command codes go here */
#define TPM_CC_VENDOR_CR50 0x0000
-/*
- * The TPM response code is all zero for success.
- * Errors are a little complicated:
- *
- * Bits 31:12 must be zero.
- *
- * Bit 11 S=0 Error
- * Bit 10 T=1 Vendor defined response code
- * Bit 9 r=0 reserved
- * Bit 8 V=1 Conforms to TPMv2 spec
- * Bit 7 F=0 Confirms to Table 14, Format-Zero Response Codes
- * Bits 6:0 num 128 possible failure reasons
- */
-#define VENDOR_RC_ERR 0x00000500
-
/*** Structures and constants for VENDOR_CC_SPI_HASH ***/
enum vendor_cc_spi_hash_request_subcmd {