summaryrefslogtreecommitdiff
path: root/include/tpm-v2.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-02-07 00:23:42 +0300
committerTom Rini <trini@konsulko.com>2021-03-02 23:53:37 +0300
commit63af92e837f3d7c21ab5fc4a96ffcbf202efaf90 (patch)
tree6cef337796d50552504a3f0b90e07d32d2d88190 /include/tpm-v2.h
parent7785bc1d5f94d28497bef6935ecbaa1b0ddd3e26 (diff)
downloadu-boot-63af92e837f3d7c21ab5fc4a96ffcbf202efaf90.tar.xz
tpm: Allow disabling platform hierarchy with TPM2
With TPM2 we don't actually lock the TPM once verified boot is finished. Instead we disable the platform hierarchy which serves the same purpose. Add an implementation of this so we can safely boot into the kernel. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'include/tpm-v2.h')
-rw-r--r--include/tpm-v2.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/tpm-v2.h b/include/tpm-v2.h
index fa3296a7b0..df67a196cf 100644
--- a/include/tpm-v2.h
+++ b/include/tpm-v2.h
@@ -237,6 +237,7 @@ enum tpm2_handles {
enum tpm2_command_codes {
TPM2_CC_STARTUP = 0x0144,
TPM2_CC_SELF_TEST = 0x0143,
+ TPM2_CC_HIER_CONTROL = 0x0121,
TPM2_CC_CLEAR = 0x0126,
TPM2_CC_CLEARCONTROL = 0x0127,
TPM2_CC_HIERCHANGEAUTH = 0x0129,
@@ -274,6 +275,7 @@ enum tpm2_return_codes {
TPM2_RC_COMMAND_CODE = TPM2_RC_VER1 + 0x0043,
TPM2_RC_AUTHSIZE = TPM2_RC_VER1 + 0x0044,
TPM2_RC_AUTH_CONTEXT = TPM2_RC_VER1 + 0x0045,
+ TPM2_RC_NV_DEFINED = TPM2_RC_VER1 + 0x004c,
TPM2_RC_NEEDS_TEST = TPM2_RC_VER1 + 0x0053,
TPM2_RC_WARN = 0x0900,
TPM2_RC_TESTING = TPM2_RC_WARN + 0x000A,
@@ -584,4 +586,15 @@ u32 tpm2_get_random(struct udevice *dev, void *data, u32 count);
*/
u32 tpm2_write_lock(struct udevice *dev, u32 index);
+/**
+ * Disable access to any platform data
+ *
+ * This can be called to close off access to the firmware data in the data,
+ * before calling the kernel.
+ *
+ * @dev TPM device
+ * @return code of the operation
+ */
+u32 tpm2_disable_platform_hierarchy(struct udevice *dev);
+
#endif /* __TPM_V2_H */