Skip to content
Snippets Groups Projects
Commit aa643013 authored by Miquel Raynal's avatar Miquel Raynal Committed by Tom Rini
Browse files

tpm: add possible traces to analyze buffers returned by the TPM


When debugging, it is welcome to get more information about what the TPM
returns. Add the possibility to print the packets received to show their
exact content.

Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
Reviewed-by: default avatarTom Rini <trini@konsulko.com>
parent f6872816
No related branches found
No related tags found
No related merge requests found
...@@ -153,6 +153,7 @@ u32 tpm_sendrecv_command(const void *command, void *response, size_t *size_ptr) ...@@ -153,6 +153,7 @@ u32 tpm_sendrecv_command(const void *command, void *response, size_t *size_ptr)
int err, ret; int err, ret;
u8 response_buffer[COMMAND_BUFFER_SIZE]; u8 response_buffer[COMMAND_BUFFER_SIZE];
size_t response_length; size_t response_length;
int i;
if (response) { if (response) {
response_length = *size_ptr; response_length = *size_ptr;
...@@ -172,7 +173,14 @@ u32 tpm_sendrecv_command(const void *command, void *response, size_t *size_ptr) ...@@ -172,7 +173,14 @@ u32 tpm_sendrecv_command(const void *command, void *response, size_t *size_ptr)
if (size_ptr) if (size_ptr)
*size_ptr = response_length; *size_ptr = response_length;
return tpm_return_code(response); ret = tpm_return_code(response);
log(LOGC_NONE, LOGL_DEBUG, "TPM response [ret:%d]: ", ret);
for (i = 0; i < response_length; i++)
log(LOGC_NONE, LOGL_DEBUG, "%02x ", ((u8 *)response)[i]);
log(LOGC_NONE, LOGL_DEBUG, "\n");
return ret;
} }
int tpm_init(void) int tpm_init(void)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment