aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-08-05 08:01:32 -0400
committerTom Rini <trini@konsulko.com>2022-08-05 08:01:32 -0400
commit46b5c8ed017958fc387ab86c71ae6c90abb6793c (patch)
tree4162612e16af05f7ed57a461207af988fd8e5815 /include
parentea2997ed2d1d2a24f598f368de441530c8dba7a2 (diff)
parentde70619dd3db08e4a1ac881801d3fab979408fd3 (diff)
Merge tag 'tpm-030822' of https://source.denx.de/u-boot/custodians/u-boot-tpm
EFI_RNG_PROTOCOL with a TPM
Diffstat (limited to 'include')
-rw-r--r--include/tpm_api.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/tpm_api.h b/include/tpm_api.h
index ef45b43a8f..11aa14eb79 100644
--- a/include/tpm_api.h
+++ b/include/tpm_api.h
@@ -319,4 +319,14 @@ u32 tpm_write_lock(struct udevice *dev, u32 index);
*/
u32 tpm_resume(struct udevice *dev);
+static inline bool tpm_is_v1(struct udevice *dev)
+{
+ return IS_ENABLED(CONFIG_TPM_V1) && tpm_get_version(dev) == TPM_V1;
+}
+
+static inline bool tpm_is_v2(struct udevice *dev)
+{
+ return IS_ENABLED(CONFIG_TPM_V2) && tpm_get_version(dev) == TPM_V2;
+}
+
#endif /* __TPM_API_H */