summaryrefslogtreecommitdiff
path: root/Board/EM/TCG2/Common/Setup
diff options
context:
space:
mode:
authorraywu <raywu0301@gmail.com>2018-06-15 00:00:50 +0800
committerraywu <raywu0301@gmail.com>2018-06-15 00:00:50 +0800
commitb7c51c9cf4864df6aabb99a1ae843becd577237c (patch)
treeeebe9b0d0ca03062955223097e57da84dd618b9a /Board/EM/TCG2/Common/Setup
downloadzprj-b7c51c9cf4864df6aabb99a1ae843becd577237c.tar.xz
init. 1AQQW051HEADmaster
Diffstat (limited to 'Board/EM/TCG2/Common/Setup')
-rw-r--r--Board/EM/TCG2/Common/Setup/HandleLoadDefaultsSetup.c141
-rw-r--r--Board/EM/TCG2/Common/Setup/TPMPwd.c346
-rw-r--r--Board/EM/TCG2/Common/Setup/TcgSetup.c67
-rw-r--r--Board/EM/TCG2/Common/Setup/TcgSetup.cif15
-rw-r--r--Board/EM/TCG2/Common/Setup/TcgSetup.mak123
-rw-r--r--Board/EM/TCG2/Common/Setup/TcgSetup.sd672
-rw-r--r--Board/EM/TCG2/Common/Setup/TcgSetup.sdl50
-rw-r--r--Board/EM/TCG2/Common/Setup/TcgSetup.unibin0 -> 12532 bytes
-rw-r--r--Board/EM/TCG2/Common/Setup/TcgSetupBoard.h95
9 files changed, 1509 insertions, 0 deletions
diff --git a/Board/EM/TCG2/Common/Setup/HandleLoadDefaultsSetup.c b/Board/EM/TCG2/Common/Setup/HandleLoadDefaultsSetup.c
new file mode 100644
index 0000000..e4a2cbb
--- /dev/null
+++ b/Board/EM/TCG2/Common/Setup/HandleLoadDefaultsSetup.c
@@ -0,0 +1,141 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/TCG2/Common/TcgSetup/HandleLoadDefaultsSetup.c 2 6/11/14 4:16p Fredericko $
+//
+// $Revision: 2 $
+//
+// $Date: 6/11/14 4:16p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/TCG2/Common/TcgSetup/HandleLoadDefaultsSetup.c $
+//
+// 2 6/11/14 4:16p Fredericko
+//
+// 1 4/21/14 2:18p Fredericko
+//
+// 1 10/08/13 12:05p Fredericko
+// Initial Check-In for Tpm-Next module
+//
+// 1 7/10/13 5:57p Fredericko
+// [TAG] EIP120969
+// [Category] New Feature
+// [Description] TCG (TPM20)
+//
+// 1 11/22/11 6:41p Fredericko
+// [TAG] EIP67286
+// [Category] Improvement
+// [Description] Separate out how load defaults are handled in setup
+// from the TpmPwd.c
+// [Files] 1. HandleLoadDefaultsSetup.c
+// 2. TcgSetup.cif
+// 3. TcgSetup.mak
+// 4. TpmPwd.c
+//
+//**********************************************************************
+//*************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: TPMPwd.c
+//
+// Description:
+// Contains functions that handle TPM authentication
+//
+//<AMI_FHDR_END>
+//*************************************************************************
+
+#include "token.h"
+#include <EFI.h>
+#include <Protocol/SimpleTextIn.h>
+#include <Setup.h>
+#include "HiiLib.h"
+#include "KeyMon.h"
+#include "Core\EM\AMITSE\Inc\Variable.h"
+#include "TcgPlatformSetupPolicy.h"
+
+#if EFI_SPECIFICATION_VERSION>0x20000 && !defined(GUID_VARIABLE_DEFINITION)
+ #include "Include\UefiHii.h"
+ #include "Protocol/HiiDatabase.h"
+ #include "Protocol/HiiString.h"
+#else
+ #include "Protocol/HII.h"
+#endif
+
+extern EFI_BOOT_SERVICES *gBS;
+extern EFI_SYSTEM_TABLE *gST;
+extern EFI_RUNTIME_SERVICES *gRT;
+
+
+//****************************************************************************************
+//<AMI_PHDR_START>
+//
+// Procedure: TcgUpdateDefaultsHook
+//
+// Description: Updates TCG status on F3
+//
+// Input: VOID
+//
+// Output: BOOLEAN
+//
+// Modified:
+//
+// Referrals:
+//
+// Notes:
+//<AMI_PHDR_END>
+//****************************************************************************************
+VOID TcgUpdateDefaultsHook(VOID )
+{
+ EFI_STATUS Status;
+ SETUP_DATA SetupData;
+ TCG_PLATFORM_SETUP_PROTOCOL *ProtocolInstance;
+ EFI_GUID Policyguid = TCG_PLATFORM_SETUP_POLICY_GUID;
+
+ //for OEMS that might want to update some policy on loaddefaults
+ //they need to update the policy on load defaults before this function is run
+ Status = gBS->LocateProtocol (&Policyguid, NULL, &ProtocolInstance);
+ if (EFI_ERROR (Status) || ProtocolInstance == NULL) {
+ return;
+ }
+
+ Status = VarSetValue(0, (UINT32)(((UINTN)&SetupData.TpmSupport - (UINTN)&SetupData)), (UINTN)sizeof(UINT8), &ProtocolInstance->ConfigFlags.TpmSupport );
+ Status = VarSetValue(0, (UINT32)(((UINTN)&SetupData.TcmSupport - (UINTN)&SetupData)), (UINTN)sizeof(UINT8), &ProtocolInstance->ConfigFlags.TcmSupport );
+ Status = VarSetValue(0, (UINT32)(((UINTN)&SetupData.TpmEnable - (UINTN)&SetupData)), (UINTN)sizeof(UINT8), &ProtocolInstance->ConfigFlags.TpmEnable );
+ Status = VarSetValue(0, (UINT32)(((UINTN)&SetupData.TpmAuthenticate - (UINTN)&SetupData)), (UINTN)sizeof(UINT8), &ProtocolInstance->ConfigFlags.TpmAuthenticate );
+ Status = VarSetValue(0, (UINT32)(((UINTN)&SetupData.TpmOperation - (UINTN)&SetupData)), (UINTN)sizeof(UINT8), &ProtocolInstance->ConfigFlags.TpmOperation );
+ Status = VarSetValue(0, (UINT32)(((UINTN)&SetupData.TpmHrdW - (UINTN)&SetupData)), (UINTN)sizeof(UINT8), &ProtocolInstance->ConfigFlags.TpmHardware );
+ Status = VarSetValue(0, (UINT32)(((UINTN)&SetupData.TpmEnaDisable - (UINTN)&SetupData)), (UINTN)sizeof(UINT8), &ProtocolInstance->ConfigFlags.TpmEnaDisable );
+ Status = VarSetValue(0, (UINT32)(((UINTN)&SetupData.TpmActDeact - (UINTN)&SetupData)), (UINTN)sizeof(UINT8), &ProtocolInstance->ConfigFlags.TpmActDeact );
+ Status = VarSetValue(0, (UINT32)(((UINTN)&SetupData.TpmOwnedUnowned - (UINTN)&SetupData)), (UINTN)sizeof(UINT8), &ProtocolInstance->ConfigFlags.TpmOwnedUnowned );
+ Status = VarSetValue(0, (UINT32)(((UINTN)&SetupData.TcgSupportEnabled - (UINTN)&SetupData)), (UINTN)sizeof(UINT8), &ProtocolInstance->ConfigFlags.TcgSupportEnabled );
+ Status = VarSetValue(0, (UINT32)(((UINTN)&SetupData.TpmError - (UINTN)&SetupData)), (UINTN)sizeof(UINT8), &ProtocolInstance->ConfigFlags.TpmError );
+ Status = VarSetValue(0, (UINT32)(((UINTN)&SetupData.SuppressTcg - (UINTN)&SetupData)), (UINTN)sizeof(UINT8), &ProtocolInstance->ConfigFlags.DisallowTpm );
+
+}
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
diff --git a/Board/EM/TCG2/Common/Setup/TPMPwd.c b/Board/EM/TCG2/Common/Setup/TPMPwd.c
new file mode 100644
index 0000000..07cd976
--- /dev/null
+++ b/Board/EM/TCG2/Common/Setup/TPMPwd.c
@@ -0,0 +1,346 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
+// $Header: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Board/EM/TCG2/Common/Setup/TPMPwd.c 1 7/08/15 4:25a Chienhsieh $
+//
+// $Revision: 1 $
+//
+// $Date: 7/08/15 4:25a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Board/EM/TCG2/Common/Setup/TPMPwd.c $
+//
+// 1 7/08/15 4:25a Chienhsieh
+//
+// 2 6/11/14 4:15p Fredericko
+//
+// 1 4/21/14 2:18p Fredericko
+//
+// 1 10/08/13 12:05p Fredericko
+// Initial Check-In for Tpm-Next module
+//
+// 1 7/10/13 5:57p Fredericko
+// [TAG] EIP120969
+// [Category] New Feature
+// [Description] TCG (TPM20)
+//
+// 7 10/22/12 1:21a Jittenkumarp
+// [TAG] EIP100790
+// [Category] Improvement
+// [Description] ActivateApplication in AMITSE delayed if the SoftKbd
+// support enabled thereforTPM Message are not displayed
+// [Files] AmiTcgPlatformDxe.c, TCG.sdl, TPMPwd.c , AmiTcgPlatform.sdl
+//
+// 6 11/22/11 6:45p Fredericko
+// [TAG] EIP67286
+// [Category] Improvement
+// [Description] Separate out how load defaults are handled in setup
+// from the TpmPwd.c
+// [Files] 1. HandleLoadDefaultsSetup.c
+// 2. TcgSetup.cif
+// 3. TcgSetup.mak
+// 4. TpmPwd.c
+//
+// 5 10/07/11 6:55p Fredericko
+//
+// 4 9/03/11 8:07p Fredericko
+//
+// 3 8/26/11 2:59p Fredericko
+// [TAG] EIP67286
+// [Category] Bug Fix
+// [Severity] Minor
+// [Symptom] Tpm strings will not update probably when load optimize
+// defaults is selected in setup
+// [RootCause] Tcgsetup.sd did not account for F3 from setup
+// [Solution] Fix TcgSetup.sd to update setup that status information
+// for TPM will be available after reset.
+// [Files] Tcg.sdl, TPMPwd.c, TcgSetup.sd, TcgSetup.uni
+//
+// 2 3/29/11 1:26p Fredericko
+//
+// 1 3/28/11 2:58p Fredericko
+// [TAG] EIP 54642
+// [Category] Improvement
+// [Description] 1. Checkin Files related to TCG function override
+// 2. Include TCM and TPM auto detection
+// [Files] Affects all TCG files
+//
+// 7 8/09/10 2:32p Fredericko
+// UEFI 2.1 changes
+//
+// 6 5/19/10 6:25p Fredericko
+// Updated AMI Function Headers
+// Code Beautification
+// EIP 37653
+//
+// 5 6/02/09 1:18p Fredericko
+//
+// 4 4/30/09 6:27p Fredericko
+// Updated Header Date
+//
+// 3 4/30/09 5:47p Fredericko
+// AMI company Header Address added
+//
+// 2 10/01/07 5:33p Fasihm
+// Corrected the directive for AMIPostMgr.h to point to the correct
+// location.
+//
+// 1 8/09/07 11:35a Pats
+// Added to support password authentication. Requires TSE with capability
+// of replacing ProcessConInAvailability through elinks.
+//
+//**********************************************************************
+//*************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: TPMPwd.c
+//
+// Description:
+// Contains functions that handle TPM authentication
+//
+//<AMI_FHDR_END>
+//*************************************************************************
+
+#include "token.h"
+#include <EFI.h>
+#include <Protocol/SimpleTextIn.h>
+#include <Protocol/EfiOEMBadging.h>
+#include <Setup.h>
+#include "AMITSEStrTokens.h"
+#include "commonoem.h"
+#include "Protocol\AMIPostMgr.h"
+#include "LogoLib.h"
+#include "Mem.h"
+#include "HiiLib.h"
+#include "PwdLib.h"
+#include "KeyMon.h"
+#include "bootflow.h"
+#include "commonoem.h"
+#include "Core\EM\AMITSE\Inc\Variable.h"
+#include "TcgPlatformSetupPolicy.h"
+
+#if EFI_SPECIFICATION_VERSION>0x20000 && !defined(GUID_VARIABLE_DEFINITION)
+ #include "Include\UefiHii.h"
+ #include "Protocol/HiiDatabase.h"
+ #include "Protocol/HiiString.h"
+#else
+ #include "Protocol/HII.h"
+#endif
+
+#if TPM_PASSWORD_AUTHENTICATION
+#define TCG_PASSWORD_AUTHENTICATION_GUID \
+ {0xB093BDD6, 0x2DE2, 0x4871, 0x87, 0x68, 0xEE, 0x1D, 0xA5, 0x72, 0x49, 0xB4 }
+EFI_GUID TcgPasswordAuthenticationGuid = TCG_PASSWORD_AUTHENTICATION_GUID;
+#endif
+
+extern EFI_BOOT_SERVICES *gBS;
+extern EFI_SYSTEM_TABLE *gST;
+extern EFI_RUNTIME_SERVICES *gRT;
+
+
+typedef struct
+{ UINT16 VID;
+ UINT16 DID;
+} TCM_ID_STRUC;
+
+
+TCM_ID_STRUC TCMSupportedArray[NUMBER_OF_SUPPORTED_TCM_DEVICES]={
+ {SUPPORTED_TCM_DEVICE_1_VID,SUPPORTED_TCM_DEVICE_1_DID}, //ZTEIC
+ {SUPPORTED_TCM_DEVICE_2_VID,SUPPORTED_TCM_DEVICE_2_DID} //ZTEIC2
+};
+
+
+
+//****************************************************************************************
+//<AMI_PHDR_START>
+//
+// Procedure: TCGProcessConInAvailability
+//
+// Description: This is a replacement for the ProcessConInAvailability
+// hook in TSE, to provide password verification in the
+// TCG eModule.
+// This function is a hook called when TSE determines
+// that console is available. This function is available
+// as ELINK. In the generic implementation boot password
+// is prompted in this function.
+//
+//
+// Input: VOID
+//
+// Output: BOOLEAN
+//
+// Modified:
+//
+// Referrals:
+//
+// Notes:
+//<AMI_PHDR_END>
+//****************************************************************************************
+BOOLEAN TCGProcessConInAvailability (
+ EFI_EVENT Event,
+ VOID *Context )
+{
+ CHAR16 *text = NULL;
+ UINTN NoOfRetries;
+ UINT32 PasswordInstalled = AMI_PASSWORD_NONE;
+ UINTN Index;
+ EFI_INPUT_KEY Key;
+ BOOLEAN bScreenUsed = FALSE;
+ UINTN VariableSize = sizeof(UINT32);
+ UINT32 VariableData;
+ BOOLEAN PasswordRequest = FALSE;
+ EFI_GUID TcgEfiGlobalVariableGuid = TCG_EFI_GLOBAL_VARIABLE_GUID;
+ EFI_STATUS Status;
+
+ Status = gRT->GetVariable(
+ L"AskPassword",
+ &TcgEfiGlobalVariableGuid,
+ NULL,
+ &VariableSize,
+ &VariableData
+ );
+
+ if ( VariableData == 0x58494d41 ) // "AMIX"
+ {
+ PasswordRequest = TRUE;
+ }
+
+ PasswordInstalled = PasswordCheckInstalled( );
+ NoOfRetries = 3;
+
+ #if SETUP_USER_PASSWORD_POLICY
+
+ if ((PasswordInstalled & AMI_PASSWORD_USER) || (PasswordRequest))
+ {
+ #else
+
+ if ((PasswordInstalled & AMI_PASSWORD_ANY) || (PasswordRequest))
+ {
+ #endif
+
+ bScreenUsed = TRUE;
+
+ if ( AMI_PASSWORD_NONE ==
+ CheckSystemPassword( AMI_PASSWORD_NONE, &NoOfRetries, NULL ))
+ {
+ while ( 1 )
+ {
+ //Patch
+ //Ctl-Alt-Del is not recognized by core unless a
+ //ReadKeyStroke is issued
+ gBS->WaitForEvent( 1, &(gST->ConIn->WaitForKey), &Index );
+ gST->ConIn->ReadKeyStroke( gST->ConIn, &Key );
+ }
+ }
+ }
+
+ return bScreenUsed;
+}
+
+
+
+//**********************************************************************
+//<AMI_PHDR_START>
+//
+// Procedure: AutoSupportType
+//
+// Description: verifies support for a TCM module on a platform
+//
+// Input: NONE
+//
+// Output: BOOLEAN
+//
+// Modified:
+//
+// Referrals:
+//
+// Notes:
+//<AMI_PHDR_END>
+//**********************************************************************
+extern
+BOOLEAN
+__stdcall AutoSupportType ()
+{
+#if TCG_LEGACY == 0
+ UINTN i=0;
+
+ for(i=0;i<(sizeof(TCMSupportedArray)/sizeof(TCM_ID_STRUC));i++){
+ if((TCMSupportedArray[i].VID == *(UINT16 *)(UINTN)(PORT_TPM_IOMEMBASE + 0xF00)) &&
+ (TCMSupportedArray[i].DID == *(UINT16 *)(UINTN)(PORT_TPM_IOMEMBASE + 0xF02))){
+ return TRUE;
+ }
+ }
+#endif
+ return FALSE;
+}
+
+//****************************************************************************************
+//<AMI_PHDR_START>
+//
+// Procedure: PasswordAuthentication
+//
+// Description: This function is available as ELINK. In will create a Event for password
+// authenication
+//
+//
+// Input: VOID
+//
+// Output:
+// Notes:
+//<AMI_PHDR_END>
+//****************************************************************************************
+
+VOID PasswordAuthentication( VOID )
+{
+ EFI_STATUS Status;
+ VOID *Registration;
+ EFI_EVENT Event;
+
+ Status = gBS->CreateEvent (
+ EVT_NOTIFY_SIGNAL,
+ TPL_CALLBACK,
+ TCGProcessConInAvailability,
+ NULL,
+ &Event
+ );
+ if(EFI_ERROR(Status)) {
+ return ;
+ }
+
+ Status = gBS->RegisterProtocolNotify (
+ &TcgPasswordAuthenticationGuid,
+ Event,
+ &Registration
+ );
+ if(EFI_ERROR(Status)) {
+ return ;
+ }
+
+}
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
diff --git a/Board/EM/TCG2/Common/Setup/TcgSetup.c b/Board/EM/TCG2/Common/Setup/TcgSetup.c
new file mode 100644
index 0000000..38d9ed3
--- /dev/null
+++ b/Board/EM/TCG2/Common/Setup/TcgSetup.c
@@ -0,0 +1,67 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//*************************************************************************
+// $Header: /Alaska/SOURCE/Modules/TCG2/Common/TcgSetup/TcgSetup.c 1 4/21/14 2:18p Fredericko $
+//
+// $Revision: 1 $
+//
+// $Date: 4/21/14 2:18p $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/TCG2/Common/TcgSetup/TcgSetup.c $
+//
+// 1 4/21/14 2:18p Fredericko
+//
+// 1 10/08/13 12:05p Fredericko
+// Initial Check-In for Tpm-Next module
+//
+// 1 7/10/13 5:57p Fredericko
+// [TAG] EIP120969
+// [Category] New Feature
+// [Description] TCG (TPM20)
+//
+// 2 3/29/11 1:24p Fredericko
+//
+// [TAG] EIP 54642
+// [Category] Improvement
+// [Description] 1. Checkin Files related to TCG function override
+// 2. Include TCM and TPM auto detection
+// [Files] Affects all TCG files
+//
+//
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: TcgSetup.c
+//
+// Description:
+//
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Board/EM/TCG2/Common/Setup/TcgSetup.cif b/Board/EM/TCG2/Common/Setup/TcgSetup.cif
new file mode 100644
index 0000000..5f7509f
--- /dev/null
+++ b/Board/EM/TCG2/Common/Setup/TcgSetup.cif
@@ -0,0 +1,15 @@
+<component>
+ name = "TcgSetup"
+ category = ModulePart
+ LocalRoot = "Board\EM\TCG2\Common\Setup"
+ RefName = "TcgSetup"
+[files]
+"TcgSetup.sdl"
+"TcgSetup.mak"
+"TcgSetup.c"
+"TcgSetup.sd"
+"TcgSetup.uni"
+"TcgSetupBoard.h"
+"TPMPwd.c"
+"HandleLoadDefaultsSetup.c"
+<endComponent>
diff --git a/Board/EM/TCG2/Common/Setup/TcgSetup.mak b/Board/EM/TCG2/Common/Setup/TcgSetup.mak
new file mode 100644
index 0000000..b95543c
--- /dev/null
+++ b/Board/EM/TCG2/Common/Setup/TcgSetup.mak
@@ -0,0 +1,123 @@
+#**********************************************************************
+#**********************************************************************
+#** **
+#** (C)Copyright 1985-2010, American Megatrends, Inc. **
+#** **
+#** All Rights Reserved. **
+#** **
+#** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+#** **
+#** Phone: (770)-246-8600 **
+#** **
+#**********************************************************************
+#**********************************************************************
+#**********************************************************************
+# $Header: /Alaska/SOURCE/Modules/TCG2/Common/TcgSetup/TcgSetup.mak 1 4/21/14 2:18p Fredericko $
+#
+# $Revision: 1 $
+#
+# $Date: 4/21/14 2:18p $
+#**********************************************************************
+#*************************************************************************
+# Revision History
+# ----------------
+# $Log: /Alaska/SOURCE/Modules/TCG2/Common/TcgSetup/TcgSetup.mak $
+#
+# 1 4/21/14 2:18p Fredericko
+#
+# 1 10/08/13 12:05p Fredericko
+# Initial Check-In for Tpm-Next module
+#
+# 1 7/10/13 5:57p Fredericko
+# [TAG] EIP120969
+# [Category] New Feature
+# [Description] TCG (TPM20)
+#
+# 5 11/22/11 6:44p Fredericko
+# [TAG] EIP67286
+# [Category] Improvement
+# [Description] Separate out how load defaults are handled in setup
+# from the TpmPwd.c
+# [Files] 1. HandleLoadDefaultsSetup.c
+# 2. TcgSetup.cif
+# 3. TcgSetup.mak
+# 4. TpmPwd.c
+#
+# 4 10/07/11 6:54p Fredericko
+#
+# 3 8/26/11 3:23p Fredericko
+#
+# 2 3/29/11 1:23p Fredericko
+#
+# 1 3/28/11 2:57p Fredericko
+# [TAG] EIP 54642
+# [Category] Improvement
+# [Description] 1. Checkin Files related to TCG function override
+# 2. Include TCM and TPM auto detection
+# [Files] Affects all TCG files
+#
+# 19 5/19/10 6:20p Fredericko
+# Updated AMI copyright header
+# Included File Header
+# EIP 37653
+#
+#*************************************************************************
+#**********************************************************************
+#<AMI_FHDR_START>
+#
+# Name: TcgSetup.mak
+#
+# Description: Make file for the OEM-specific sub-component of TCG
+#
+#<AMI_FHDR_END>
+#**********************************************************************
+all:
+
+$(BUILD_DIR)\TcgSetup.mak : $(TCG_SETUP_DIR)\$(@B).cif $(TCG_SETUP_DIR)\$(@B).mak $(BUILD_RULES)
+ $(CIF2MAK) $(TCG_SETUP_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS)
+
+TPMTSE_CFLAGS=$(CFLAGS) \
+ -I $(TSEBIN_DIR)\Inc \
+ -I $(TSEBIN_DIR)\
+ /I$(TcgPlatformSetupPolicy_DIR)\
+
+!IF $(TPM_PASSWORD_AUTHENTICATION)
+#---------------------------------------------------------------------------
+# Compile Password customization file
+#---------------------------------------------------------------------------
+AMITSEBin : $(BUILD_DIR)\$(TCG_SETUP_DIR)\TPMPwd.obj
+
+$(BUILD_DIR)\$(TCG_SETUP_DIR)\TPMPwd.obj : $(TCG_SETUP_DIR)\TPMPwd.obj
+ $(CC) $(TPMTSE_CFLAGS) /Fo$(BUILD_DIR)\$(TCG_SETUP_DIR)\TPMPwd.obj $(TCG_SETUP_DIR)\TPMPwd.c
+#---------------------------------------------------------------------------
+!ENDIF
+
+AMITSEBin : $(BUILD_DIR)\$(TCG_SETUP_DIR)\HandleLoadDefaultsSetup.obj
+
+$(BUILD_DIR)\$(TCG_SETUP_DIR)\HandleLoadDefaultsSetup.obj : $(TCG_SETUP_DIR)\HandleLoadDefaultsSetup.obj
+ $(CC) $(TPMTSE_CFLAGS) /Fo$(BUILD_DIR)\$(TCG_SETUP_DIR)\HandleLoadDefaultsSetup.obj $(TCG_SETUP_DIR)\HandleLoadDefaultsSetup.c
+
+#---------------------------------------------------------------------------
+# Create TCG Setup Screens
+#---------------------------------------------------------------------------
+SetupSdbs :$(BUILD_DIR)\TcgSetup.mak TCGSDB
+
+TCGSDB :
+ $(MAKE) /$(MAKEFLAGS) $(BUILD_DEFAULTS)\
+ /f $(BUILD_DIR)\TcgSetup.mak all\
+ TYPE=SDB NAME=TcgSetup STRING_CONSUMERS=$(TCG_SETUP_DIR)\TcgSetup.sd
+#---------------------------------------------------------------------------
+
+#**********************************************************************
+#**********************************************************************
+#** **
+#** (C)Copyright 1985-2010, American Megatrends, Inc. **
+#** **
+#** All Rights Reserved. **
+#** **
+#** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+#** **
+#** Phone: (770)-246-8600 **
+#** **
+#**********************************************************************
+#**********************************************************************
diff --git a/Board/EM/TCG2/Common/Setup/TcgSetup.sd b/Board/EM/TCG2/Common/Setup/TcgSetup.sd
new file mode 100644
index 0000000..fe83c2d
--- /dev/null
+++ b/Board/EM/TCG2/Common/Setup/TcgSetup.sd
@@ -0,0 +1,672 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/TCG2/Common/TcgSetup/TcgSetup.sd 1 4/21/14 2:18p Fredericko $
+//
+// $Revision: 1 $
+//
+// $Date: 4/21/14 2:18p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/TCG2/Common/TcgSetup/TcgSetup.sd $
+//
+// 1 4/21/14 2:18p Fredericko
+//
+// 2 3/17/14 3:22p Fredericko
+//
+// 1 10/08/13 12:05p Fredericko
+// Initial Check-In for Tpm-Next module
+//
+// 2 10/03/13 2:45p Fredericko
+//
+// 1 7/10/13 5:57p Fredericko
+// [TAG] EIP120969
+// [Category] New Feature
+// [Description] TCG (TPM20)
+//
+// 6 9/28/11 6:33p Fredericko
+// [TAG] EIPEIP000000
+// [Category] Improvement
+// [Description] Provide a way to destroy TPM support without modifying
+// SDL token
+// [Files] TcgSetup.sd
+//
+// 5 9/07/11 9:31p Fredericko
+//
+// 4 8/29/11 6:52p Fredericko
+// [TAG] EIP00000
+// [Category] Improvement
+// [Description] Tcg Setup Improvement for Tpm status reporting
+// [Files] TcgSetup.sd
+//
+// 3 8/23/11 1:38a Fredericko
+// [TAG] EIP48182
+// [Category] Improvement
+// [Description] Changes to adopted setup customization.
+// [Files] TcgSetup.sd
+//
+// 19 5/19/10 6:24p Fredericko
+// Updated AMI copyright header
+//
+// 18 4/10/10 9:42p Fredericko
+// setup display operations on TPM operations
+//
+// 17 3/19/10 5:26p Fredericko
+// modified for legacy IO interface support
+//
+// 16 11/09/09 12:08p Fredericko
+// Checked in changes for UEFI 2.1. Also backward compatible with UEFI
+// 2.0. Please note that tools update might be required. Should build fine
+// with Tools Version 28.
+//
+// 15 4/30/09 6:26p Fredericko
+// Updated Header Date
+//
+// 14 4/30/09 5:46p Fredericko
+// AMI company Header Address changed
+//
+// 13 12/17/08 8:44p Rameshraju
+// Tpmenableold variable moved out from the Setup structure. EIP 17549
+//
+// 12 8/12/08 12:14p Fasihm
+// Added the Manufacturing flag to all the setup questions.
+//
+// 11 6/25/08 6:23p Fredericko
+// TXT related setup questions and information added.
+//
+// 10 1/04/08 3:51p Fredericko
+// Remove #define in Setup variables since it can cause Setup Size
+// problems in relation to the compiler
+//
+// 9 10/08/07 9:21a Fredericko
+//
+// 7 8/09/07 11:01a Pats
+// Modified to support password authentication, and to reset system if TPM
+// State is changed.
+//
+// 6 6/08/07 6:39p Fredericko
+// New TPm feature to allow disabling/Enabling TPM support. Status display
+// changes.
+//
+// 5 5/24/07 11:32a Fredericko
+// Improve Aesthetic value of TPM module in setup
+//
+// 4 5/22/07 7:21p Fredericko
+//
+// 3 5/22/07 4:00p Fredericko
+// TPM setup display status feature added
+//
+// 2 3/12/07 11:46a Fredericko
+// Feature: Grayout Setup operation if TCG is disabled in setup.
+//
+// 1 10/06/06 5:15p Andriyn
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: TCG.sd
+//
+// Description: TCG Form Template
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+
+#ifdef SETUP_DATA_DEFINITION
+/***********************************************************/
+/* Put NVRAM data definitions here.
+/* For example: UINT8 Data1;
+/* These definitions will be converted by the build process
+/* to a definitions of SETUP_DATA fields.
+/***********************************************************/
+ UINT8 TpmEnable;
+ UINT8 TpmOperation;
+ UINT8 TpmEnaDisable;
+ UINT8 TpmActDeact;
+ UINT8 TpmOwnedUnowned;
+ UINT8 TpmSupport;
+ UINT8 TcgSupportEnabled;
+ UINT8 TcmSupport;
+ UINT8 TpmHrdW;
+ UINT8 TpmAuthenticate;
+ UINT8 SuppressTcg;
+ UINT8 TpmError;
+ UINT8 Tpm20Device;
+ UINT8 ShaPolicy;
+#endif
+
+#if defined(VFRCOMPILE) && !defined(CONTROLS_ARE_DEFINED)
+#define CONTROL_DEFINITION
+#endif
+#ifdef CONTROL_DEFINITION
+
+#define TCG_ONEOF_TPMSUPPORT\
+ oneof varid = SETUP_DATA.TpmSupport,\
+ prompt = STRING_TOKEN(STR_TPM_SUPPORT_PROMPT ),\
+ help = STRING_TOKEN(STR_TPMSUPPORT_HELP),\
+ option text = STRING_TOKEN(STR_TPM_DISABLE), value = 0, flags = RESET_REQUIRED;\
+ option text = STRING_TOKEN(STR_TPM_ENABLE), value = 1, flags = RESET_REQUIRED | MANUFACTURING | DEFAULT;\
+ endoneof;
+
+
+#define TCG_ONEOF_TCMSUPPORT\
+ oneof varid = SETUP_DATA.TpmSupport,\
+ prompt = STRING_TOKEN(STR_TCM_SUPPORT_PROMPT ),\
+ help = STRING_TOKEN(STR_TPMSUPPORT_HELP),\
+ option text = STRING_TOKEN(STR_TPM_DISABLE), value = 0, flags = RESET_REQUIRED;\
+ option text = STRING_TOKEN(STR_TPM_ENABLE), value = 1, flags = RESET_REQUIRED | MANUFACTURING | DEFAULT;\
+ endoneof;
+
+#define TCG_ONEOF_TPMAUTHENTICATE\
+ oneof varid = SETUP_DATA.TpmAuthenticate,\
+ prompt = STRING_TOKEN(STR_TPM_PASS_PROMPT),\
+ help = STRING_TOKEN(STR_TPM_PASS_HELP),\
+ option text = STRING_TOKEN(STR_TPM_DISABLE), value = 0, flags = RESET_REQUIRED | MANUFACTURING | DEFAULT;\
+ option text = STRING_TOKEN(STR_TPM_ENABLE), value = 1, flags = RESET_REQUIRED;\
+ endoneof;
+
+#define TCG_ONEOF_TPMENABLE\
+ oneof varid = SETUP_DATA.TpmEnable,\
+ prompt = STRING_TOKEN(STR_TPM_PROMPT),\
+ help = STRING_TOKEN(STR_TPM_HELP),\
+ option text = STRING_TOKEN(STR_TPM_DISABLED), value = 0, flags = RESET_REQUIRED | MANUFACTURING | DEFAULT;\
+ option text = STRING_TOKEN(STR_TPM_ENABLED), value = 1, flags = RESET_REQUIRED;\
+ endoneof;
+
+#define TCG_ONEOF_TCMENABLE\
+ oneof varid = SETUP_DATA.TpmEnable,\
+ prompt = STRING_TOKEN(STR_TCM_PROMPT),\
+ help = STRING_TOKEN(STR_TPM_HELP),\
+ option text = STRING_TOKEN(STR_TPM_DISABLED), value = 0, flags = RESET_REQUIRED | MANUFACTURING | DEFAULT;\
+ option text = STRING_TOKEN(STR_TPM_ENABLED), value = 1, flags = RESET_REQUIRED;\
+ endoneof;
+
+#define TCG_ONEOF_TPMOPERATION\
+ oneof varid = SETUP_DATA.TpmOperation,\
+ prompt = STRING_TOKEN(STR_TPMOP_PROMPT),\
+ help = STRING_TOKEN(STR_TPMOP_HELP),\
+ option text = STRING_TOKEN(STR_TPM_NONE), value = 0, flags = RESET_REQUIRED | MANUFACTURING | DEFAULT;\
+ option text = STRING_TOKEN(STR_TPM_OWNER), value = TCPA_PPIOP_OWNER_ON, flags = RESET_REQUIRED;\
+ option text = STRING_TOKEN(STR_TPM_NOOWNER), value = TCPA_PPIOP_OWNER_OFF, flags = RESET_REQUIRED;\
+ option text = STRING_TOKEN(STR_TPM_CLEAR), value = TCPA_PPIOP_CLEAR, flags = RESET_REQUIRED;\
+ endoneof;
+
+
+#define TCG_ONEOF_TCMOPERATION\
+ oneof varid = SETUP_DATA.TpmOperation,\
+ prompt = STRING_TOKEN(STR_TPMOP_PROMPT),\
+ help = STRING_TOKEN(STR_TPMOP_HELP),\
+ option text = STRING_TOKEN(STR_TPM_NONE), value = 0, flags = RESET_REQUIRED | MANUFACTURING | DEFAULT;\
+ option text = STRING_TOKEN(STR_TPM_OWNER), value = TCPA_PPIOP_OWNER_ON, flags = RESET_REQUIRED;\
+ option text = STRING_TOKEN(STR_TPM_NOOWNER), value = TCPA_PPIOP_OWNER_OFF, flags = RESET_REQUIRED;\
+ option text = STRING_TOKEN(STR_TCM_CLEAR), value = TCPA_PPIOP_CLEAR, flags = RESET_REQUIRED;\
+ endoneof;
+
+#define TCG_ONEOF_HASHPOLICY\
+ oneof varid = SETUP_DATA.ShaPolicy,\
+ prompt = STRING_TOKEN(STR_HASHPOLICY),\
+ help = STRING_TOKEN(STR_HASHPOLICY_HELP),\
+ option text = STRING_TOKEN(STR_SHA1), value = 0, flags = RESET_REQUIRED | MANUFACTURING | DEFAULT;\
+ endoneof;
+
+
+
+#define TCG_ONEOF_TPMENADISABLE\
+ oneof varid = SETUP_DATA.TpmEnaDisable,\
+ prompt = STRING_TOKEN(STR_ENABLED_PROMPT),\
+ help = STRING_TOKEN(STR_ONOFFSTATE_HELP),\
+ option text = STRING_TOKEN(STR_TPMDISABLED), value = 1, flags = DEFAULT | MANUFACTURING;\
+ option text = STRING_TOKEN(STR_TPMENABLED), value = 0, flags = 0;\
+ endoneof;
+
+#define TCG_ONEOF_TCMENADISABLE\
+ oneof varid = SETUP_DATA.TpmEnaDisable,\
+ prompt = STRING_TOKEN(STR_TCM_ENABLED_PROMPT),\
+ help = STRING_TOKEN(STR_ONOFFSTATE_HELP),\
+ option text = STRING_TOKEN(STR_TPMDISABLED), value = 1, flags = DEFAULT | MANUFACTURING;\
+ option text = STRING_TOKEN(STR_TPMENABLED), value = 0, flags = 0;\
+ endoneof;
+
+#define TCG_ONEOF_TPMACTDEACT\
+ oneof varid = SETUP_DATA.TpmActDeact,\
+ prompt = STRING_TOKEN(STR_ACTIVATE_PROMPT),\
+ help = STRING_TOKEN(STR_ONOFFSTATE_HELP),\
+ option text = STRING_TOKEN(STR_TPMDEACTIVATED), value = 1, flags = DEFAULT | MANUFACTURING;\
+ option text = STRING_TOKEN(STR_TPMACTIVATED), value = 0, flags = 0;\
+ endoneof;
+
+#define TCG_ONEOF_TCMACTDEACT\
+ oneof varid = SETUP_DATA.TpmActDeact,\
+ prompt = STRING_TOKEN(STR_TCM_ACTIVATE_PROMPT),\
+ help = STRING_TOKEN(STR_ONOFFSTATE_HELP),\
+ option text = STRING_TOKEN(STR_TPMDEACTIVATED), value = 1, flags = DEFAULT |MANUFACTURING;\
+ option text = STRING_TOKEN(STR_TPMACTIVATED), value = 0, flags = 0;\
+ endoneof;
+
+#define TCG_ONEOF_TPMOWNEDUNOWNED\
+ oneof varid = SETUP_DATA.TpmOwnedUnowned,\
+ prompt = STRING_TOKEN(STR_OWNED_OR_UNOWNED_PROMPT),\
+ help = STRING_TOKEN(STR_OWNED_OR_UNOWNED_HELP),\
+ option text = STRING_TOKEN(STR_OWNED), value = 1, flags = 0;\
+ option text = STRING_TOKEN(STR_UNOWNED), value = 0, flags = DEFAULT | MANUFACTURING;\
+ endoneof;
+
+#define TCG_ONEOF_TCMOWNEDUNOWNED\
+ oneof varid = SETUP_DATA.TpmOwnedUnowned,\
+ prompt = STRING_TOKEN(STR_TCM_OWNED_OR_UNOWNED_PROMPT),\
+ help = STRING_TOKEN(STR_OWNED_OR_UNOWNED_HELP),\
+ option text = STRING_TOKEN(STR_OWNED), value = 1, flags = 0;\
+ option text = STRING_TOKEN(STR_UNOWNED), value = 0, flags = DEFAULT |MANUFACTURING;\
+ endoneof;
+
+#endif //#ifdef CONTROL_DEFINITION
+
+#ifdef CONTROLS_WITH_DEFAULTS
+ TCG_ONEOF_TPMSUPPORT
+ TCG_ONEOF_TCMSUPPORT
+ TCG_ONEOF_TPMAUTHENTICATE
+ TCG_ONEOF_TPMENABLE
+ TCG_ONEOF_TCMENABLE
+ TCG_ONEOF_TPMOPERATION
+ TCG_ONEOF_TCMOPERATION
+ TCG_ONEOF_TPMENADISABLE
+ TCG_ONEOF_TCMENADISABLE
+ TCG_ONEOF_TPMACTDEACT
+ TCG_ONEOF_TCMACTDEACT
+ TCG_ONEOF_TPMOWNEDUNOWNED
+ TCG_ONEOF_TCMOWNEDUNOWNED
+#endif //#ifdef CONTROLS_WITH_DEFAULTS
+
+#ifdef FORM_SET_TYPEDEF
+ #include <TcgSetupBoard.h>
+ #include <token.h>
+#endif // FORM_SET_TYPEDEF
+
+#ifdef ADVANCED_FORM_SET
+ #ifndef SUPPRESS_GRAYOUT_ENDIF //old Core
+ #define SUPPRESS_GRAYOUT_ENDIF endif;
+ #endif
+
+ #ifdef FORM_SET_ITEM
+ // Define controls to be added to the main page of the formset
+ #endif
+
+ #ifdef FORM_SET_GOTO
+ // Define goto commands for the forms defined in this file
+ suppressif ideqval SETUP_DATA.SuppressTcg == 1;
+ suppressif ideqval SETUP_DATA.Tpm20Device == 1;
+ goto TCG_FORM_ID,
+ prompt = STRING_TOKEN(STR_TCG_FORM),
+ help = STRING_TOKEN(STR_TCG_FORM_HELP);
+ endif;
+ suppressif ideqval SETUP_DATA.Tpm20Device == 0;
+ goto TCG20_FORM_ID,
+ prompt = STRING_TOKEN(STR_TCG_FORM),
+ help = STRING_TOKEN(STR_TCG_FORM_HELP);
+ endif;
+ endif;
+ #endif
+
+#ifdef FORM_SET_FORM
+
+ #ifndef TCG_FORM_TCG
+ #define TCG_FORM_TCG
+
+ // Define forms
+ form formid = AUTO_ID(TCG_FORM_ID),
+ title = STRING_TOKEN(STR_TCG_FORM);
+
+
+ SUBTITLE(STRING_TOKEN(STR_TPM_CONFIGURATION))
+
+#if TPM_PASSWORD_AUTHENTICATION
+
+ suppressif ideqval SETUP_DATA.TcmSupport == 1;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER AND
+ ideqval SETUP_DATA.TpmAuthenticate == 1;
+
+ TCG_ONEOF_TPMSUPPORT
+
+ SUPPRESS_GRAYOUT_ENDIF // suppress-grayout
+
+ suppressif ideqval SETUP_DATA.TpmHrdW == 1 OR
+ ideqval SETUP_DATA.TpmHrdW == 2 OR
+ ideqval AMITSESETUP.AdminPassword == 0 OR
+ ideqval SETUP_DATA.TcmSupport == 1 OR
+ ideqval SETUP_DATA.TcgSupportEnabled == 0 OR
+ ideqval SETUP_DATA.TpmSupport == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER;
+
+ TCG_ONEOF_TPMAUTHENTICATE
+
+ SUPPRESS_GRAYOUT_ENDIF // suppress-grayout
+
+ suppressif ideqval SETUP_DATA.TpmHrdW == 1 OR
+ ideqval SETUP_DATA.TpmHrdW == 2 OR
+ ideqval SETUP_DATA.TcmSupport == 1 OR
+ ideqval SETUP_DATA.TcgSupportEnabled == 0 OR
+ ideqval SETUP_DATA.TpmSupport == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER AND
+ ideqval SETUP_DATA.TpmAuthenticate == 1;
+
+ TCG_ONEOF_TPMENABLE
+
+ SUPPRESS_GRAYOUT_ENDIF
+
+ suppressif ideqval SETUP_DATA.TpmHrdW == 1 OR
+ ideqval SETUP_DATA.TpmHrdW == 2 OR
+ ideqval SETUP_DATA.TcmSupport == 1 OR
+ ideqval SETUP_DATA.TcgSupportEnabled == 0 OR
+ ideqval SETUP_DATA.TpmSupport == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER AND
+ ideqval SETUP_DATA.TpmAuthenticate == 1 OR
+ ideqval SETUP_DATA.TpmActDeact == 1 OR
+ ideqval SETUP_DATA.TpmEnable == 0;
+
+ TCG_ONEOF_TPMOPERATION
+
+ SUPPRESS_GRAYOUT_ENDIF
+
+ suppressif ideqval SETUP_DATA.TcmSupport == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER AND
+ ideqval SETUP_DATA.TpmAuthenticate == 1;
+
+ TCG_ONEOF_TCMSUPPORT
+
+ SUPPRESS_GRAYOUT_ENDIF // suppress-grayout
+
+ suppressif ideqval SETUP_DATA.TpmHrdW == 1 OR
+ ideqval SETUP_DATA.TpmHrdW == 2 OR
+ ideqval AMITSESETUP.AdminPassword == 0 OR
+ ideqval SETUP_DATA.TcmSupport == 0 OR
+ ideqval SETUP_DATA.TpmSupport == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER;
+
+ TCG_ONEOF_TPMAUTHENTICATE
+
+ SUPPRESS_GRAYOUT_ENDIF // suppress-grayout
+
+ suppressif ideqval SETUP_DATA.TpmHrdW == 1 OR
+ ideqval SETUP_DATA.TpmHrdW == 2 OR
+ ideqval SETUP_DATA.TcmSupport == 0 OR
+ ideqval SETUP_DATA.TcgSupportEnabled == 0 OR
+ ideqval SETUP_DATA.TpmSupport == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER AND
+ ideqval SETUP_DATA.TpmAuthenticate == 1;
+
+ TCG_ONEOF_TCMENABLE
+
+ SUPPRESS_GRAYOUT_ENDIF
+
+ suppressif ideqval SETUP_DATA.TpmHrdW == 1 OR
+ ideqval SETUP_DATA.TpmHrdW == 2 OR
+ ideqval SETUP_DATA.TcmSupport == 0 OR
+ ideqval SETUP_DATA.TcgSupportEnabled == 0 OR
+ ideqval SETUP_DATA.TpmSupport == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER AND
+ ideqval SETUP_DATA.TpmAuthenticate == 1 OR
+ ideqval SETUP_DATA.TpmActDeact == 1 OR
+ ideqval SETUP_DATA.TpmEnable == 0;
+
+ TCG_ONEOF_TPMOPERATION
+
+ SUPPRESS_GRAYOUT_ENDIF
+
+#if DISPLAY_TPM_SETUP_ERROR == 1
+ suppressif ideqval SETUP_DATA.TpmError == 0;
+ text
+ help = STRING_TOKEN(STR_EMPTY),
+ text = STRING_TOKEN(STR_TPM_SETUP_ERROR),
+ text = STRING_TOKEN(STR_EMPTY),
+ flags = 0,
+ key = 0;
+ endif;
+#endif
+
+#else
+
+ suppressif ideqval SETUP_DATA.TcmSupport == 1;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER;
+
+ TCG_ONEOF_TPMSUPPORT
+
+ SUPPRESS_GRAYOUT_ENDIF
+
+ suppressif ideqval SETUP_DATA.TpmHrdW == 1 OR
+ ideqval SETUP_DATA.TpmHrdW == 2 OR
+ ideqval SETUP_DATA.TcmSupport == 1 OR
+ ideqval SETUP_DATA.TcgSupportEnabled == 0 OR
+ ideqval SETUP_DATA.TpmSupport == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER;
+
+ TCG_ONEOF_TPMENABLE
+
+ SUPPRESS_GRAYOUT_ENDIF
+
+ suppressif ideqval SETUP_DATA.TpmHrdW == 1 OR
+ ideqval SETUP_DATA.TpmHrdW == 2 OR
+ ideqval SETUP_DATA.TcmSupport == 1 OR
+ ideqval SETUP_DATA.TcgSupportEnabled == 0 OR
+ ideqval SETUP_DATA.TpmSupport == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER OR
+ ideqval SETUP_DATA.TpmActDeact == 1 OR
+ ideqval SETUP_DATA.TpmEnable == 0;
+
+ TCG_ONEOF_TPMOPERATION
+
+ SUPPRESS_GRAYOUT_ENDIF
+
+
+ suppressif ideqval SETUP_DATA.TcmSupport == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER;
+
+ TCG_ONEOF_TCMSUPPORT
+
+ SUPPRESS_GRAYOUT_ENDIF
+
+ suppressif ideqval SETUP_DATA.TpmHrdW == 1 OR
+ ideqval SETUP_DATA.TpmHrdW == 2 OR
+ ideqval SETUP_DATA.TcmSupport == 0 OR
+ ideqval SETUP_DATA.TcgSupportEnabled == 0 OR
+ ideqval SETUP_DATA.TpmSupport == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER;
+
+ TCG_ONEOF_TCMENABLE
+
+ SUPPRESS_GRAYOUT_ENDIF
+
+ suppressif ideqval SETUP_DATA.TpmHrdW == 1 OR
+ ideqval SETUP_DATA.TpmHrdW == 2 OR
+ ideqval SETUP_DATA.TcmSupport == 0 OR
+ ideqval SETUP_DATA.TcgSupportEnabled == 0 OR
+ ideqval SETUP_DATA.TpmSupport == 0;
+ grayoutif ideqval SYSTEM_ACCESS.Access == SYSTEM_PASSWORD_USER OR
+ ideqval SETUP_DATA.TpmActDeact == 1 OR
+ ideqval SETUP_DATA.TpmEnable == 0;
+
+ TCG_ONEOF_TPMOPERATION
+
+ SUPPRESS_GRAYOUT_ENDIF
+
+#endif
+
+ SEPARATOR
+ SEPARATOR
+
+ SUBTITLE(STRING_TOKEN(STR_TPM_STATUS_INFO))
+
+#if TCG_LEGACY == 0
+ suppressif ideqval SETUP_DATA.TpmHrdW == 0 OR
+ ideqval SETUP_DATA.TpmHrdW == 2;
+ text
+ help = STRING_TOKEN(STR_EMPTY),
+ text = STRING_TOKEN(STR_TPMHARDWARE),
+ text = STRING_TOKEN(STR_EMPTY),
+ flags = 0,
+ key = 0;
+ endif;
+
+ suppressif ideqval SETUP_DATA.TcgSupportEnabled == 1 OR
+ ideqval SETUP_DATA.TpmHrdW == 1 OR
+ ideqval SETUP_DATA.TpmHrdW == 2;
+ text
+ help = STRING_TOKEN(STR_EMPTY),
+ text = STRING_TOKEN(STR_TPMSUPP),
+ text = STRING_TOKEN(STR_EMPTY),
+ flags = 0,
+ key = 0;
+ endif;
+
+
+ suppressif ideqval SETUP_DATA.TpmHrdW == 0 OR
+ ideqval SETUP_DATA.TpmHrdW == 1;
+ text
+ help = STRING_TOKEN(STR_EMPTY),
+ text = STRING_TOKEN(STR_TPMOPTIMIZE),
+ text = STRING_TOKEN(STR_EMPTY),
+ flags = 0,
+ key = 0;
+ endif;
+#endif
+
+ suppressif ideqval SETUP_DATA.TpmHrdW == 1 OR
+ ideqval SETUP_DATA.TpmHrdW == 2 OR
+ ideqval SETUP_DATA.TcmSupport == 1 OR
+ ideqval SETUP_DATA.TcgSupportEnabled == 0 OR
+ ideqval SETUP_DATA.TpmSupport == 0;
+ grayoutif ideqval SETUP_DATA.TpmEnable == 0 OR
+ ideqval SETUP_DATA.TpmEnable == 1;
+
+ TCG_ONEOF_TPMENADISABLE
+
+ SUPPRESS_GRAYOUT_ENDIF
+
+
+ suppressif ideqval SETUP_DATA.TpmHrdW == 1 OR
+ ideqval SETUP_DATA.TpmHrdW == 2 OR
+ ideqval SETUP_DATA.TcmSupport == 1 OR
+ ideqval SETUP_DATA.TcgSupportEnabled == 0 OR
+ ideqval SETUP_DATA.TpmSupport == 0;
+ grayoutif ideqval SETUP_DATA.TpmEnable == 0 OR
+ ideqval SETUP_DATA.TpmEnable == 1;
+
+ TCG_ONEOF_TPMACTDEACT
+
+ SUPPRESS_GRAYOUT_ENDIF
+
+ suppressif ideqval SETUP_DATA.TpmHrdW == 1 OR
+ ideqval SETUP_DATA.TpmHrdW == 2 OR
+ ideqval SETUP_DATA.TcmSupport == 1 OR
+ ideqval SETUP_DATA.TcgSupportEnabled == 0 OR
+ ideqval SETUP_DATA.TpmSupport == 0;
+ grayoutif ideqval SETUP_DATA.TpmEnable == 0 OR
+ ideqval SETUP_DATA.TpmEnable == 1;
+
+ TCG_ONEOF_TPMOWNEDUNOWNED
+
+ SUPPRESS_GRAYOUT_ENDIF
+
+
+ suppressif ideqval SETUP_DATA.TpmHrdW == 1 OR
+ ideqval SETUP_DATA.TpmHrdW == 2 OR
+ ideqval SETUP_DATA.TcmSupport == 0 OR
+ ideqval SETUP_DATA.TcgSupportEnabled == 0 OR
+ ideqval SETUP_DATA.TpmSupport == 0;
+ grayoutif ideqval SETUP_DATA.TpmEnable == 0 OR
+ ideqval SETUP_DATA.TpmEnable == 1;
+
+ TCG_ONEOF_TCMENADISABLE
+
+ SUPPRESS_GRAYOUT_ENDIF
+
+
+ suppressif ideqval SETUP_DATA.TpmHrdW == 1 OR
+ ideqval SETUP_DATA.TpmHrdW == 2 OR
+ ideqval SETUP_DATA.TcmSupport == 0 OR
+ ideqval SETUP_DATA.TcgSupportEnabled == 0 OR
+ ideqval SETUP_DATA.TpmSupport == 0;
+ grayoutif ideqval SETUP_DATA.TpmEnable == 0 OR
+ ideqval SETUP_DATA.TpmEnable == 1;
+
+ TCG_ONEOF_TCMACTDEACT
+
+ SUPPRESS_GRAYOUT_ENDIF
+
+ suppressif ideqval SETUP_DATA.TpmHrdW == 1 OR
+ ideqval SETUP_DATA.TpmHrdW == 2 OR
+ ideqval SETUP_DATA.TcmSupport == 0 OR
+ ideqval SETUP_DATA.TcgSupportEnabled == 0 OR
+ ideqval SETUP_DATA.TpmSupport == 0;
+ grayoutif ideqval SETUP_DATA.TpmEnable == 0 OR
+ ideqval SETUP_DATA.TpmEnable == 1;
+
+ TCG_ONEOF_TCMOWNEDUNOWNED
+
+ SUPPRESS_GRAYOUT_ENDIF
+
+#if DISPLAY_TPM_SETUP_ERROR == 1
+ suppressif ideqval SETUP_DATA.TpmError == 0;
+ text
+ help = STRING_TOKEN(STR_EMPTY),
+ text = STRING_TOKEN(STR_TPM_SETUP_ERROR),
+ text = STRING_TOKEN(STR_EMPTY),
+ flags = 0,
+ key = 0;
+ endif;
+#endif
+ endform;
+ #endif // #ifndef TCG_FORM_TCG
+
+#ifdef FORM_SET_FORM
+
+ #ifndef TCG20_FORM_TCG
+ #define TCG20_FORM_TCG
+
+ // Define forms
+ form formid = AUTO_ID(TCG20_FORM_ID),
+ title = STRING_TOKEN(STR_TCG_FORM);
+
+ SEPARATOR
+ SEPARATOR
+
+ TCG_ONEOF_TPMSUPPORT
+
+ SEPARATOR
+
+ SUBTITLE(STRING_TOKEN(STR_TPM_20_DEVICE))
+
+ grayoutif ideqval SETUP_DATA.CsmLaunchPolicy == 1;
+ TCG_ONEOF_HASHPOLICY
+ endif;
+
+ endform;
+ #endif
+#endif //end TCG20_FORM
+
+ #endif
+#endif // ADVANCED_FORM_SET
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Board/EM/TCG2/Common/Setup/TcgSetup.sdl b/Board/EM/TCG2/Common/Setup/TcgSetup.sdl
new file mode 100644
index 0000000..287713b
--- /dev/null
+++ b/Board/EM/TCG2/Common/Setup/TcgSetup.sdl
@@ -0,0 +1,50 @@
+TOKEN
+ Name = "TCGSETUP_SUPPORT"
+ Value = "1"
+ Help = "Main switch to control TCG setup pages"
+ TokenType = Boolean
+ TargetEQU = Yes
+ TargetMAK = Yes
+ Master = Yes
+End
+
+TOKEN
+ Name = "DISPLAY_TPM_SETUP_ERROR"
+ Value = "0"
+ Help = "Control warning message in setup if a TPM request form setup failed "
+ TokenType = Boolean
+ TargetEQU = Yes
+ TargetH = Yes
+ TargetMAK = Yes
+End
+
+MODULE
+ Help = "Includes TcgSetup.mak to Project"
+ File = "TcgSetup.mak"
+End
+
+PATH
+ Name = "TCG_SETUP_DIR"
+ Help = "Tcg Setup Directory"
+End
+
+ELINK
+ Name = "$(TCG_SETUP_DIR)\TcgSetup.sd"
+ Parent = "SETUP_DEFINITIONS"
+ Priority = 0
+ InvokeOrder = AfterParent
+End
+
+ELINK
+ Name = "$(BUILD_DIR)\TcgSetup.sdb"
+ Parent = "SETUP_SDBS"
+ Priority = 0
+ InvokeOrder = AfterParent
+End
+
+ELINK
+ Name = "-i $(TCG_SETUP_DIR)"
+ Parent = "SETUP_VFR_INCLUDES"
+ Priority = 0
+ InvokeOrder = AfterParent
+End
diff --git a/Board/EM/TCG2/Common/Setup/TcgSetup.uni b/Board/EM/TCG2/Common/Setup/TcgSetup.uni
new file mode 100644
index 0000000..f845d95
--- /dev/null
+++ b/Board/EM/TCG2/Common/Setup/TcgSetup.uni
Binary files differ
diff --git a/Board/EM/TCG2/Common/Setup/TcgSetupBoard.h b/Board/EM/TCG2/Common/Setup/TcgSetupBoard.h
new file mode 100644
index 0000000..879a191
--- /dev/null
+++ b/Board/EM/TCG2/Common/Setup/TcgSetupBoard.h
@@ -0,0 +1,95 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//*************************************************************************
+// $Header: /Alaska/SOURCE/Modules/TCG2/Common/TcgSetup/TcgSetupBoard.h 1 4/21/14 2:18p Fredericko $
+//
+// $Revision: 1 $
+//
+// $Date: 4/21/14 2:18p $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/TCG2/Common/TcgSetup/TcgSetupBoard.h $
+//
+// 1 4/21/14 2:18p Fredericko
+//
+// 1 10/08/13 12:05p Fredericko
+// Initial Check-In for Tpm-Next module
+//
+// 1 7/10/13 5:57p Fredericko
+// [TAG] EIP120969
+// [Category] New Feature
+// [Description] TCG (TPM20)
+//
+// 3 7/25/11 3:16a Fredericko
+// [TAG] EIP65177
+// [Category] Spec Update
+// [Severity] Minor
+// [Description] TCG PPI Spec ver 1.2 update
+//
+// 2 3/29/11 1:26p Fredericko
+//
+// [TAG] EIP 54642
+// [Category] Improvement
+// [Description] 1. Checkin Files related to TCG function override
+// 2. Include TCM and TPM auto detection
+// [Files] Affects all TCG files
+//
+//
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: TcgSetupBoard.h
+//
+// Description:
+//
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+
+#define TCPA_PPIOP_ENABLE 1
+#define TCPA_PPIOP_DISABLE 2
+#define TCPA_PPIOP_ACTIVATE 3
+#define TCPA_PPIOP_DEACTIVATE 4
+#define TCPA_PPIOP_CLEAR 5
+#define TCPA_PPIOP_ENABLE_ACTV 6
+#define TCPA_PPIOP_DEACT_DSBL 7
+#define TCPA_PPIOP_OWNER_ON 8
+#define TCPA_PPIOP_OWNER_OFF 9
+#define TCPA_PPIOP_ENACTVOWNER 10
+#define TCPA_PPIOP_DADISBLOWNER 11
+#define TCPA_PPIOP_UNOWNEDFIELDUPGRADE 12
+#define TCPA_PPIOP_SETOPAUTH 13
+#define TCPA_PPIOP_CLEAR_ENACT 14
+#define TCPA_PPIOP_SETNOPPIPROVISION_FALSE 15
+#define TCPA_PPIOP_SETNOPPIPROVISION_TRUE 16
+#define TCPA_PPIOP_SETNOPPICLEAR_FALSE 17
+#define TCPA_PPIOP_SETNOPPICLEAR_TRUE 18
+#define TCPA_PPIOP_SETNOPPIMAINTENANCE_FALSE 19
+#define TCPA_PPIOP_SETNOPPIMAINTENANCE_TRUE 20
+#define TCPA_PPIOP_ENABLE_ACTV_CLEAR 21
+#define TCPA_PPIOP_ENABLE_ACTV_CLEAR_ENABLE_ACTV 22
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************