Sync the branch changes to trunk.

Support fTPM feature, and update the BiosID to 0.80.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Tim He <tim.he@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17362 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Tim He
2015-05-08 03:13:37 +00:00
committed by timhe
parent 7849538e0e
commit f4e7aa05a3
26 changed files with 1320 additions and 38 deletions

View File

@@ -28,6 +28,7 @@ Module Name:
#include "CommonHeader.h"
#include "Platform.h"
#include <Library/PciCf8Lib.h>
#include "PlatformBaseAddresses.h"
#include "PchAccess.h"
#include <Guid/PlatformInfo.h>
@@ -190,6 +191,67 @@ PeiSmbusExec (
// Start::Alpine Valley platform
//
EFI_STATUS
PeiSmbusExec (
UINT16 SmbusBase,
UINT8 SlvAddr,
UINT8 Operation,
UINT8 Offset,
UINT8 *Length,
UINT8 *Buffer
);
EFI_STATUS
FtpmPolicyInit (
IN CONST EFI_PEI_SERVICES **PeiServices,
IN SYSTEM_CONFIGURATION *pSystemConfiguration
)
{
EFI_STATUS Status;
EFI_PEI_PPI_DESCRIPTOR *mFtpmPolicyPpiDesc;
SEC_FTPM_POLICY_PPI *mFtpmPolicyPpi;
DEBUG((EFI_D_INFO, "FtpmPolicyInit Entry \n"));
if (NULL == PeiServices || NULL == pSystemConfiguration) {
DEBUG((EFI_D_ERROR, "Input error. \n"));
return EFI_INVALID_PARAMETER;
}
Status = (*PeiServices)->AllocatePool(
PeiServices,
sizeof (EFI_PEI_PPI_DESCRIPTOR),
(void **)&mFtpmPolicyPpiDesc
);
ASSERT_EFI_ERROR (Status);
Status = (*PeiServices)->AllocatePool(
PeiServices,
sizeof (SEC_FTPM_POLICY_PPI),
(void **)&mFtpmPolicyPpi
);
ASSERT_EFI_ERROR (Status);
//
// Initialize PPI
//
(*PeiServices)->SetMem ((VOID *)mFtpmPolicyPpi, sizeof (SEC_FTPM_POLICY_PPI), 0);
mFtpmPolicyPpiDesc->Flags = EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST;
mFtpmPolicyPpiDesc->Guid = &gSeCfTPMPolicyPpiGuid;
mFtpmPolicyPpiDesc->Ppi = mFtpmPolicyPpi;
DEBUG((EFI_D_INFO, "pSystemConfiguration->fTPM = 0x%x \n", pSystemConfiguration->fTPM));
if(pSystemConfiguration->fTPM == 1) {
mFtpmPolicyPpi->fTPMEnable = TRUE;
} else {
mFtpmPolicyPpi->fTPMEnable = FALSE;
}
Status = (*PeiServices)->InstallPpi(
PeiServices,
mFtpmPolicyPpiDesc
);
ASSERT_EFI_ERROR (Status);
@@ -697,6 +759,14 @@ PeiInitPlatform (
}
//
// Build HOB for PlatformInfo
//
BuildGuidDataHob (
&gEfiPlatformInfoGuid,
&PlatformInfo,
sizeof (EFI_PLATFORM_INFO_HOB)
);
#ifdef FTPM_ENABLE
Status = FtpmPolicyInit(PeiServices, &SystemConfiguration);