sandbox: tpm: Tidy up enums and return values

Use an enum for command values instead of open-coding them. This removes
the need for comments. Also make sure the driver returns proper error
numbers instead of -1.

Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/include/tpm-v1.h b/include/tpm-v1.h
index 6b4941e..29788b5 100644
--- a/include/tpm-v1.h
+++ b/include/tpm-v1.h
@@ -81,6 +81,12 @@
 	TPM_CAP_VERSION_VAL	= 0x0000001A,
 };
 
+enum tmp_cap_flag {
+	TPM_CAP_FLAG_PERMANENT	= 0x108,
+};
+
+#define TPM_TAG_PERMANENT_FLAGS		0x001f
+
 #define TPM_NV_PER_GLOBALLOCK		BIT(15)
 #define TPM_NV_PER_PPREAD		BIT(16)
 #define TPM_NV_PER_PPWRITE		BIT(0)
@@ -93,6 +99,14 @@
 	TPM_PUBEK_SIZE			= 256,
 };
 
+enum {
+	TPM_CMD_EXTEND			= 0x14,
+	TPM_CMD_GET_CAPABILITY		= 0x65,
+	TPM_CMD_NV_DEFINE_SPACE		= 0xcc,
+	TPM_CMD_NV_WRITE_VALUE		= 0xcd,
+	TPM_CMD_NV_READ_VALUE		= 0xcf,
+};
+
 /**
  * TPM return codes as defined in the TCG Main specification
  * (TPM Main Part 2 Structures; Specification version 1.2)