summaryrefslogtreecommitdiff
path: root/firmware/lib/tpm_lite
diff options
context:
space:
mode:
authorLuigi Semenzato <semenzato@google.com>2010-08-31 14:31:30 -0700
committerLuigi Semenzato <semenzato@google.com>2010-08-31 14:31:30 -0700
commit3da063e3f7612464a41a4c9b2b31fb7eade57a13 (patch)
treea888ba0ce2b791043baa5a5d1834d801888f35b4 /firmware/lib/tpm_lite
parent377557fcb260c9b41abc36ebba5759336436e59c (diff)
downloadvboot-3da063e3f7612464a41a4c9b2b31fb7eade57a13.tar.gz
Add resume command (TPM_Startup(ST_STATE))
Change-Id: Ia85c3cdbcb74c6cd8e7bd53c51eaccc98b13677e BUG= TEST= Review URL: http://codereview.chromium.org/3232006
Diffstat (limited to 'firmware/lib/tpm_lite')
-rw-r--r--firmware/lib/tpm_lite/include/tlcl.h7
-rw-r--r--firmware/lib/tpm_lite/include/tlcl_structures.h5
-rw-r--r--firmware/lib/tpm_lite/tlcl.c5
3 files changed, 16 insertions, 1 deletions
diff --git a/firmware/lib/tpm_lite/include/tlcl.h b/firmware/lib/tpm_lite/include/tlcl.h
index c3f73737..09ccb9f2 100644
--- a/firmware/lib/tpm_lite/include/tlcl.h
+++ b/firmware/lib/tpm_lite/include/tlcl.h
@@ -52,7 +52,12 @@ void TlclSetLogLevel(int level);
*/
uint32_t TlclStartup(void);
-/* Run the self test. Note---this is synchronous. To run this in parallel
+/* Resumes by sending a TPM_Startup(ST_STATE). The TPM error code is returned
+ * (0 for success).
+ */
+uint32_t TlclResume(void);
+
+/* Runs the self test. Note---this is synchronous. To run this in parallel
* with other firmware, use ContinueSelfTest. The TPM error code is returned.
*/
uint32_t TlclSelfTestFull(void);
diff --git a/firmware/lib/tpm_lite/include/tlcl_structures.h b/firmware/lib/tpm_lite/include/tlcl_structures.h
index 51f461e5..53d6bdd6 100644
--- a/firmware/lib/tpm_lite/include/tlcl_structures.h
+++ b/firmware/lib/tpm_lite/include/tlcl_structures.h
@@ -59,6 +59,11 @@ struct s_tpm_selftestfull_cmd{
} tpm_selftestfull_cmd = {{0x0, 0xc1, 0x0, 0x0, 0x0, 0xa, 0x0, 0x0, 0x0, 0x50, },
};
+struct s_tpm_resume_cmd{
+ uint8_t buffer[12];
+} tpm_resume_cmd = {{0x0, 0xc1, 0x0, 0x0, 0x0, 0xc, 0x0, 0x0, 0x0, 0x99, 0x0, 0x2, },
+};
+
struct s_tpm_startup_cmd{
uint8_t buffer[12];
} tpm_startup_cmd = {{0x0, 0xc1, 0x0, 0x0, 0x0, 0xc, 0x0, 0x0, 0x0, 0x99, 0x0, 0x1, },
diff --git a/firmware/lib/tpm_lite/tlcl.c b/firmware/lib/tpm_lite/tlcl.c
index 2bbb20dc..3f314df7 100644
--- a/firmware/lib/tpm_lite/tlcl.c
+++ b/firmware/lib/tpm_lite/tlcl.c
@@ -101,6 +101,11 @@ uint32_t TlclStartup(void) {
return Send(tpm_startup_cmd.buffer);
}
+uint32_t TlclResume(void) {
+ VBDEBUG(("TPM: Resume\n"));
+ return Send(tpm_resume_cmd.buffer);
+}
+
uint32_t TlclSelfTestFull(void) {
VBDEBUG(("TPM: Self test full\n"));
return Send(tpm_selftestfull_cmd.buffer);