1.\" Copyright (c) 2009-2012 Alexander Motin <mav@FreeBSD.org> 2.\" All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23.\" SUCH DAMAGE. 24.\" 25.\" $FreeBSD$ 26.\" 27.Dd July 25, 2012 28.Dt AHCI 4 29.Os 30.Sh NAME 31.Nm ahci 32.Nd Serial ATA Advanced Host Controller Interface driver 33.Sh SYNOPSIS 34To compile this driver into the kernel, 35place the following lines in your 36kernel configuration file: 37.Bd -ragged -offset indent 38.Cd "device pci" 39.Cd "device scbus" 40.Cd "device ahci" 41.Ed 42.Pp 43Alternatively, to load the driver as a 44module at boot time, place the following line in 45.Xr loader.conf 5 : 46.Bd -literal -offset indent 47ahci_load="YES" 48.Ed 49.Pp 50The following tunables are settable from the 51.Xr loader 8 : 52.Bl -ohang 53.It Va hint.ahci. Ns Ar X Ns Va .msi 54controls Message Signaled Interrupts (MSI) usage by the specified controller. 55.Pp 56.Bl -tag -width 4n -offset indent -compact 57.It 0 58MSI disabled; 59.It 1 60single MSI vector used, if supported (default); 61.It 2 62multiple MSI vectors used, if supported; 63.El 64.It Va hint.ahci. Ns Ar X Ns Va .ccc 65controls Command Completion Coalescing (CCC) usage by the specified controller. 66Non-zero value enables CCC and defines maximum time (in ms), request can wait 67for interrupt, if there are some more requests present on controller queue. 68CCC reduces number of context switches on systems with many parallel requests, 69but it can decrease disk performance on some workloads due to additional 70command latency. 71.It Va hint.ahcich. Ns Ar X Ns Va .pm_level 72controls SATA interface Power Management for the specified channel, 73allowing some power to be saved at the cost of additional command 74latency. 75Possible values: 76.Pp 77.Bl -tag -width 4n -offset indent -compact 78.It 0 79interface Power Management is disabled (default); 80.It 1 81device is allowed to initiate PM state change, host is passive; 82.It 2 83host initiates PARTIAL PM state transition every time port becomes idle; 84.It 3 85host initiates SLUMBER PM state transition every time port becomes idle. 86.It 4 87driver initiates PARTIAL PM state transition 1ms after port becomes idle; 88.It 5 89driver initiates SLUMBER PM state transition 125ms after port becomes idle. 90.El 91.Pp 92Some controllers, such as ICH8, do not implement modes 2 and 3 with NCQ used. 93Because of artificial entering latency, performance degradation in modes 944 and 5 is much smaller then in modes 2 and 3. 95.Pp 96Note that interface Power Management complicates device presence detection. 97A manual bus reset/rescan may be needed after device hot-plug, unless hardware 98implements Cold Presence Detection. 99.It Va hint.ahcich. Ns Ar X Ns Va .sata_rev 100setting to nonzero value limits maximum SATA revision (speed). 101Values 1, 2 and 3 are respectively 1.5, 3 and 6Gbps. 102.It Va hw.ahci.force 103setting to nonzero value forces driver attach to some known AHCI-capable 104chips even if they are configured for legacy IDE emulation. 105Default is 1. 106.El 107.Sh DESCRIPTION 108This driver provides the 109.Xr CAM 4 110subsystem with native access to the 111.Tn SATA 112ports of AHCI-compatible controllers. 113Each SATA port found is represented to CAM as a separate bus with one 114target, or, if HBA supports Port Multipliers, 16 targets. 115Most of the bus-management details are handled by the SATA-specific 116transport of CAM. 117Connected ATA disks are handled by the ATA protocol disk peripheral driver 118.Xr ada 4 . 119ATAPI devices are handled by the SCSI protocol peripheral drivers 120.Xr cd 4 , 121.Xr da 4 , 122.Xr sa 4 , 123etc. 124.Pp 125Driver features include support for Serial ATA and ATAPI devices, 126Port Multipliers (including FIS-based switching, when supported), 127hardware command queues (up to 32 commands per port), 128Native Command Queuing, SATA interface Power Management, device hot-plug 129and Message Signaled Interrupts. 130.Pp 131Driver supports "LED" enclosure management messages, defined by the AHCI. 132When supported by hardware, it allows to control per-port activity, locate 133and fault LEDs via the 134.Xr led 4 135API or emulated 136.Xr ses 4 137device for localization and status reporting purposes. 138Supporting AHCI controllers may transmit that information to the backplane 139controllers via SGPIO interface. Backplane controllers interpret received 140statuses in some way (IBPI standard) to report them using present indicators. 141.Pp 142AHCI hardware is also supported by ataahci driver from 143.Xr ata 4 144subsystem. 145If both drivers are loaded at the same time, this one will be 146given precedence as the more functional of the two. 147.Sh HARDWARE 148The 149.Nm 150driver supports AHCI compatible controllers having PCI class 1 (mass storage), 151subclass 6 (SATA) and programming interface 1 (AHCI). 152.Pp 153Also, in cooperation with atamarvell and atajmicron drivers of ata(4), 154it supports AHCI part of legacy-PATA + AHCI-SATA combined controllers, 155such as JMicron JMB36x and Marvell 88SE61xx. 156.Sh FILES 157.Bl -tag -width /dev/led/ahcich*.locate 158.It Pa /dev/led/ahci*.*.act 159activity LED device nodes 160.It Pa /dev/led/ahci*.*.fault 161fault LED device nodes 162.It Pa /dev/led/ahci*.*.locate 163locate LED device nodes 164.El 165.Sh SEE ALSO 166.Xr ada 4 , 167.Xr ata 4 , 168.Xr cam 4 , 169.Xr cd 4 , 170.Xr da 4 , 171.Xr sa 4 , 172.Xr ses 4 173.Sh HISTORY 174The 175.Nm 176driver first appeared in 177.Fx 8.0 . 178.Sh AUTHORS 179.An Alexander Motin Aq mav@FreeBSD.org . 180