OLD | NEW |
1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 * | 4 * |
5 * Some TPM constants and type definitions for standalone compilation for use in | 5 * Some TPM constants and type definitions for standalone compilation for use in |
6 * the firmware | 6 * the firmware |
7 */ | 7 */ |
8 | 8 |
9 #ifndef TPM_LITE_TSS_CONSTANTS_H_ | 9 #ifndef TPM_LITE_TSS_CONSTANTS_H_ |
10 #define TPM_LITE_TSS_CONSTANTS_H_ | 10 #define TPM_LITE_TSS_CONSTANTS_H_ |
11 | 11 |
12 #include "sysincludes.h" | 12 #include "sysincludes.h" |
13 | 13 |
14 #define TPM_MAX_COMMAND_SIZE 4096 | 14 #define TPM_MAX_COMMAND_SIZE 4096 |
15 #define TPM_LARGE_ENOUGH_COMMAND_SIZE 256 /* saves space in the firmware */ | 15 #define TPM_LARGE_ENOUGH_COMMAND_SIZE 256 /* saves space in the firmware */ |
16 | 16 |
| 17 #define TPM_E_NON_FATAL 0x800 |
| 18 |
17 #define TPM_SUCCESS ((uint32_t)0x00000000) | 19 #define TPM_SUCCESS ((uint32_t)0x00000000) |
| 20 |
| 21 #define TPM_E_AREA_LOCKED ((uint32_t)0x00000003c) |
18 #define TPM_E_BADINDEX ((uint32_t)0x00000002) | 22 #define TPM_E_BADINDEX ((uint32_t)0x00000002) |
| 23 #define TPM_E_BAD_PRESENCE ((uint32_t)0x00000002d) |
19 #define TPM_E_MAXNVWRITES ((uint32_t)0x00000048) | 24 #define TPM_E_MAXNVWRITES ((uint32_t)0x00000048) |
20 #define TPM_E_OWNER_SET ((uint32_t)0x00000014) | 25 #define TPM_E_OWNER_SET ((uint32_t)0x00000014) |
21 | 26 |
| 27 #define TPM_E_NEEDS_SELFTEST ((uint32_t)(TPM_E_NON_FATAL + 1)) |
| 28 #define TPM_E_DOING_SELFTEST ((uint32_t)(TPM_E_NON_FATAL + 2)) |
| 29 |
22 #define TPM_E_ALREADY_INITIALIZED ((uint32_t)0x00005000) /* vboot local */ | 30 #define TPM_E_ALREADY_INITIALIZED ((uint32_t)0x00005000) /* vboot local */ |
23 #define TPM_E_INTERNAL_INCONSISTENCY ((uint32_t)0x00005001) /* vboot local */ | 31 #define TPM_E_INTERNAL_INCONSISTENCY ((uint32_t)0x00005001) /* vboot local */ |
24 #define TPM_E_MUST_REBOOT ((uint32_t)0x00005002) /* vboot local */ | 32 #define TPM_E_MUST_REBOOT ((uint32_t)0x00005002) /* vboot local */ |
25 #define TPM_E_CORRUPTED_STATE ((uint32_t)0x00005003) /* vboot local */ | 33 #define TPM_E_CORRUPTED_STATE ((uint32_t)0x00005003) /* vboot local */ |
26 #define TPM_E_COMMUNICATION_ERROR ((uint32_t)0x00005004) /* vboot local */ | 34 #define TPM_E_COMMUNICATION_ERROR ((uint32_t)0x00005004) /* vboot local */ |
27 | 35 |
28 #define TPM_NV_INDEX0 ((uint32_t)0x00000000) | 36 #define TPM_NV_INDEX0 ((uint32_t)0x00000000) |
29 #define TPM_NV_INDEX_LOCK ((uint32_t)0xffffffff) | 37 #define TPM_NV_INDEX_LOCK ((uint32_t)0xffffffff) |
| 38 #define TPM_NV_PER_GLOBALLOCK (((uint32_t)1)<<15) |
| 39 #define TPM_NV_PER_PPWRITE (((uint32_t)1)<<0) |
| 40 #define TPM_NV_PER_READ_STCLEAR (((uint32_t)1)<<31) |
30 #define TPM_NV_PER_WRITE_STCLEAR (((uint32_t)1)<<14) | 41 #define TPM_NV_PER_WRITE_STCLEAR (((uint32_t)1)<<14) |
31 #define TPM_NV_PER_PPWRITE (((uint32_t)1)<<0) | 42 |
32 #define TPM_NV_PER_GLOBALLOCK (((uint32_t)1)<<15) | 43 #define TPM_TAG_RQU_COMMAND ((uint16_t) 0xc1) |
| 44 #define TPM_TAG_RQU_AUTH1_COMMAND ((uint16_t) 0xc2) |
| 45 #define TPM_TAG_RQU_AUTH2_COMMAND ((uint16_t) 0xc3) |
| 46 |
| 47 #define TPM_TAG_RSP_COMMAND ((uint16_t) 0xc4) |
| 48 #define TPM_TAG_RSP_AUTH1_COMMAND ((uint16_t) 0xc5) |
| 49 #define TPM_TAG_RSP_AUTH2_COMMAND ((uint16_t) 0xc6) |
33 | 50 |
34 typedef uint8_t TSS_BOOL; | 51 typedef uint8_t TSS_BOOL; |
35 typedef uint16_t TPM_STRUCTURE_TAG; | 52 typedef uint16_t TPM_STRUCTURE_TAG; |
36 | 53 |
37 typedef struct tdTPM_WRITE_INFO { | |
38 uint32_t nvIndex; | |
39 uint32_t offset; | |
40 uint32_t dataSize; | |
41 } TPM_WRITE_INFO; | |
42 | |
43 typedef struct tdTPM_PERMANENT_FLAGS | 54 typedef struct tdTPM_PERMANENT_FLAGS |
44 { | 55 { |
45 TPM_STRUCTURE_TAG tag; | 56 TPM_STRUCTURE_TAG tag; |
46 TSS_BOOL disable; | 57 TSS_BOOL disable; |
47 TSS_BOOL ownership; | 58 TSS_BOOL ownership; |
48 TSS_BOOL deactivated; | 59 TSS_BOOL deactivated; |
49 TSS_BOOL readPubek; | 60 TSS_BOOL readPubek; |
50 TSS_BOOL disableOwnerClear; | 61 TSS_BOOL disableOwnerClear; |
51 TSS_BOOL allowMaintenance; | 62 TSS_BOOL allowMaintenance; |
52 TSS_BOOL physicalPresenceLifetimeLock; | 63 TSS_BOOL physicalPresenceLifetimeLock; |
53 TSS_BOOL physicalPresenceHWEnable; | 64 TSS_BOOL physicalPresenceHWEnable; |
54 TSS_BOOL physicalPresenceCMDEnable; | 65 TSS_BOOL physicalPresenceCMDEnable; |
55 TSS_BOOL CEKPUsed; | 66 TSS_BOOL CEKPUsed; |
56 TSS_BOOL TPMpost; | 67 TSS_BOOL TPMpost; |
57 TSS_BOOL TPMpostLock; | 68 TSS_BOOL TPMpostLock; |
58 TSS_BOOL FIPS; | 69 TSS_BOOL FIPS; |
59 TSS_BOOL Operator; | 70 TSS_BOOL Operator; |
60 TSS_BOOL enableRevokeEK; | 71 TSS_BOOL enableRevokeEK; |
61 TSS_BOOL nvLocked; | 72 TSS_BOOL nvLocked; |
62 TSS_BOOL readSRKPub; | 73 TSS_BOOL readSRKPub; |
63 TSS_BOOL tpmEstablished; | 74 TSS_BOOL tpmEstablished; |
64 TSS_BOOL maintenanceDone; | 75 TSS_BOOL maintenanceDone; |
65 TSS_BOOL disableFullDALogicInfo; | 76 TSS_BOOL disableFullDALogicInfo; |
66 } TPM_PERMANENT_FLAGS; | 77 } TPM_PERMANENT_FLAGS; |
67 | 78 |
68 #define TPM_ALL_LOCALITIES (TPM_LOC_ZERO | TPM_LOC_ONE | TPM_LOC_TWO \ | 79 typedef struct tdTPM_STCLEAR_FLAGS{ |
69 | TPM_LOC_THREE | TPM_LOC_FOUR) /* 0x1f */ | 80 TPM_STRUCTURE_TAG tag; |
70 | 81 TSS_BOOL deactivated; |
71 #define TPM_ENCAUTH_SIZE 20 | 82 TSS_BOOL disableForceClear; |
72 #define TPM_PUBEK_SIZE 256 | 83 TSS_BOOL physicalPresence; |
| 84 TSS_BOOL physicalPresenceLock; |
| 85 TSS_BOOL bGlobalLock; |
| 86 } TPM_STCLEAR_FLAGS; |
73 | 87 |
74 #endif /* TPM_LITE_TSS_CONSTANTS_H_ */ | 88 #endif /* TPM_LITE_TSS_CONSTANTS_H_ */ |
OLD | NEW |