# CrystalRidge

| Index | Module | Size | Phase |
|-------|--------|------|-------|
| 108 | CrystalRidge | 239 KB | PEI |

## Overview

CrystalRidge is a PEI module that manages nonce restoration for the Intel CrystalRidge security co-processor on Purley platforms. It registers an EndOfPei notification callback that generates a Software SMI (via IO port 0xB2/0xFB) to trigger nonce restoration in the CrystalRidge firmware. The module also provides low-level memory utility functions (memset, memmove, strided memory set) for the PEI environment.

## Key Functions

- CrystalRidgePeimEntry — PEIM entry point; registers EndOfPei notify for nonce restoration
- GenerateSwSmiForNonceRestore — EndOfPei callback; triggers SW SMI 0xFB via IO port 0xB2
- LocateCrystalRidgePpi — locate the CrystalRidge PPI interface
- CrystalRidgeDebugPrint — debug output via CrystalRidge PPI
- Memset, Memmove, Memset32, SetMem32Strided — memory manipulation utilities

## Dependencies

- CrystalRidge PPI (gCrystalRidgeGuid)
- PEI Services Table
- PEI Boot Mode detection

## Platform

Lenovo HR650X (Intel Purley), X64, UEFI PEI module (13 functions)