Newer
Older
AMI-Aptio-BIOS-Reversed / Tpm20PlatformDxe / README.md
@Ajax Dong Ajax Dong 2 days ago 2 KB Init

Tpm20PlatformDxe

Index: 0072 | Size: 83904 bytes | Arch: x64 | Phase: DXE

Overview

This is the main TPM 2.0 Platform DXE driver, implementing TCG PPI (Physical Presence Interface) protocol, Secure Boot measurement, and TPM 2.0 hash extension services for the HR650X platform. At approximately 84 KB with 139 functions, it is the largest TCG module in the BIOS. The driver handles TPM 2.0 platform initialization, registers ready-to-boot and BDS callbacks, measures Secure Boot variables (SecureBoot, PK, KEK, db, dbx) and GPT partitions into the TPM, and provides SHA-256/SHA-512 hash sequence support for PCR extension.

Key Functions

  • ModuleEntryPoint -- Driver entry point; calls InitUefiServices then Tpm20PlatformDriverEntry
  • InitUefiServices -- Stores ImageHandle, gST, gBS, gRT; initializes HII services and locates HII protocols
  • Tpm20PlatformDriverEntry -- Main driver entry; performs complete TPM 2.0 platform initialization
  • CompleteTpm20PlatformInit -- Registers ready-to-boot and BDS callbacks, starts TPM platform hardware initialization
  • Tpm20PpiCallback -- TPM PPI request callback executed during PPI processing
  • InstallTpm20HiiPackage -- Installs HII package list for TPM PPI user interface
  • MeasureSecureBootVariables -- Measures Secure Boot variables (SecureBoot, PK, KEK, db, dbx) into TPM
  • MeasureGpt -- Measures the GPT (GUID Partition Table) into the TPM
  • MeasureFirmwareImage -- Measures a firmware image into the TPM using configured hash algorithms
  • Tpm2HashSequenceSha256 -- Performs SHA-256 hash sequence and extends to PCR
  • Sha512MessageSchedule -- SHA-512 message expansion (initialization of W[0..79])
  • SidPpiCallback -- SID (Storage ID) PPI handler; checks TcgSIDVariable state and sends EnableBlockSID command
  • AmiSetVariable -- Sets a UEFI variable using runtime services

Protocols / Dependencies

  • TCG2 Protocol
  • HII Database Protocol
  • TPM 2.0 PPI Protocol
  • Variable Lock Protocol
  • PCD Protocol

Platform

HR650X (AMI BIOS, AmiModulePkg/TCG2/Common/Tpm20PlatformDxe)