2 The header file for Tcg2 SMM driver.
4 Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #define __TCG2_SMM_H__
13 #include <IndustryStandard/Acpi.h>
14 #include <IndustryStandard/Tpm2Acpi.h>
16 #include <Guid/MemoryOverwriteControl.h>
17 #include <Guid/TpmInstance.h>
19 #include <Protocol/SmmSwDispatch2.h>
20 #include <Protocol/AcpiTable.h>
21 #include <Protocol/SmmVariable.h>
22 #include <Protocol/Tcg2Protocol.h>
24 #include <Library/BaseLib.h>
25 #include <Library/BaseMemoryLib.h>
26 #include <Library/DebugLib.h>
27 #include <Library/MmServicesTableLib.h>
28 #include <Library/UefiDriverEntryPoint.h>
29 #include <Library/UefiBootServicesTableLib.h>
30 #include <Library/DxeServicesLib.h>
31 #include <Library/TpmMeasurementLib.h>
32 #include <Library/Tpm2CommandLib.h>
33 #include <Library/Tcg2PhysicalPresenceLib.h>
34 #include <Library/IoLib.h>
35 #include <Library/PrintLib.h>
36 #include <Library/PcdLib.h>
37 #include <Library/Tpm2DeviceLib.h>
39 #include <IndustryStandard/TpmPtp.h>
47 UINT32 RequestParameter
;
50 } PHYSICAL_PRESENCE_NVS
;
60 PHYSICAL_PRESENCE_NVS PhysicalPresence
;
61 MEMORY_CLEAR_NVS MemoryClear
;
62 UINT32 PPRequestUserConfirm
;
64 BOOLEAN IsShortFormPkgLength
;
79 // The definition for TCG MOR
81 #define ACPI_FUNCTION_DSM_MEMORY_CLEAR_INTERFACE 1
82 #define ACPI_FUNCTION_PTS_CLEAR_MOR_BIT 2
85 // The return code for Memory Clear Interface Functions
87 #define MOR_REQUEST_SUCCESS 0
88 #define MOR_REQUEST_GENERAL_FAILURE 1
91 // Physical Presence Interface Version supported by Platform
93 #define PHYSICAL_PRESENCE_VERSION_TAG "$PV"
94 #define PHYSICAL_PRESENCE_VERSION_SIZE 4
97 // PNP _HID for TPM2 device
99 #define TPM_HID_TAG "NNNN0000"
100 #define TPM_HID_PNP_SIZE 8
101 #define TPM_HID_ACPI_SIZE 9
103 #define TPM_PRS_RESL "RESL"
104 #define TPM_PRS_RESS "RESS"
105 #define TPM_PRS_RES_NAME_SIZE 4
107 // Minimum PRS resource template size
108 // 1 byte for BufferOp
109 // 1 byte for PkgLength
110 // 2 bytes for BufferSize
111 // 12 bytes for Memory32Fixed descriptor
112 // 5 bytes for Interrupt descriptor
113 // 2 bytes for END Tag
115 #define TPM_POS_RES_TEMPLATE_MIN_SIZE (1 + 1 + 2 + 12 + 5 + 2)
118 // Max Interrupt buffer size for PRS interrupt resource
119 // Now support 15 interrupts in maxmum
121 #define MAX_PRS_INT_BUF_SIZE (15*4)
122 #endif // __TCG_SMM_H__