1 /** @file
2   Define the variable data structures used for TCG physical presence.
3   The TPM request from firmware or OS is saved to variable. And it is
4   cleared after it is processed in the next boot cycle. The TPM response
5   is saved to variable.
6 
7 Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
8 This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution.  The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
12 
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 
16 **/
17 
18 #ifndef __PHYSICAL_PRESENCE_DATA_GUID_H__
19 #define __PHYSICAL_PRESENCE_DATA_GUID_H__
20 
21 #define EFI_PHYSICAL_PRESENCE_DATA_GUID \
22   { \
23     0xf6499b1, 0xe9ad, 0x493d, { 0xb9, 0xc2, 0x2f, 0x90, 0x81, 0x5c, 0x6c, 0xbc }\
24   }
25 
26 #define PHYSICAL_PRESENCE_VARIABLE  L"PhysicalPresence"
27 
28 typedef struct {
29   UINT8   PPRequest;      ///< Physical Presence request command.
30   UINT8   LastPPRequest;
31   UINT32  PPResponse;
32 } EFI_PHYSICAL_PRESENCE;
33 
34 //
35 // The definition of physical presence operation actions
36 //
37 #define PHYSICAL_PRESENCE_NO_ACTION                               0
38 #define PHYSICAL_PRESENCE_ENABLE                                  1
39 #define PHYSICAL_PRESENCE_DISABLE                                 2
40 #define PHYSICAL_PRESENCE_ACTIVATE                                3
41 #define PHYSICAL_PRESENCE_DEACTIVATE                              4
42 #define PHYSICAL_PRESENCE_CLEAR                                   5
43 #define PHYSICAL_PRESENCE_ENABLE_ACTIVATE                         6
44 #define PHYSICAL_PRESENCE_DEACTIVATE_DISABLE                      7
45 #define PHYSICAL_PRESENCE_SET_OWNER_INSTALL_TRUE                  8
46 #define PHYSICAL_PRESENCE_SET_OWNER_INSTALL_FALSE                 9
47 #define PHYSICAL_PRESENCE_ENABLE_ACTIVATE_OWNER_TRUE              10
48 #define PHYSICAL_PRESENCE_DEACTIVATE_DISABLE_OWNER_FALSE          11
49 #define PHYSICAL_PRESENCE_DEFERRED_PP_UNOWNERED_FIELD_UPGRADE     12
50 #define PHYSICAL_PRESENCE_SET_OPERATOR_AUTH                       13
51 #define PHYSICAL_PRESENCE_CLEAR_ENABLE_ACTIVATE                   14
52 #define PHYSICAL_PRESENCE_SET_NO_PPI_PROVISION_FALSE              15
53 #define PHYSICAL_PRESENCE_SET_NO_PPI_PROVISION_TRUE               16
54 #define PHYSICAL_PRESENCE_SET_NO_PPI_CLEAR_FALSE                  17
55 #define PHYSICAL_PRESENCE_SET_NO_PPI_CLEAR_TRUE                   18
56 #define PHYSICAL_PRESENCE_SET_NO_PPI_MAINTENANCE_FALSE            19
57 #define PHYSICAL_PRESENCE_SET_NO_PPI_MAINTENANCE_TRUE             20
58 #define PHYSICAL_PRESENCE_ENABLE_ACTIVATE_CLEAR                   21
59 #define PHYSICAL_PRESENCE_ENABLE_ACTIVATE_CLEAR_ENABLE_ACTIVATE   22
60 
61 //
62 // This variable is used to save TPM Management Flags and corresponding operations.
63 // It should be protected from malicious software (e.g. Set it as read-only variable).
64 //
65 #define PHYSICAL_PRESENCE_FLAGS_VARIABLE  L"PhysicalPresenceFlags"
66 typedef struct {
67   UINT8   PPFlags;
68 } EFI_PHYSICAL_PRESENCE_FLAGS;
69 
70 //
71 // The definition bit of the TPM Management Flags
72 //
73 #define FLAG_NO_PPI_PROVISION                    BIT0
74 #define FLAG_NO_PPI_CLEAR                        BIT1
75 #define FLAG_NO_PPI_MAINTENANCE                  BIT2
76 #define FLAG_RESET_TRACK                         BIT3
77 
78 extern EFI_GUID  gEfiPhysicalPresenceGuid;
79 
80 #endif
81 
82