[U-Boot] [PATCH 11/21] tpm: Add non-volatile index attributes needed for v2

Simon Glass sjg at chromium.org
Sat Nov 24 04:29:34 UTC 2018


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 at chromium.org>
---

 include/tpm-v2.h | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/include/tpm-v2.h b/include/tpm-v2.h
index 2f2e66de195..ae00803f6d9 100644
--- a/include/tpm-v2.h
+++ b/include/tpm-v2.h
@@ -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.
  *
-- 
2.20.0.rc0.387.gc7a69e6b6c-goog



More information about the U-Boot mailing list