mirror of https://github.com/acidanthera/audk.git
SecurityPkg: Tcg2Smm: Enhance TIS interface detection
TCG PC Client PTP spec defines that if InterfaceType is defined as TIS1.3. All the other fields of the FIFO Interface Identifier Register are skipped. http://www.trustedcomputinggroup.org/pc-client-specific-platform-tpm-profile-for-tpm-2-0-v43-150126/ Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by: Yao Jiewen <jiewen.yao@intel.com> Reviewed-by: Long Qin <qin.long@intel.com>
This commit is contained in:
parent
4ac4729eb7
commit
3b5624b014
|
@ -50,18 +50,27 @@ GetPtpInterface (
|
||||||
InterfaceId.Uint32 = MmioRead32 ((UINTN)&((PTP_CRB_REGISTERS *)Register)->InterfaceId);
|
InterfaceId.Uint32 = MmioRead32 ((UINTN)&((PTP_CRB_REGISTERS *)Register)->InterfaceId);
|
||||||
InterfaceCapability.Uint32 = MmioRead32 ((UINTN)&((PTP_FIFO_REGISTERS *)Register)->InterfaceCapability);
|
InterfaceCapability.Uint32 = MmioRead32 ((UINTN)&((PTP_FIFO_REGISTERS *)Register)->InterfaceCapability);
|
||||||
|
|
||||||
|
if (InterfaceId.Bits.InterfaceType == PTP_INTERFACE_IDENTIFIER_INTERFACE_TYPE_TIS) {
|
||||||
|
return PtpInterfaceTis;
|
||||||
|
}
|
||||||
|
|
||||||
if ((InterfaceId.Bits.InterfaceType == PTP_INTERFACE_IDENTIFIER_INTERFACE_TYPE_CRB) &&
|
if ((InterfaceId.Bits.InterfaceType == PTP_INTERFACE_IDENTIFIER_INTERFACE_TYPE_CRB) &&
|
||||||
(InterfaceId.Bits.InterfaceVersion == PTP_INTERFACE_IDENTIFIER_INTERFACE_VERSION_CRB) &&
|
(InterfaceId.Bits.InterfaceVersion == PTP_INTERFACE_IDENTIFIER_INTERFACE_VERSION_CRB) &&
|
||||||
(InterfaceId.Bits.CapCRB != 0)) {
|
(InterfaceId.Bits.CapCRB != 0)) {
|
||||||
return PtpInterfaceCrb;
|
return PtpInterfaceCrb;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((InterfaceId.Bits.InterfaceType == PTP_INTERFACE_IDENTIFIER_INTERFACE_TYPE_FIFO) &&
|
if ((InterfaceId.Bits.InterfaceType == PTP_INTERFACE_IDENTIFIER_INTERFACE_TYPE_FIFO) &&
|
||||||
(InterfaceId.Bits.InterfaceVersion == PTP_INTERFACE_IDENTIFIER_INTERFACE_VERSION_FIFO) &&
|
(InterfaceId.Bits.InterfaceVersion == PTP_INTERFACE_IDENTIFIER_INTERFACE_VERSION_FIFO) &&
|
||||||
(InterfaceId.Bits.CapFIFO != 0) &&
|
(InterfaceId.Bits.CapFIFO != 0) &&
|
||||||
(InterfaceCapability.Bits.InterfaceVersion == INTERFACE_CAPABILITY_INTERFACE_VERSION_PTP)) {
|
(InterfaceCapability.Bits.InterfaceVersion == INTERFACE_CAPABILITY_INTERFACE_VERSION_PTP)) {
|
||||||
return PtpInterfaceFifo;
|
return PtpInterfaceFifo;
|
||||||
}
|
}
|
||||||
return PtpInterfaceTis;
|
|
||||||
|
//
|
||||||
|
// No Ptp interface available
|
||||||
|
//
|
||||||
|
return PtpInterfaceMax;
|
||||||
}
|
}
|
||||||
|
|
||||||
EFI_TPM2_ACPI_TABLE mTpm2AcpiTemplate = {
|
EFI_TPM2_ACPI_TABLE mTpm2AcpiTemplate = {
|
||||||
|
@ -400,6 +409,7 @@ PublishTpm2 (
|
||||||
case PtpInterfaceTis:
|
case PtpInterfaceTis:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
DEBUG((EFI_D_ERROR, "TPM2 InterfaceType get error! %d\n", InterfaceType));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue