Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * Copyright (C) Microsoft Corporation
0004  */
0005 
0006 #ifndef __TPM_FTPM_TEE_H__
0007 #define __TPM_FTPM_TEE_H__
0008 
0009 #include <linux/tee_drv.h>
0010 #include <linux/tpm.h>
0011 #include <linux/uuid.h>
0012 
0013 /* The TAFs ID implemented in this TA */
0014 #define FTPM_OPTEE_TA_SUBMIT_COMMAND  (0)
0015 #define FTPM_OPTEE_TA_EMULATE_PPI     (1)
0016 
0017 /* max. buffer size supported by fTPM  */
0018 #define MAX_COMMAND_SIZE       4096
0019 #define MAX_RESPONSE_SIZE      4096
0020 
0021 /**
0022  * struct ftpm_tee_private - fTPM's private data
0023  * @chip:     struct tpm_chip instance registered with tpm framework.
0024  * @state:    internal state
0025  * @session:  fTPM TA session identifier.
0026  * @resp_len: cached response buffer length.
0027  * @resp_buf: cached response buffer.
0028  * @ctx:      TEE context handler.
0029  * @shm:      Memory pool shared with fTPM TA in TEE.
0030  */
0031 struct ftpm_tee_private {
0032     struct tpm_chip *chip;
0033     u32 session;
0034     size_t resp_len;
0035     u8 resp_buf[MAX_RESPONSE_SIZE];
0036     struct tee_context *ctx;
0037     struct tee_shm *shm;
0038 };
0039 
0040 #endif /* __TPM_FTPM_TEE_H__ */