Subrata Banik | 20fe24b | 2021-12-09 02:46:38 +0530 | [diff] [blame] | 1 | /** @file |
| 2 | TPM2 ACPI table definition. |
| 3 | |
| 4 | Copyright (c) 2013 - 2019, Intel Corporation. All rights reserved. <BR> |
| 5 | Copyright (c) 2021, Ampere Computing LLC. All rights reserved. <BR> |
| 6 | SPDX-License-Identifier: BSD-2-Clause-Patent |
| 7 | |
| 8 | **/ |
| 9 | |
| 10 | #ifndef _TPM2_ACPI_H_ |
| 11 | #define _TPM2_ACPI_H_ |
| 12 | |
| 13 | #include <IndustryStandard/Acpi.h> |
| 14 | |
| 15 | #pragma pack (1) |
| 16 | |
| 17 | #define EFI_TPM2_ACPI_TABLE_REVISION_3 3 |
| 18 | #define EFI_TPM2_ACPI_TABLE_REVISION_4 4 |
| 19 | #define EFI_TPM2_ACPI_TABLE_REVISION EFI_TPM2_ACPI_TABLE_REVISION_4 |
| 20 | |
| 21 | typedef struct { |
| 22 | EFI_ACPI_DESCRIPTION_HEADER Header; |
| 23 | // Flags field is replaced in version 4 and above |
| 24 | // BIT0~15: PlatformClass This field is only valid for version 4 and above |
| 25 | // BIT16~31: Reserved |
| 26 | UINT32 Flags; |
| 27 | UINT64 AddressOfControlArea; |
| 28 | UINT32 StartMethod; |
| 29 | //UINT8 PlatformSpecificParameters[]; // size up to 12 |
| 30 | //UINT32 Laml; // Optional |
| 31 | //UINT64 Lasa; // Optional |
| 32 | } EFI_TPM2_ACPI_TABLE; |
| 33 | |
| 34 | #define EFI_TPM2_ACPI_TABLE_START_METHOD_ACPI 2 |
| 35 | #define EFI_TPM2_ACPI_TABLE_START_METHOD_TIS 6 |
| 36 | #define EFI_TPM2_ACPI_TABLE_START_METHOD_COMMAND_RESPONSE_BUFFER_INTERFACE 7 |
| 37 | #define EFI_TPM2_ACPI_TABLE_START_METHOD_COMMAND_RESPONSE_BUFFER_INTERFACE_WITH_ACPI 8 |
| 38 | #define EFI_TPM2_ACPI_TABLE_START_METHOD_COMMAND_RESPONSE_BUFFER_INTERFACE_WITH_SMC 11 |
| 39 | |
| 40 | typedef struct { |
| 41 | UINT32 Reserved; |
| 42 | UINT32 Error; |
| 43 | UINT32 Cancel; |
| 44 | UINT32 Start; |
| 45 | UINT64 InterruptControl; |
| 46 | UINT32 CommandSize; |
| 47 | UINT64 Command; |
| 48 | UINT32 ResponseSize; |
| 49 | UINT64 Response; |
| 50 | } EFI_TPM2_ACPI_CONTROL_AREA; |
| 51 | |
| 52 | // |
| 53 | // Start Method Specific Parameters for ARM SMC Start Method (11) |
| 54 | // Refer to Table 9: Start Method Specific Parameters for ARM SMC |
| 55 | // |
| 56 | typedef struct { |
| 57 | UINT32 Interrupt; |
| 58 | UINT8 Flags; |
| 59 | UINT8 OperationFlags; |
| 60 | UINT8 Reserved[2]; |
| 61 | UINT32 SmcFunctionId; |
| 62 | } EFI_TPM2_ACPI_START_METHOD_SPECIFIC_PARAMETERS_ARM_SMC; |
| 63 | |
| 64 | #pragma pack () |
| 65 | |
| 66 | #endif |