Fix current TPM device string missing. Use efivarstore instead of varstor, remove TPM disable.
Signed-off-by: Jiewen Yao <Jiewen.yao@intel.com> Reviewed-by: Guo Dong <Guo.Dong@intel.com> Reviewed-by: Liming Gao <Liming.Gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15360 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -94,8 +94,8 @@ TrEEConfigPeimEntryPoint (
|
||||
//
|
||||
// Validation
|
||||
//
|
||||
if (TrEEConfiguration.TpmDevice > TPM_DEVICE_MAX) {
|
||||
TrEEConfiguration.TpmDevice = TPM_DEVICE_DEFAULT;
|
||||
if ((TrEEConfiguration.TpmDevice > TPM_DEVICE_MAX) || (TrEEConfiguration.TpmDevice < TPM_DEVICE_MIN)) {
|
||||
TrEEConfiguration.TpmDevice = TPM_DEVICE_DEFAULT;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -105,8 +105,12 @@ TrEEConfigPeimEntryPoint (
|
||||
|
||||
if (PcdGetBool (PcdTpmAutoDetection)) {
|
||||
TpmDevice = DetectTpmDevice (TrEEConfiguration.TpmDevice);
|
||||
DEBUG ((EFI_D_ERROR, "TrEEConfiguration.TpmDevice final: %x\n", TpmDevice));
|
||||
TrEEConfiguration.TpmDevice = TpmDevice;
|
||||
DEBUG ((EFI_D_ERROR, "TpmDevice final: %x\n", TpmDevice));
|
||||
if (TpmDevice != TPM_DEVICE_NULL) {
|
||||
TrEEConfiguration.TpmDevice = TpmDevice;
|
||||
}
|
||||
} else {
|
||||
TpmDevice = TrEEConfiguration.TpmDevice;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -114,11 +118,14 @@ TrEEConfigPeimEntryPoint (
|
||||
// This is work-around because there is no gurantee DynamicHiiPcd can return correct value in DXE phase.
|
||||
// Using DynamicPcd instead.
|
||||
//
|
||||
// NOTE: TrEEConfiguration variable contains the desired TpmDevice type,
|
||||
// while PcdTpmInstanceGuid PCD contains the real detected TpmDevice type
|
||||
//
|
||||
for (Index = 0; Index < sizeof(mTpmInstanceId)/sizeof(mTpmInstanceId[0]); Index++) {
|
||||
if (TrEEConfiguration.TpmDevice == mTpmInstanceId[Index].TpmDevice) {
|
||||
if (TpmDevice == mTpmInstanceId[Index].TpmDevice) {
|
||||
Size = sizeof(mTpmInstanceId[Index].TpmInstanceGuid);
|
||||
PcdSetPtr (PcdTpmInstanceGuid, &Size, &mTpmInstanceId[Index].TpmInstanceGuid);
|
||||
DEBUG ((EFI_D_ERROR, "TrEEConfiguration.TpmDevice PCD: %g\n", &mTpmInstanceId[Index].TpmInstanceGuid));
|
||||
DEBUG ((EFI_D_ERROR, "TpmDevice PCD: %g\n", &mTpmInstanceId[Index].TpmInstanceGuid));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user