Newer
Older
AMI-Aptio-BIOS-Reversed / Build / Tcg2Dxe / README.md
@Ajax Dong Ajax Dong 2 days ago 1 KB Restructure the repo

Tcg2Dxe

Index: 0271 | Size: 81.8 KB | Phase: DXE | Arch: X64

Overview

TCG2 (TPM 2.0) DXE driver that implements the EFI_TCG2_PROTOCOL for trusted computing services during the DXE phase. Handles TPM 2.0 device initialization, PCR extend operations, hash sequencing (SHA-1, SHA-256, SHA-384, SHA-512, SM3-256), event log creation and management, and ACPI DSDT table updates for TPM device objects. Reads TPM service flags from UEFI variables, manages active PCR bank configuration, and coordinates with the AMI TrEE (Trusted Execution Environment) protocol.

Key Functions

  • TreeDxeEntry (0x8238): Main driver entry -- locates TPM2 device protocol, allocates ACPI buffer, registers ACPI update event, reads TpmServFlags, installs TrEE protocol, updates ACPI tables, sets active PCR banks
  • TreeGetCapability (0x1928): Fills EFI_TCG2_PROTOCOL capabilities structure with supported hash algorithms, PCR banks, and TPM presence flags
  • TreeHashLogExtendEvent (0x3414): Hashes data with all active algorithms, extends the selected PCR, and appends the event to the TCG event log
  • Tpm20DxeAcpiUpdate (0x7DA4): Locates DSDT, updates TPM device ASL objects in ACPI tables via LibGetDsdt
  • MorCheckAndClear (0xD00): Checks MemoryOverwriteRequestControl (MOR) variable and performs memory clear if requested

Protocols/Dependencies

  • EFI_TCG2_PROTOCOL (TrEE protocol: 607F766C-7455-42BE-93BA-3B0716F6B718)
  • ACPI Support Protocol, DxeServicesTableLib, BaseMemoryLib
  • UEFI Variables: AMITCGPPIVAR, AMITCGPPIVAR2, SecureBootSetup, TpmServFlags, MemoryOverwriteRequestControl

Platform

From AmiModulePkg/TCG2/Common/TcgDxe/Tcg2Dxe.c, built for Lenovo HR650X (Purley platform).