UefiPayloadPkg: Check more ACPI tables

Probe for ACPI tables
* TPM2
* TCPA
and store the result in AcpiBoardInfo.

Will be used to determine if a TPM1.2 or TPM2.0 is present.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
This commit is contained in:
Patrick Rudolph
2021-01-26 13:53:56 +01:00
committed by Tim Crawford
parent eec38fd383
commit c134065066
2 changed files with 23 additions and 5 deletions

View File

@@ -25,6 +25,8 @@ typedef struct {
UINT64 ResetRegAddress;
UINT64 PcieBaseAddress;
UINT64 PcieBaseSize;
UINT8 TPM20Present;
UINT8 TPM12Present;
} ACPI_BOARD_INFO;
#endif

View File

@@ -240,11 +240,16 @@ ParseAcpiInfo (
UINT32 *Signature;
EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_BASE_ADDRESS_TABLE_HEADER *MmCfgHdr;
EFI_ACPI_MEMORY_MAPPED_ENHANCED_CONFIGURATION_SPACE_BASE_ADDRESS_ALLOCATION_STRUCTURE *MmCfgBase;
UINTN TPM2TablePresent;
UINTN TCPATablePresent;
Rsdp = (EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER *)(UINTN)AcpiTableBase;
DEBUG ((DEBUG_INFO, "Rsdp at 0x%p\n", Rsdp));
DEBUG ((DEBUG_INFO, "Rsdt at 0x%x, Xsdt at 0x%lx\n", Rsdp->RsdtAddress, Rsdp->XsdtAddress));
TPM2TablePresent = 0;
TCPATablePresent = 0;
//
// Search Rsdt First
//
@@ -266,8 +271,12 @@ ParseAcpiInfo (
DEBUG ((DEBUG_INFO, "Found MM config address in Rsdt\n"));
}
if ((Fadt != NULL) && (MmCfgHdr != NULL)) {
goto Done;
if (*Signature == EFI_ACPI_5_0_TRUSTED_COMPUTING_PLATFORM_2_TABLE_SIGNATURE) {
TPM2TablePresent = 1;
}
if (*Signature == EFI_ACPI_5_0_TRUSTED_COMPUTING_PLATFORM_ALLIANCE_CAPABILITIES_TABLE_SIGNATURE) {
TCPATablePresent = 1;
}
}
}
@@ -291,8 +300,12 @@ ParseAcpiInfo (
DEBUG ((DEBUG_INFO, "Found MM config address in Xsdt\n"));
}
if ((Fadt != NULL) && (MmCfgHdr != NULL)) {
goto Done;
if (*Signature == EFI_ACPI_5_0_TRUSTED_COMPUTING_PLATFORM_2_TABLE_SIGNATURE) {
TPM2TablePresent = 1;
}
if (*Signature == EFI_ACPI_5_0_TRUSTED_COMPUTING_PLATFORM_ALLIANCE_CAPABILITIES_TABLE_SIGNATURE) {
TCPATablePresent = 1;
}
}
}
@@ -301,7 +314,8 @@ ParseAcpiInfo (
return RETURN_NOT_FOUND;
}
Done:
AcpiBoardInfo->TPM20Present = TPM2TablePresent;
AcpiBoardInfo->TPM12Present = TCPATablePresent;
AcpiBoardInfo->PmCtrlRegBase = Fadt->Pm1aCntBlk;
AcpiBoardInfo->PmTimerRegBase = Fadt->PmTmrBlk;
@@ -326,6 +340,8 @@ Done:
DEBUG ((DEBUG_INFO, "PmGpeEn Reg 0x%lx\n", AcpiBoardInfo->PmGpeEnBase));
DEBUG ((DEBUG_INFO, "PcieBaseAddr 0x%lx\n", AcpiBoardInfo->PcieBaseAddress));
DEBUG ((DEBUG_INFO, "PcieBaseSize 0x%lx\n", AcpiBoardInfo->PcieBaseSize));
DEBUG ((DEBUG_INFO, "TPM 2.0 present %x\n", AcpiBoardInfo->TPM20Present));
DEBUG ((DEBUG_INFO, "TPM 1.2 present %x\n", AcpiBoardInfo->TPM12Present));
//
// Verify values for proper operation