# UbaMainPeim

| Field       | Value                                        |
|-------------|----------------------------------------------|
| Index       | 0381                                         |
| Module      | UbaMainPeim                                  |
| PE Size     | 60,032 bytes                                 |
| Phase       | PEI (UBA Main PEIM, 586 functions)           |
| Sections    | .text / .rdata / .data / .reloc              |
| Arch        | IA-32 (0x014C)                               |
| SHA256      | 2f809f8fdd826f6742916a2f3bb19c9c7bb76cacac7d |

## Overview

UbaMainPeim is the largest UBA PEIM, serving as a full-featured network driver stack for Intel server NICs. With 586 functions spanning UNDI, SNP, PXE, NVM, PHY, MAC, iSCSI, SPI, and management protocol layers, it provides complete network initialization including EEPROM/ROM parsing, PHY configuration, flash (SPI) access, PXE ROM setup, and iSCSI offload. The module registers a network controller driver with the UEFI boot manager and installs UNDI child protocol instances.

## Key Functions

- **ModuleEntryPoint** -- Main entry point; calls EarlyInit, installs protocol teardown, dispatches DxeDriverEntryPoint
- **EarlyInit** -- One-time initialization: registers protocol notification callbacks
- **DxeDriverEntryPoint** -- DXE driver entry; registers the UBA network controller driver
- **NvmInit / NvmReadFwBlock / NvmWriteShadow** -- NVM/flash firmware block read/write operations
- **SnpGetLinkStatus / SnpSetLinkSpeedDuplex / SnpGetMacAddress** -- Simple Network Protocol operations
- **PhyDetectSpeed / PhySetSpeed / PhyReadNameStr224** -- PHY management
- **MacSetupPhyLink / MacGetPhyInfo / MacGetLinkStatus** -- MAC-layer initialization
- **IscsiInit / IscsiCmdProcess / IscsiSessionGetBufSize** -- iSCSI offload engine setup
- **SpiEraseSector / SpiWriteEnable / SpiReadStatus** -- SPI flash controller access
- **UndiChildProtocolAlloc / UndiChildProtocolRegister** -- UNDI child protocol management
- **PxeStructInit / PxeRomGetImageSize / PxeRomUpdateChecksum** -- PXE ROM handling

## Dependencies

- MdePkg (Uefi.h)
- UEFI Boot Services (protocol registration, event handling)
- UBA protocol framework
- NIC hardware registers (PHY, MAC, SPI, NVM)

## Platform

Intel Purley platform, Lenovo HR650X server.