1 /** @file 2 The header file for Tcg2 SMM driver. 3 4 Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 13 **/ 14 15 #ifndef __TCG2_SMM_H__ 16 #define __TCG2_SMM_H__ 17 18 #include <PiDxe.h> 19 #include <IndustryStandard/Acpi.h> 20 #include <IndustryStandard/Tpm2Acpi.h> 21 22 #include <Guid/MemoryOverwriteControl.h> 23 #include <Guid/TpmInstance.h> 24 25 #include <Protocol/SmmSwDispatch2.h> 26 #include <Protocol/AcpiTable.h> 27 #include <Protocol/SmmVariable.h> 28 #include <Protocol/Tcg2Protocol.h> 29 30 #include <Library/BaseLib.h> 31 #include <Library/BaseMemoryLib.h> 32 #include <Library/DebugLib.h> 33 #include <Library/SmmServicesTableLib.h> 34 #include <Library/UefiDriverEntryPoint.h> 35 #include <Library/UefiBootServicesTableLib.h> 36 #include <Library/DxeServicesLib.h> 37 #include <Library/TpmMeasurementLib.h> 38 #include <Library/Tpm2CommandLib.h> 39 #include <Library/Tcg2PhysicalPresenceLib.h> 40 #include <Library/IoLib.h> 41 #include <Library/PrintLib.h> 42 43 #include <IndustryStandard/TpmPtp.h> 44 45 #pragma pack(1) 46 typedef struct { 47 UINT8 SoftwareSmi; 48 UINT32 Parameter; 49 UINT32 Response; 50 UINT32 Request; 51 UINT32 RequestParameter; 52 UINT32 LastRequest; 53 UINT32 ReturnCode; 54 } PHYSICAL_PRESENCE_NVS; 55 56 typedef struct { 57 UINT8 SoftwareSmi; 58 UINT32 Parameter; 59 UINT32 Request; 60 UINT32 ReturnCode; 61 } MEMORY_CLEAR_NVS; 62 63 typedef struct { 64 PHYSICAL_PRESENCE_NVS PhysicalPresence; 65 MEMORY_CLEAR_NVS MemoryClear; 66 UINT32 PPRequestUserConfirm; 67 } TCG_NVS; 68 69 typedef struct { 70 UINT8 OpRegionOp; 71 UINT32 NameString; 72 UINT8 RegionSpace; 73 UINT8 DWordPrefix; 74 UINT32 RegionOffset; 75 UINT8 BytePrefix; 76 UINT8 RegionLen; 77 } AML_OP_REGION_32_8; 78 #pragma pack() 79 80 // 81 // The definition for TCG MOR 82 // 83 #define ACPI_FUNCTION_DSM_MEMORY_CLEAR_INTERFACE 1 84 #define ACPI_FUNCTION_PTS_CLEAR_MOR_BIT 2 85 86 // 87 // The return code for Memory Clear Interface Functions 88 // 89 #define MOR_REQUEST_SUCCESS 0 90 #define MOR_REQUEST_GENERAL_FAILURE 1 91 92 // 93 // Physical Presence Interface Version supported by Platform 94 // 95 #define PHYSICAL_PRESENCE_VERSION_TAG "$PV" 96 #define PHYSICAL_PRESENCE_VERSION_SIZE 4 97 98 // 99 // PNP _HID for TPM2 device 100 // 101 #define TPM_HID_TAG "NNNN0000" 102 #define TPM_HID_PNP_SIZE 8 103 #define TPM_HID_ACPI_SIZE 9 104 105 #endif // __TCG_SMM_H__ 106