# Ahci

| Field        | Value                                  |
|--------------|----------------------------------------|
| Index        | 0129                                   |
| Module       | Ahci                                   |
| Size         | 38468 bytes (38.5 KB)                  |
| PE File      | Ahci.efi                               |
| Phase        | DXE                                    |
| Source       | AmiModulePkg/AHCI/AhciBus.c            |
| SHA-256      | 06013665d360...                        |
| Sections     | 6 (.text, .rdata, .data, section_3, .xdata, .reloc) |

## Overview

Ahci is a UEFI DXE driver that implements the Advanced Host Controller Interface (AHCI) for SATA host controllers. It provides `EFI_BLOCK_IO_PROTOCOL`, `EFI_BLOCK_IO2_PROTOCOL`, and `EFI_ATA_PASS_THRU_PROTOCOL` interfaces for mass storage devices connected via SATA. The driver manages AHCI controller initialization, port detection and configuration, command list and FIS management, and performs SATA device I/O through the AHCI register interface.

## Key Functions

- `AhciDriverEntryPoint()` -- Entry point; installs driver binding, component name, and ATA pass thru protocols
- `AhciDriverBindingSupported()` -- Tests if a controller is an AHCI-compatible SATA controller
- `AhciDriverBindingStart()` -- Initializes the AHCI controller and detects attached devices
- `AhciDriverBindingStop()` -- Stops the driver, releases controller resources
- `AhciEnumerateDevice()` -- Detects/configures a port and creates the port context for block I/O child creation
- `AhciBlockIoRead()` / `AhciBlockIoWrite()` -- Block-level read/write via the AHCI HBA
- `AhciSataPhyCommand()` -- Sends low-level SATA PHY/ATA command sequences
- `AhciGetHobList()` -- Retrieves HOB list for platform configuration
- `AhciReadUint32Le()` -- Reads a little-endian 32-bit AHCI register value

## Dependencies

- `EFI_DRIVER_BINDING_PROTOCOL` -- UEFI driver model
- `EFI_BLOCK_IO_PROTOCOL` -- Block device access (produced)
- `EFI_BLOCK_IO2_PROTOCOL` -- Async block device access (produced)
- `EFI_ATA_PASS_THRU_PROTOCOL` -- ATA pass-through commands (produced)
- `EFI_COMPONENT_NAME2_PROTOCOL` -- Component name reporting
- `EFI_PCI_IO_PROTOCOL` -- PCI configuration and MMIO access
- `EFI_IDE_CONTROLLER_INIT_PROTOCOL` -- IDE controller initialization
- `EFI_DEVICE_PATH_PROTOCOL` -- Device path management

## Platform

- **Architecture**: x86-64 (PE32+)
- **Subsystem**: EFI_BOOT_SERVICE_DRIVER (0x0B)
- **Toolchain**: VS2015, X64 DEBUG
- **Copyright**: AMI Corporation
- **Source**: AmiModulePkg
- **BIOS**: HR650X (HR6N0XMLK)
