# GenericSio

| Field        | Value                                  |
|--------------|----------------------------------------|
| Index        | 0130                                   |
| Module       | GenericSio                             |
| Size         | 39780 bytes (39.8 KB)                  |
| PE File      | GenericSio.efi                         |
| Phase        | DXE                                    |
| Source       | AmiModulePkg/GenericSio/               |
| SHA-256      | 2c45dffb5b55...                        |
| Sections     | 6 (.text, .rdata, .data, section_3, .xdata, .reloc) |

## Overview

GenericSio is a UEFI DXE driver that manages Super I/O (SIO) devices on Intel PCH-based platforms via PCIe enumeration, ACPI DSDT parsing, and SMM runtime switching. It is the primary SIO controller for LPC/eSPI bus-attached devices. Key responsibilities include PCIe root port enumeration and endpoint L1SS substate configuration, RST (Rapid Storage Technology) PCIe storage remapping, SIO device presence detection and resource allocation, ACPI DSDT parsing for SIO device discovery, S3 boot script generation for SIO configuration restore, and runtime SMM access switching.

## Key Functions

- `GenericSioDriverEntryPoint()` -- Entry point; initializes SIO controller and installs protocols
- `GenericSioControllerInit()` -- Detects and initializes SIO controllers on the platform
- `GenericSioDeviceDiscover()` -- Enumerates SIO devices via ACPI DSDT and PCIe
- `GenericSioResourceAlloc()` -- Allocates I/O and MMIO resources for SIO devices
- `GenericSioS3BootScript()` -- Generates S3 resume boot script for SIO configuration
- `GenericSioRuntimeSwitch()` -- Handles runtime SMM access switching for SIO
- `GenericSioPcieL1ssConfig()` -- Configures PCIe endpoint L1SS substates
- `GenericSioRstRemap()` -- Handles RST PCIe storage remapping
- `SioConvertUint64ToString()` -- Converts an unsigned 64-bit integer to string

## Dependencies

- `AmiSioDxeLib` -- AMI Super I/O DXE library
- `AmiSdlLib` -- AMI SDL (Silicon Driver Library)
- `AmiAcpiResLib` -- AMI ACPI resource library
- `PiDxeS3BootScriptLib` -- S3 boot script library
- `SmmLockBoxDxeLib` -- SMM LockBox library
- `BaseIoLibIntrinsic` -- I/O port access library
- `UefiBootServicesTableLib` -- UEFI boot services
- `UefiRuntimeServicesTableLib` -- UEFI runtime services
- ACPI DSDT tables (parsed for SIO device discovery)

## Platform

- **PCH**: Intel Lewisburg (LBG)
- **Bus**: LPC/eSPI
- **Architecture**: x86-64 (PE32+)
- **Subsystem**: EFI_BOOT_SERVICE_DRIVER (0x0B)
- **Copyright**: AMI Corporation
- **Source**: AmiModulePkg, MdeModulePkg, MdePkg
- **BIOS**: HR650X (HR6N0XMLK)