summaryrefslogtreecommitdiff
path: root/Core/EM/TCG2/Tpm1_2_lib
diff options
context:
space:
mode:
Diffstat (limited to 'Core/EM/TCG2/Tpm1_2_lib')
-rw-r--r--Core/EM/TCG2/Tpm1_2_lib/AmiTcmlib.c125
-rw-r--r--Core/EM/TCG2/Tpm1_2_lib/AmiTcmlib.cif12
-rw-r--r--Core/EM/TCG2/Tpm1_2_lib/AmiTcmlib.dxs68
-rw-r--r--Core/EM/TCG2/Tpm1_2_lib/AmiTcmlib.h74
-rw-r--r--Core/EM/TCG2/Tpm1_2_lib/AmiTcmlib.mak91
-rw-r--r--Core/EM/TCG2/Tpm1_2_lib/AmiTcmlib.sdl71
6 files changed, 441 insertions, 0 deletions
diff --git a/Core/EM/TCG2/Tpm1_2_lib/AmiTcmlib.c b/Core/EM/TCG2/Tpm1_2_lib/AmiTcmlib.c
new file mode 100644
index 0000000..d1e5c44
--- /dev/null
+++ b/Core/EM/TCG2/Tpm1_2_lib/AmiTcmlib.c
@@ -0,0 +1,125 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (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/Libraries/TisLib/AmiTcmlib/AmiTcmlib.c 1 4/21/14 2:15p Fredericko $
+//
+// $Revision: 1 $
+//
+// $Date: 4/21/14 2:15p $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/TCG2/Libraries/TisLib/AmiTcmlib/AmiTcmlib.c $
+//
+// 1 4/21/14 2:15p Fredericko
+//
+// 1 10/08/13 11:59a Fredericko
+// Initial Check-In for Tpm-Next module
+//
+// 1 7/10/13 5:50p Fredericko
+// [TAG] EIP120969
+// [Category] New Feature
+// [Description] TCG (TPM20)
+//
+// 6 4/01/11 9:32a Fredericko
+// Updated function Header
+//
+// 5 3/31/11 4:48p Fredericko
+// Changes for TCG_Legacy support
+//
+// 4 3/29/11 4:51p Fredericko
+// Moved TCM device ID and Vendor ID check to tokens.
+//
+// 3 3/29/11 12:52p Fredericko
+//
+// 2 3/29/11 12:07p 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: AmiTcmlib.c
+//
+// Description:
+// AmiTcmlibrary functions
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#include "AmiTcmlib.h"
+#include "token.h"
+
+
+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: 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;
+}
+
+
+
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (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/Core/EM/TCG2/Tpm1_2_lib/AmiTcmlib.cif b/Core/EM/TCG2/Tpm1_2_lib/AmiTcmlib.cif
new file mode 100644
index 0000000..f6aeaef
--- /dev/null
+++ b/Core/EM/TCG2/Tpm1_2_lib/AmiTcmlib.cif
@@ -0,0 +1,12 @@
+<component>
+ name = "AmiTcmlib"
+ category = ModulePart
+ LocalRoot = "Core\EM\TCG2\Tpm1_2_lib"
+ RefName = "AmiTcmlib"
+[files]
+"AmiTcmlib.sdl"
+"AmiTcmlib.mak"
+"AmiTcmlib.h"
+"AmiTcmlib.dxs"
+"AmiTcmlib.c"
+<endComponent>
diff --git a/Core/EM/TCG2/Tpm1_2_lib/AmiTcmlib.dxs b/Core/EM/TCG2/Tpm1_2_lib/AmiTcmlib.dxs
new file mode 100644
index 0000000..01c3223
--- /dev/null
+++ b/Core/EM/TCG2/Tpm1_2_lib/AmiTcmlib.dxs
@@ -0,0 +1,68 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (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/Libraries/TisLib/AmiTcmlib/AmiTcmlib.dxs 1 4/21/14 2:15p Fredericko $
+//
+// $Revision: 1 $
+//
+// $Date: 4/21/14 2:15p $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/TCG2/Libraries/TisLib/AmiTcmlib/AmiTcmlib.dxs $
+//
+// 1 4/21/14 2:15p Fredericko
+//
+// 1 10/08/13 11:59a Fredericko
+// Initial Check-In for Tpm-Next module
+//
+// 1 7/10/13 5:50p Fredericko
+// [TAG] EIP120969
+// [Category] New Feature
+// [Description] TCG (TPM20)
+//
+// 3 3/29/11 12:51p Fredericko
+//
+// 2 3/29/11 12:07p 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: AmiTcmlib.dxs
+//
+// Description: AmiTcmlib Dependency file
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+DEPENDENCY_START
+ TRUE
+DEPENDENCY_END
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Core/EM/TCG2/Tpm1_2_lib/AmiTcmlib.h b/Core/EM/TCG2/Tpm1_2_lib/AmiTcmlib.h
new file mode 100644
index 0000000..570e69b
--- /dev/null
+++ b/Core/EM/TCG2/Tpm1_2_lib/AmiTcmlib.h
@@ -0,0 +1,74 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (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/Libraries/TisLib/AmiTcmlib/AmiTcmlib.h 1 4/21/14 2:15p Fredericko $
+//
+// $Revision: 1 $
+//
+// $Date: 4/21/14 2:15p $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/TCG2/Libraries/TisLib/AmiTcmlib/AmiTcmlib.h $
+//
+// 1 4/21/14 2:15p Fredericko
+//
+// 1 10/08/13 11:59a Fredericko
+// Initial Check-In for Tpm-Next module
+//
+// 1 7/10/13 5:50p Fredericko
+// [TAG] EIP120969
+// [Category] New Feature
+// [Description] TCG (TPM20)
+//
+// 3 3/29/11 12:51p Fredericko
+//
+// 2 3/29/11 12:06p 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: AmiTcmlib.h
+//
+// Description: Header file for AmiTcmlib.h
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+//Array of supported TCM devices
+#include <efi.h>
+
+typedef struct
+{ UINT16 VID;
+ UINT16 DID;
+} TCM_ID_STRUC;
+
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (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/Core/EM/TCG2/Tpm1_2_lib/AmiTcmlib.mak b/Core/EM/TCG2/Tpm1_2_lib/AmiTcmlib.mak
new file mode 100644
index 0000000..3ef0ed3
--- /dev/null
+++ b/Core/EM/TCG2/Tpm1_2_lib/AmiTcmlib.mak
@@ -0,0 +1,91 @@
+#*************************************************************************
+#*************************************************************************
+#** **
+#** (C)Copyright 1985-2010, American Megatrends, Inc. **
+#** **
+#** All Rights Reserved. **
+#** **
+#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+#** **
+#** Phone: (770)-246-8600 **
+#** **
+#*************************************************************************
+#*************************************************************************
+# $Header: /Alaska/SOURCE/Modules/TCG2/Libraries/TisLib/AmiTcmlib/AmiTcmlib.mak 1 4/21/14 2:15p Fredericko $
+#
+# $Revision: 1 $
+#
+# $Date: 4/21/14 2:15p $
+#*************************************************************************
+# Revision History
+# ----------------
+# $Log: /Alaska/SOURCE/Modules/TCG2/Libraries/TisLib/AmiTcmlib/AmiTcmlib.mak $
+#
+# 1 4/21/14 2:15p Fredericko
+#
+# 1 10/08/13 11:59a Fredericko
+# Initial Check-In for Tpm-Next module
+#
+# 1 7/10/13 5:50p Fredericko
+# [TAG] EIP120969
+# [Category] New Feature
+# [Description] TCG (TPM20)
+#
+# 7 3/29/11 12:51p Fredericko
+#
+# 6 3/29/11 11:52a 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: AmiTcmlib.mak
+#
+# Description: Make file for AmiTcmlib
+#
+#<AMI_FHDR_END>
+#************************************************************************
+all : $(BUILD_DIR)\AmiTcmlib.lib
+
+#---------------------------------------------------------------------------
+# $(BUILD_DIR)\AmiTcgLibDxe.lib
+#---------------------------------------------------------------------------
+$(BUILD_DIR)\AmiTcmlib.lib : $(BUILD_DIR)\AmiTcmlib.mak MakeAmiTcmlib
+
+$(BUILD_DIR)\AmiTcmlib.mak : $(AMI_TCM_LIB)\AmiTcmlib.cif $(AMI_TCM_LIB)\AmiTcmlib.mak $(BUILD_RULES)
+ $(CIF2MAK) $(AMI_TCM_LIB)\AmiTcmlib.cif $(CIF2MAK_DEFAULTS)
+
+MakeAmiTcmlib:
+!IF "$(PROCESSOR)"=="x64"
+ $(MAKE) /$(MAKEFLAGS) $(BUILD_DEFAULTS)\
+ /f $(BUILD_DIR)\AmiTcmlib.mak all\
+ TYPE=LIBRARY
+ $(MAKE) /$(MAKEFLAGS) $(BUILD_DEFAULTS) BUILD_DIR=$(BUILD_DIR)\IA32\
+ /f $(BUILD_DIR)\AmiTcmlib.mak all\
+ TYPE=PEI_LIBRARY
+!ELSE
+ $(MAKE) /$(MAKEFLAGS) $(BUILD_DEFAULTS)\
+ /f $(BUILD_DIR)\AmiTcmlib.mak all\
+ TYPE=LIBRARY
+!ENDIF
+
+#---------------------------------------------------------------------------
+
+#*************************************************************************
+#*************************************************************************
+#** **
+#** (C)Copyright 1985-2010, American Megatrends, Inc. **
+#** **
+#** All Rights Reserved. **
+#** **
+#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+#** **
+#** Phone: (770)-246-8600 **
+#** **
+#*************************************************************************
+#*************************************************************************
diff --git a/Core/EM/TCG2/Tpm1_2_lib/AmiTcmlib.sdl b/Core/EM/TCG2/Tpm1_2_lib/AmiTcmlib.sdl
new file mode 100644
index 0000000..83cf885
--- /dev/null
+++ b/Core/EM/TCG2/Tpm1_2_lib/AmiTcmlib.sdl
@@ -0,0 +1,71 @@
+TOKEN
+ Name = "AmiTcmLib_SUPPORT"
+ Value = "1"
+ Help = "Main switch to enable TCG support in Project"
+ TokenType = Boolean
+ TargetEQU = Yes
+ TargetMAK = Yes
+ TargetH = Yes
+ Master = Yes
+ Token = "TCG2Support" "=" "1"
+End
+
+
+PATH
+ Name = "AMI_TCM_LIB"
+End
+
+MODULE
+ Help = "Includes AmiTcmlib.mak to Project"
+ File = "AmiTcmlib.mak"
+End
+
+TOKEN
+ Name = "SUPPORTED_TCM_DEVICE_1_VID"
+ Value = "19F5h"
+ Help = "Vendor ID of the a supported TCM device"
+ TokenType = Integer
+ TargetEQU = Yes
+ TargetH = Yes
+End
+
+
+TOKEN
+ Name = "SUPPORTED_TCM_DEVICE_1_DID"
+ Value = "0001h"
+ Help = "Device ID of the a supported TCM device"
+ TokenType = Integer
+ TargetEQU = Yes
+ TargetH = Yes
+End
+
+
+
+TOKEN
+ Name = "SUPPORTED_TCM_DEVICE_2_VID"
+ Value = "1b4eh"
+ Help = "Vendor ID of the a supported TCM device"
+ TokenType = Integer
+ TargetEQU = Yes
+ TargetH = Yes
+End
+
+
+TOKEN
+ Name = "SUPPORTED_TCM_DEVICE_2_DID"
+ Value = "0001h"
+ Help = "Device ID of the a supported TCM device"
+ TokenType = Integer
+ TargetEQU = Yes
+ TargetH = Yes
+End
+
+
+TOKEN
+ Name = "NUMBER_OF_SUPPORTED_TCM_DEVICES"
+ Value = "0002h"
+ Help = "number of supported tcm devices. Increase this number with addition of new DID and vendor ID"
+ TokenType = Integer
+ TargetEQU = Yes
+ TargetH = Yes
+End