summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2018-01-05 16:16:07 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2018-02-01 00:48:10 +0000
commite2fc92801dabfc7f062453e3adc5fd5f1c9c5893 (patch)
tree322b4bc5d6bc009693973bc3b58399857a270bc6 /include
parentad8d5cb82ae7c7928a8f8ffcf59cc8713a163363 (diff)
downloadchrome-ec-e2fc92801dabfc7f062453e3adc5fd5f1c9c5893.tar.gz
ccd: prepare for handling crucial CCD commands through TPM task context
We want CCD commands lock, open, password, and unlock (at least to start with) to be available over both CLI and through crosh (i.e. coming over /dev/tpm0). Let's allocate a TPM vendor command for handling all CCD subcommands, and move to this new framework the 'ccd password' command, which already is available over vendor command. BRANCH=cr50 BUG=b:62537474 TEST=verified that 'ccd password' still works both over Suzy-Q CLI and using gsctool on the target. Change-Id: I2d06230b762f47af7e580b188a587bc5678ca169 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/853280 Reviewed-by: Randall Spangler <rspangler@chromium.org> (cherry picked from commit 877e5909b403cd40b415757b2921594bb6d8a021) Reviewed-on: https://chromium-review.googlesource.com/896754
Diffstat (limited to 'include')
-rw-r--r--include/ccd_config.h11
-rw-r--r--include/tpm_vendor_cmds.h6
2 files changed, 16 insertions, 1 deletions
diff --git a/include/ccd_config.h b/include/ccd_config.h
index 5319f9a045..5a1cb5add9 100644
--- a/include/ccd_config.h
+++ b/include/ccd_config.h
@@ -98,6 +98,17 @@ enum ccd_capability {
CCD_CAP_COUNT
};
+/*
+ * Subcommand code, used to pass different CCD commands using the same TPM
+ * vendor command.
+ */
+enum ccd_vendor_subcommands {
+ CCDV_PASSWORD = 0,
+ CCDV_OPEN = 1,
+ CCDV_UNLOCK = 2,
+ CCDV_LOCK = 3,
+};
+
/**
* Initialize CCD configuration at boot.
*
diff --git a/include/tpm_vendor_cmds.h b/include/tpm_vendor_cmds.h
index 830678ee0c..390097a45c 100644
--- a/include/tpm_vendor_cmds.h
+++ b/include/tpm_vendor_cmds.h
@@ -44,9 +44,12 @@ enum vendor_cmd_cc {
VENDOR_CC_POP_LOG_ENTRY = 28,
VENDOR_CC_GET_REC_BTN = 29,
VENDOR_CC_RMA_CHALLENGE_RESPONSE = 30,
- VENDOR_CC_CCD_PASSWORD = 31,
+
+ /* A gap left for the no longer supported CCD password command. */
+
VENDOR_CC_DISABLE_RMA = 32,
VENDOR_CC_MANAGE_CCD_PWD = 33,
+ VENDOR_CC_CCD = 34,
LAST_VENDOR_COMMAND = 65535,
};
@@ -69,6 +72,7 @@ enum vendor_cmd_rc {
VENDOR_RC_RESPONSE_TOO_BIG = 5,
VENDOR_RC_INTERNAL_ERROR = 6,
VENDOR_RC_NOT_ALLOWED = 7,
+ VENDOR_RC_NO_SUCH_SUBCOMMAND = 8,
/* Only 7 bits available; max is 127 */
VENDOR_RC_NO_SUCH_COMMAND = 127,
};