]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
sandbox: tpm: Allow debugging of data packages
authorSimon Glass <sjg@chromium.org>
Tue, 6 Nov 2018 22:21:23 +0000 (15:21 -0700)
committerSimon Glass <sjg@chromium.org>
Wed, 21 Nov 2018 02:14:22 +0000 (19:14 -0700)
This is not normally useful, so change the code to avoid writing out every
data package. This can be enabled with #define DEBUG.

Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/tpm/tpm_tis_sandbox.c

index 79517f015aff6081b324a4d8c0a0cc27d6db3c9c..3336f559e5714c4b9bc74a25f2fb1918134161cc 100644 (file)
@@ -187,9 +187,11 @@ static int sandbox_tpm_xfer(struct udevice *dev, const uint8_t *sendbuf,
 
        code = get_unaligned_be32(sendbuf + sizeof(uint16_t) +
                                  sizeof(uint32_t));
+#ifdef DEBUG
        printf("tpm: %zd bytes, recv_len %zd, cmd = %x\n", send_size,
               *recv_len, code);
        print_buffer(0, sendbuf, 1, send_size, 0);
+#endif
        switch (code) {
        case TPM_CMD_GET_CAPABILITY:
                type = get_unaligned_be32(sendbuf + 14);
@@ -306,6 +308,10 @@ static int sandbox_tpm_xfer(struct udevice *dev, const uint8_t *sendbuf,
                printf("Unknown tpm command %02x\n", code);
                return -ENOSYS;
        }
+#ifdef DEBUG
+       printf("tpm: rx recv_len %zd\n", *recv_len);
+       print_buffer(0, recvbuf, 1, *recv_len, 0);
+#endif
 
        return 0;
 }