# AmiTpm20PlatformPei

| Field       | Value                                      |
|-------------|--------------------------------------------|
| Index       | 392                                        |
| Module      | AmiTpm20PlatformPei                        |
| Size        | 44,996 bytes (AFC4h)                       |
| Phase       | PEI                                        |
| SHA256      | 60bd49067898d0f6639b2b05218a81ff22c875670fc5bf5189d724fdbd1cf39b |
| Functions   | 100                                        |

## Overview

AmiTpm20PlatformPei is a PEI module that provides TPM 2.0 platform-specific initialization for the AMI TPM 2.0 stack. It handles TPM hardware detection, random number generation via RdRand, and platform-level TPM configuration before the main TCG PEIMs execute. It serves as the glue between platform firmware and the TPM 2.0 device interface.

## Key Functions

- **RdRand16** -- Generates a 16-bit random value using the x86 RDRAND instruction
- **BaseCopyMem / BaseSetMem8 / BaseDivU64x32Remainder** -- Low-level memory and arithmetic utilities
- **ModuleEntryPoint** -- Main entry that initializes PCD PPI and dispatches platform-specific TPM setup
- TPM device interface functions for TPM 2.0 command submission and response parsing
- PPI notification registration for TPM device availability

## Dependencies

- PiPei, Uefi base libraries
- PCD PPI for platform configuration
- TPM 2.0 device PPI
- Debug services

## Platform

- **Architecture**: IA-32 (x86)
- **Subsystem**: EFI_BOOT_SERVICE_DRIVER (0x0B)
- **Source**: AmiModulePkg/TPM2
- **Linker**: MSVS 2015