diff options
Diffstat (limited to 'Board/CPU/TxtPei')
-rw-r--r-- | Board/CPU/TxtPei/AmiTxtPei.c | 164 | ||||
-rw-r--r-- | Board/CPU/TxtPei/AmiTxtPei.cif | 10 | ||||
-rw-r--r-- | Board/CPU/TxtPei/AmiTxtPei.mak | 69 | ||||
-rw-r--r-- | Board/CPU/TxtPei/AmiTxtPei.sdl | 71 |
4 files changed, 314 insertions, 0 deletions
diff --git a/Board/CPU/TxtPei/AmiTxtPei.c b/Board/CPU/TxtPei/AmiTxtPei.c new file mode 100644 index 0000000..5081caa --- /dev/null +++ b/Board/CPU/TxtPei/AmiTxtPei.c @@ -0,0 +1,164 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1987-2013, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Haswell/AMI Cpu PKG/AMI TXT PEI/AmiTxtPei.c 5 6/11/15 10:32p Crystallee $ +// +// $Revision: 5 $ +// +// $Date: 6/11/15 10:32p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Haswell/AMI Cpu PKG/AMI TXT PEI/AmiTxtPei.c $ +// +// 5 6/11/15 10:32p Crystallee +// [TAG] EIP207854 +// [Category] Bug Fix +// [Severity] Important +// [Symptom] Txt test fail with TCG2 module +// [RootCause] Tokne TCG_SUPPORT was removed. +// [Solution] Add TCG2Support token. +// +// 4 4/10/15 3:17a Crystallee +// +// 3 9/13/12 4:15a Davidhsieh +// [TAG] None +// [Category] Bug Fix +// [Severity] Important +// [Symptom] Disable TCG support causes BIOS buiding error +// [RootCause] TCG setup data is used in TxtDxe and the data is not +// exist when TCG disabled. +// [Solution] Do not use TCG setup data when TCG disabled. +// +// 2 8/22/12 3:29a Davidhsieh +// [TAG] None +// [Category] Improvement +// [Description] Install TPM_INITIALIZED_PPI when TPM device is present +// TPM enabled in setup +// +// 1 7/18/12 2:09a Davidhsieh +// [TAG] None +// [Category] Improvement +// [Description] AMI TXT PEI module part create +// +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: AmiTxtPei.c +// +// Description: +// +//<AMI_FHDR_END> +//********************************************************************** +// +#include <PEI.h> +#include <AmiPeiLib.h> +#include <AmiCspLib.h> +#include <ppi\ReadOnlyVariable.h> +#include <Setup.h> +#include <token.h> + +#define PEI_TPM_INITIALIZED_PPI_GUID \ + { \ + 0xe9db0d58, 0xd48d, 0x47f6, 0x9c, 0x6e, 0x6f, 0x40, 0xe8, 0x6c, 0x7b, 0x41 \ + } + +static EFI_GUID gPeiTpmInitializedPpiGuid = PEI_TPM_INITIALIZED_PPI_GUID; +static EFI_GUID gEfiPeiReadOnlyVariablePpiGuid = EFI_PEI_READ_ONLY_VARIABLE_PPI_GUID; +static EFI_GUID gEfiSetupGuid = SETUP_GUID; + +static EFI_PEI_PPI_DESCRIPTOR Tpm_Initialized[] = +{ + { + EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST, + &gPeiTpmInitializedPpiGuid, NULL + } +}; + +//<AMI_PHDR_START> +//---------------------------------------------------------------------------- +// +// Procedure: AmiTxtPeiEntry +// +// Description: PEI Entry Point for Intel TXT Driver. +// +// Input: EFI_HANDLE - ImageHandle +// EFI_SYSTEM_TABLE* - SystemTable +// +// Output: None. +// +//---------------------------------------------------------------------------- +//<AMI_PHDR_END> +EFI_STATUS +AmiTxtPeiEntry ( + IN EFI_FFS_FILE_HEADER *FfsHeader, + IN EFI_PEI_SERVICES **PeiServices +) +{ + + UINT8 *TpmBaseAddr = (UINT8*)0xfed40000; + EFI_PEI_READ_ONLY_VARIABLE_PPI *ReadOnlyVariable; + EFI_STATUS Status; + UINTN VariableSize; + + SETUP_DATA SetupData; + + if (*TpmBaseAddr != 0xff){ //If TPM device is present, check TPM setup data + Status = (*PeiServices)->LocatePpi( + PeiServices, + &gEfiPeiReadOnlyVariablePpiGuid, + 0, + NULL, + &ReadOnlyVariable + ); + + if (EFI_ERROR(Status)) return EFI_SUCCESS; + + VariableSize = sizeof(SETUP_DATA); + + Status = ReadOnlyVariable->GetVariable( + PeiServices, + L"Setup", + &gEfiSetupGuid, + NULL, + &VariableSize, + &SetupData + ); + + if ( EFI_ERROR(Status) ) return EFI_SUCCESS; + +#if TCG_SUPPORT || TCG2Support + if (SetupData.TpmSupport) + (*PeiServices)->InstallPpi(PeiServices, Tpm_Initialized); //Install PPI if TPM device detected and enable in setup +#endif + } + + return EFI_SUCCESS; +} + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1987-2013, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Board/CPU/TxtPei/AmiTxtPei.cif b/Board/CPU/TxtPei/AmiTxtPei.cif new file mode 100644 index 0000000..e790995 --- /dev/null +++ b/Board/CPU/TxtPei/AmiTxtPei.cif @@ -0,0 +1,10 @@ +<component> + name = "AMI TXT Pei" + category = ModulePart + LocalRoot = "Board\Cpu\TxtPei" + RefName = "AmiTxtPei" +[files] +"AmiTxtPei.sdl" +"AmiTxtPei.mak" +"AmiTxtPei.c" +<endComponent> diff --git a/Board/CPU/TxtPei/AmiTxtPei.mak b/Board/CPU/TxtPei/AmiTxtPei.mak new file mode 100644 index 0000000..7e65c25 --- /dev/null +++ b/Board/CPU/TxtPei/AmiTxtPei.mak @@ -0,0 +1,69 @@ +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1987-2013, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* +# $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Haswell/AMI Cpu PKG/AMI TXT PEI/AmiTxtPei.mak 1 7/18/12 2:09a Davidhsieh $ +# +# $Revision: 1 $ +# +# $Date: 7/18/12 2:09a $ +#********************************************************************** +# Revision History +# ---------------- +# $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Haswell/AMI Cpu PKG/AMI TXT PEI/AmiTxtPei.mak $ +# +# 1 7/18/12 2:09a Davidhsieh +# [TAG] None +# [Category] Improvement +# [Description] AMI TXT PEI module part create +# +# +#********************************************************************** +#********************************************************************** +#<AMI_FHDR_START> +# +# Name: AmiTxtPei.mak +# +# Description: Makefile for AmiTxtPei module. +# +#<AMI_FHDR_END> +#********************************************************************** + +all : AmiTxtPei + +AmiTxtPei: $(BUILD_DIR)\AmiTxtPei.mak AmiTxtPeiBin + +$(BUILD_DIR)\AmiTxtPei.mak : $(AmiTxtPei_DIR)\$(@B).cif $(AmiTxtPei_DIR)\$(@B).mak $(BUILD_RULES) + $(CIF2MAK) $(AmiTxtPei_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS) + +AmiTxtPeiBin : $(AMIPEILIB) $(AMICSPLib) + $(MAKE) /$(MAKEFLAGS) $(BUILD_DEFAULTS)\ + /f $(BUILD_DIR)\AmiTxtPei.mak all\ + MAKEFILE=$(BUILD_DIR)\AmiTxtPei.mak \ + GUID=C7D4BBCF-EB0A-4C91-BD8B-FCA99F28B011 \ + ENTRY_POINT=AmiTxtPeiEntry\ + TYPE=PEIM \ + COMPRESS=0 + +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1987-2013, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* diff --git a/Board/CPU/TxtPei/AmiTxtPei.sdl b/Board/CPU/TxtPei/AmiTxtPei.sdl new file mode 100644 index 0000000..7f6c65c --- /dev/null +++ b/Board/CPU/TxtPei/AmiTxtPei.sdl @@ -0,0 +1,71 @@ +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1987-2013, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* + +#********************************************************************** +# $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Haswell/AMI Cpu PKG/AMI TXT PEI/AmiTxtPei.sdl 1 7/18/12 2:09a Davidhsieh $ +# +# $Revision: 1 $ +# +# $Date: 7/18/12 2:09a $ +#********************************************************************** +# Revision History +# ---------------- +# $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Haswell/AMI Cpu PKG/AMI TXT PEI/AmiTxtPei.sdl $ +# +# 1 7/18/12 2:09a Davidhsieh +# [TAG] None +# [Category] Improvement +# [Description] AMI TXT PEI module part create +# +# +#********************************************************************** +TOKEN + Name = "AMI_TXT_PEI_SUPPORT" + Value = "1" + Help = "Main switch to enable AMI TXT PEI support in Project" + TokenType = Boolean + TargetEQU = Yes + TargetMAK = Yes + Master = Yes +End + +PATH + Name = "AmiTxtPei_DIR" +End + +MODULE + Help = "Includes TxtDxe.mak to Project" + File = "AmiTxtPei.mak" +End + +ELINK + Name = "$(BUILD_DIR)\AmiTxtPei.ffs" + Parent = "FV_BB" + Help = "Intel Txt PEI component" + InvokeOrder = AfterParent +End + +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1987-2013, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* |