1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright (C) Microsoft Corporation
4  */
5 
6 #ifndef __TPM_FTPM_TEE_H__
7 #define __TPM_FTPM_TEE_H__
8 
9 #include <linux/tee_drv.h>
10 #include <linux/tpm.h>
11 #include <linux/uuid.h>
12 
13 /* The TAFs ID implemented in this TA */
14 #define FTPM_OPTEE_TA_SUBMIT_COMMAND  (0)
15 #define FTPM_OPTEE_TA_EMULATE_PPI     (1)
16 
17 /* max. buffer size supported by fTPM  */
18 #define MAX_COMMAND_SIZE       4096
19 #define MAX_RESPONSE_SIZE      4096
20 
21 /**
22  * struct ftpm_tee_private - fTPM's private data
23  * @chip:     struct tpm_chip instance registered with tpm framework.
24  * @state:    internal state
25  * @session:  fTPM TA session identifier.
26  * @resp_len: cached response buffer length.
27  * @resp_buf: cached response buffer.
28  * @ctx:      TEE context handler.
29  * @shm:      Memory pool shared with fTPM TA in TEE.
30  */
31 struct ftpm_tee_private {
32 	struct tpm_chip *chip;
33 	u32 session;
34 	size_t resp_len;
35 	u8 resp_buf[MAX_RESPONSE_SIZE];
36 	struct tee_context *ctx;
37 	struct tee_shm *shm;
38 };
39 
40 #endif /* __TPM_FTPM_TEE_H__ */
41