summaryrefslogtreecommitdiff
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
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
-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
-rw-r--r--firmware/version.c2
-rw-r--r--utility/tlcl_generator.c13
5 files changed, 29 insertions, 3 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);
diff --git a/firmware/version.c b/firmware/version.c
index efa3c1ab..2675a3a4 100644
--- a/firmware/version.c
+++ b/firmware/version.c
@@ -1 +1 @@
-char* VbootVersion = "VBOOv=c0776686";
+char* VbootVersion = "VBOOv=6eadb043";
diff --git a/utility/tlcl_generator.c b/utility/tlcl_generator.c
index 89d15d6f..96a23dd1 100644
--- a/utility/tlcl_generator.c
+++ b/utility/tlcl_generator.c
@@ -213,7 +213,7 @@ Command* BuildPPLockCommand(void) {
}
Command* BuildStartupCommand(void) {
- int size = kTpmRequestHeaderLength + sizeof(TPM_PHYSICAL_PRESENCE);
+ int size = kTpmRequestHeaderLength + sizeof(TPM_STARTUP_TYPE);
Command* cmd = newCommand(TPM_ORD_Startup, size);
cmd->name = "tpm_startup_cmd";
AddInitializedField(cmd, kTpmRequestHeaderLength,
@@ -222,6 +222,16 @@ Command* BuildStartupCommand(void) {
return cmd;
}
+Command* BuildResumeCommand(void) {
+ int size = kTpmRequestHeaderLength + sizeof(TPM_STARTUP_TYPE);
+ Command* cmd = newCommand(TPM_ORD_Startup, size);
+ cmd->name = "tpm_resume_cmd";
+ AddInitializedField(cmd, kTpmRequestHeaderLength,
+ sizeof(TPM_STARTUP_TYPE),
+ TPM_ST_STATE);
+ return cmd;
+}
+
Command* BuildSelftestfullCommand(void) {
int size = kTpmRequestHeaderLength;
Command* cmd = newCommand(TPM_ORD_SelfTestFull, size);
@@ -442,6 +452,7 @@ Command* (*builders[])(void) = {
BuildPPLockCommand,
BuildFinalizePPCommand,
BuildStartupCommand,
+ BuildResumeCommand,
BuildSelftestfullCommand,
BuildContinueSelfTestCommand,
BuildReadPubekCommand,