Index: firmware/lib/tpm_lite/tlcl.c |
diff --git a/firmware/lib/tpm_lite/tlcl.c b/firmware/lib/tpm_lite/tlcl.c |
index 2d79820d5c4f744a3591b222600b83b8e2da5a84..23288ea8c1d288966be328520190ae152ac8b65c 100644 |
--- a/firmware/lib/tpm_lite/tlcl.c |
+++ b/firmware/lib/tpm_lite/tlcl.c |
@@ -21,6 +21,11 @@ |
#include "tss_constants.h" |
#include "utility.h" |
+#define EXTRA_LOGGING 0 |
+ |
+#if EXTRA_LOGGING |
+#include <stdio.h> |
+#endif |
/* Sets the size field of a TPM command. */ |
static INLINE void SetTpmCommandSize(uint8_t* buffer, uint32_t size) { |
@@ -62,8 +67,20 @@ static void CheckResult(uint8_t* request, uint8_t* response, int warn_only) { |
static void TlclSendReceive(uint8_t* request, uint8_t* response, |
int max_length) { |
+#if EXTRA_LOGGING |
+ printf("command: %x%x %x%x%x%x %x%x%x%x\n", |
Randall Spangler
2010/08/04 16:27:26
Better to use VBDEBUG here, so that we can turn on
|
+ request[0], request[1], |
+ request[2], request[3], request[4], request[5], |
+ request[6], request[7], request[8], request[9]); |
+#endif |
TlclStubSendReceive(request, TpmCommandSize(request), |
response, max_length); |
+#if EXTRA_LOGGING |
+ printf("response: %x%x %x%x%x%x %x%x%x%x\n", |
+ response[0], response[1], |
+ response[2], response[3], response[4], response[5], |
+ response[6], response[7], response[8], response[9]); |
+#endif |
#ifdef VBOOT_DEBUG |
{ |
@@ -122,7 +139,7 @@ uint32_t TlclWrite(uint32_t index, uint8_t* data, uint32_t length) { |
VBDEBUG(("TPM: TlclWrite(0x%x, %d)\n", index, length)); |
Memcpy(&cmd, &tpm_nv_write_cmd, sizeof(cmd)); |
assert(total_length <= TPM_LARGE_ENOUGH_COMMAND_SIZE); |
- SetTpmCommandSize(tpm_nv_write_cmd.buffer, total_length); |
+ SetTpmCommandSize(cmd.buffer, total_length); |
ToTpmUint32(cmd.buffer + tpm_nv_write_cmd.index, index); |
ToTpmUint32(cmd.buffer + tpm_nv_write_cmd.length, length); |
@@ -214,7 +231,7 @@ uint32_t TlclClearEnable(void) { |
uint32_t TlclSetDeactivated(uint8_t flag) { |
struct s_tpm_physicalsetdeactivated_cmd cmd; |
VBDEBUG(("TPM: SetDeactivated(%d)\n", flag)); |
- Memcpy(&cmd, &tpm_physicaldisable_cmd, sizeof(cmd)); |
+ Memcpy(&cmd, &tpm_physicalsetdeactivated_cmd, sizeof(cmd)); |
*(cmd.buffer + cmd.deactivated) = flag; |
return Send(cmd.buffer); |
} |