summaryrefslogtreecommitdiff
path: root/DynamicTablesPkg/Include/Library/Tpm2DeviceTableLib.h
diff options
context:
space:
mode:
Diffstat (limited to 'DynamicTablesPkg/Include/Library/Tpm2DeviceTableLib.h')
-rw-r--r--DynamicTablesPkg/Include/Library/Tpm2DeviceTableLib.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/DynamicTablesPkg/Include/Library/Tpm2DeviceTableLib.h b/DynamicTablesPkg/Include/Library/Tpm2DeviceTableLib.h
new file mode 100644
index 0000000..5da8117
--- /dev/null
+++ b/DynamicTablesPkg/Include/Library/Tpm2DeviceTableLib.h
@@ -0,0 +1,50 @@
+/** @file
+ Tpm2 device table generating Library
+
+ Copyright (c) 2025, Arm Limited. All rights reserved.<BR>
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef TPM2_DEVICE_TABLE_LIB_H_
+#define TPM2_DEVICE_TABLE_LIB_H_
+
+/** Build a SSDT table describing the TPM2 device.
+
+ The table created by this function must be freed by FreeTpm2DeviceTable.
+
+ @param [in] TpmDevInfo TPM2 Device info to describe in the SSDT table.
+ @param [in] Name The Name to give to the Device.
+ Must be a NULL-terminated ASL NameString
+ e.g.: "DEV0", "DV15.DEV0", etc.
+ @param [in] Uid UID for the TPM@ device.
+ @param [out] Table If success, pointer to the created SSDT table.
+
+ @retval EFI_SUCCESS Table generated successfully.
+ @retval EFI_INVALID_PARAMETER A parameter is invalid.
+ @retval EFI_NOT_FOUND Could not find information.
+ @retval EFI_OUT_OF_RESOURCES Could not allocate memory.
+**/
+EFI_STATUS
+EFIAPI
+BuildTpm2DeviceTable (
+ IN CONST CM_ARCH_COMMON_TPM2_DEVICE_INFO *TpmDevInfo,
+ IN CONST CHAR8 *Name,
+ IN CONST UINT64 Uid,
+ OUT EFI_ACPI_DESCRIPTION_HEADER **Table
+ );
+
+/** Free an Tpm2 device table previously created by
+ the BuildTpm2DeviceTable function.
+
+ @param [in] Table Pointer to a Tpm2 Device table allocated by
+ the BuildTpm2DeviceTable function.
+
+**/
+VOID
+EFIAPI
+FreeTpm2DeviceTable (
+ IN EFI_ACPI_DESCRIPTION_HEADER *Table
+ );
+
+#endif // TPM2_DEVICE_TABLE_LIB_H_