2 * Copyright (C) 2011 Infineon Technologies
5 * Peter Huewe <huewe.external@infineon.com>
10 * Device driver for TCG/TCPA TPM (trusted platform module).
11 * Specifications at www.trustedcomputinggroup.org
13 * It is based on the Linux kernel driver tpm.c from Leendert van
14 * Dorn, Dave Safford, Reiner Sailer, and Kyleen Hall.
16 * SPDX-License-Identifier: GPL-2.0
19 #ifndef _TPM_TIS_I2C_H
20 #define _TPM_TIS_I2C_H
22 #include <linux/compiler.h>
23 #include <linux/types.h>
26 TPM_TIMEOUT = 5, /* msecs */
29 /* Size of external transmit buffer (used in tpm_transmit)*/
30 #define TPM_BUFSIZE 4096
32 /* Index of Count field in TPM response buffer */
33 #define TPM_RSP_SIZE_BYTE 2
34 #define TPM_RSP_RC_BYTE 6
45 unsigned long timeout_a, timeout_b, timeout_c, timeout_d; /* msec */
46 unsigned long duration[3]; /* msec */
49 struct tpm_input_header {
55 struct tpm_output_header {
75 struct timeout_t timeout;
76 struct duration_t duration;
79 struct tpm_getcap_params_in {
85 struct tpm_getcap_params_out {
90 union tpm_cmd_header {
91 struct tpm_input_header in;
92 struct tpm_output_header out;
95 union tpm_cmd_params {
96 struct tpm_getcap_params_out getcap_out;
97 struct tpm_getcap_params_in getcap_in;
101 union tpm_cmd_header header;
102 union tpm_cmd_params params;
106 int tpm_vendor_init(struct udevice *dev);
108 void tpm_vendor_cleanup(struct tpm_chip *chip);