1 /* SPDX-License-Identifier: BSD-3-Clause */
4 * Some TPM constants and type definitions for standalone compilation for use
7 #ifndef TCG1_TSS_STRUCTURES_H_
8 #define TCG1_TSS_STRUCTURES_H_
11 #include <security/tpm/tss_errors.h>
13 #define TPM_MAX_COMMAND_SIZE 4096
14 #define TPM_LARGE_ENOUGH_COMMAND_SIZE 256 /* saves space in the firmware */
15 #define TPM_PUBEK_SIZE 256
17 #define TPM_NV_INDEX0 ((uint32_t)0x00000000)
18 #define TPM_NV_INDEX_LOCK ((uint32_t)0xffffffff)
19 #define TPM_NV_PER_GLOBALLOCK (((uint32_t)1)<<15)
20 #define TPM_NV_PER_PPWRITE (((uint32_t)1)<<0)
21 #define TPM_NV_PER_READ_STCLEAR (((uint32_t)1)<<31)
22 #define TPM_NV_PER_WRITE_STCLEAR (((uint32_t)1)<<14)
24 #define TPM_TAG_RQU_COMMAND ((uint16_t)0xc1)
25 #define TPM_TAG_RQU_AUTH1_COMMAND ((uint16_t)0xc2)
26 #define TPM_TAG_RQU_AUTH2_COMMAND ((uint16_t)0xc3)
28 #define TPM_TAG_RSP_COMMAND ((uint16_t)0xc4)
29 #define TPM_TAG_RSP_AUTH1_COMMAND ((uint16_t)0xc5)
30 #define TPM_TAG_RSP_AUTH2_COMMAND ((uint16_t)0xc6)
32 typedef uint8_t TSS_BOOL
;
33 typedef uint16_t TPM_STRUCTURE_TAG
;
35 typedef struct tdTPM_PERMANENT_FLAGS
{
36 TPM_STRUCTURE_TAG tag
;
41 TSS_BOOL disableOwnerClear
;
42 TSS_BOOL allowMaintenance
;
43 TSS_BOOL physicalPresenceLifetimeLock
;
44 TSS_BOOL physicalPresenceHWEnable
;
45 TSS_BOOL physicalPresenceCMDEnable
;
51 TSS_BOOL enableRevokeEK
;
54 TSS_BOOL tpmEstablished
;
55 TSS_BOOL maintenanceDone
;
56 TSS_BOOL disableFullDALogicInfo
;
57 } TPM_PERMANENT_FLAGS
;
59 typedef struct tdTPM_STCLEAR_FLAGS
{
60 TPM_STRUCTURE_TAG tag
;
62 TSS_BOOL disableForceClear
;
63 TSS_BOOL physicalPresence
;
64 TSS_BOOL physicalPresenceLock
;
68 #endif /* TCG1_TSS_STRUCTURES_H_ */