# AST2500PeiInit

| Index | Module | Size | Phase |
|-------|--------|------|-------|
| 0409 | AST2500PeiInit.efi | 0x1200 (4608 bytes) | PEI |

## Overview

This PEIM initializes the AST2500 (ASPEED) Super I/O and GPIO configuration during the PEI phase. It probes the AST2500 SIO via PM I/O ports (0x72/0x73), detects the SIO ID, and programs GPIO configuration registers accordingly. The module handles both AST2500 (SIO ID 0x21) and non-AST2500 SIO variants using separate GPIO configuration tables.

## Key Functions

- `Ast2500PeiInitEntry` -- Main entry point; probes SIO, selects GPIO table, programs registers
- `AstSioReadPmReg` / `AstSioWritePmReg` -- SIO PM register access via ports 0x72/0x73
- `AstPciCfgRead16` / `AstPciCfgWrite16` -- PCI configuration space access via CF8/CF9
- `AstGpioCfgProgram` -- Programs a single GPIO port with AND/OR masks
- `AstPciCfgProgramBar` -- Programs PCI BAR for the AST2500 SCU register space

## Dependencies

- edk2 BaseIoLibIntrinsic (IoLibMsc.c, IoLib.c)
- edk2 BasePciCf8Lib (PciCf8Lib.c)
- edk2 PeiServicesTablePointerLibIdt
- edk2 BaseLib (X86ReadIdtr.c)

## Platform

- Architecture: IA32 (32-bit)
- Machine type: x86 (0x014C)
- Subsystem: EFI Boot Service Driver (0x000B)
- Format: PE32
- Sections: .text, .rdata, .data, .reloc