]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
tpm: Add non-volatile index attributes needed for v2
authorSimon Glass <sjg@chromium.org>
Sat, 24 Nov 2018 04:29:34 +0000 (21:29 -0700)
committerSimon Glass <sjg@chromium.org>
Wed, 5 Dec 2018 13:01:34 +0000 (06:01 -0700)
Version-2 TPMs support attributes for nvdata. Add definitions to the
header file so that clients can use it.

Signed-off-by: Simon Glass <sjg@chromium.org>
include/tpm-v2.h

index 2f2e66de195dacd385649413c1ac319f6d7f2d31..ae00803f6d951f47c1bd7d507d2db4af632b49e7 100644 (file)
@@ -128,6 +128,39 @@ enum tpm2_algorithms {
        TPM2_ALG_NULL           = 0x10,
 };
 
+/* NV index attributes */
+enum tpm_index_attrs {
+       TPMA_NV_PPWRITE         = 1UL << 0,
+       TPMA_NV_OWNERWRITE      = 1UL << 1,
+       TPMA_NV_AUTHWRITE       = 1UL << 2,
+       TPMA_NV_POLICYWRITE     = 1UL << 3,
+       TPMA_NV_COUNTER         = 1UL << 4,
+       TPMA_NV_BITS            = 1UL << 5,
+       TPMA_NV_EXTEND          = 1UL << 6,
+       TPMA_NV_POLICY_DELETE   = 1UL << 10,
+       TPMA_NV_WRITELOCKED     = 1UL << 11,
+       TPMA_NV_WRITEALL        = 1UL << 12,
+       TPMA_NV_WRITEDEFINE     = 1UL << 13,
+       TPMA_NV_WRITE_STCLEAR   = 1UL << 14,
+       TPMA_NV_GLOBALLOCK      = 1UL << 15,
+       TPMA_NV_PPREAD          = 1UL << 16,
+       TPMA_NV_OWNERREAD       = 1UL << 17,
+       TPMA_NV_AUTHREAD        = 1UL << 18,
+       TPMA_NV_POLICYREAD      = 1UL << 19,
+       TPMA_NV_NO_DA           = 1UL << 25,
+       TPMA_NV_ORDERLY         = 1UL << 26,
+       TPMA_NV_CLEAR_STCLEAR   = 1UL << 27,
+       TPMA_NV_READLOCKED      = 1UL << 28,
+       TPMA_NV_WRITTEN         = 1UL << 29,
+       TPMA_NV_PLATFORMCREATE  = 1UL << 30,
+       TPMA_NV_READ_STCLEAR    = 1UL << 31,
+
+       TPMA_NV_MASK_READ       = TPMA_NV_PPREAD | TPMA_NV_OWNERREAD |
+                               TPMA_NV_AUTHREAD | TPMA_NV_POLICYREAD,
+       TPMA_NV_MASK_WRITE      = TPMA_NV_PPWRITE | TPMA_NV_OWNERWRITE |
+                                       TPMA_NV_AUTHWRITE | TPMA_NV_POLICYWRITE,
+};
+
 /**
  * Issue a TPM2_Startup command.
  *