tpm_ftpm_tee.h 1.0 KB

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