xref: /dflybsd-src/share/man/man4/ahci.4 (revision d088d2a77896aaacacd780705bc2e8f67a6e5873)
1966c0ba2SSascha Wildner.\"	$OpenBSD: ahci.4,v 1.7 2008/04/19 01:18:39 djm Exp $
2966c0ba2SSascha Wildner.\"
3966c0ba2SSascha Wildner.\" Copyright (c) 2006 David Gwynne <dlg@openbsd.org>
431075e01SMatthew Dillon.\" Copyright (c) 2009-2016 Matthew Dillon <dillon@backplane.com>
5966c0ba2SSascha Wildner.\"
6966c0ba2SSascha Wildner.\" Permission to use, copy, modify, and distribute this software for any
7966c0ba2SSascha Wildner.\" purpose with or without fee is hereby granted, provided that the above
8966c0ba2SSascha Wildner.\" copyright notice and this permission notice appear in all copies.
9966c0ba2SSascha Wildner.\"
10966c0ba2SSascha Wildner.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11966c0ba2SSascha Wildner.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12966c0ba2SSascha Wildner.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13966c0ba2SSascha Wildner.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14966c0ba2SSascha Wildner.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15966c0ba2SSascha Wildner.\" TORTIOUS ACTION, ARISING OUT OF
16966c0ba2SSascha Wildner.\" PERFORMANCE OF THIS SOFTWARE.
17966c0ba2SSascha Wildner.\"
188f89eae9SMatthew Dillon.\" Copyright (c) 2016 The DragonFly Project.  All rights reserved.
198f89eae9SMatthew Dillon.\"
208f89eae9SMatthew Dillon.\" This code is derived from software contributed to The DragonFly Project
218f89eae9SMatthew Dillon.\" by Matthew Dillon <dillon@backplane.com>
228f89eae9SMatthew Dillon.\"
238f89eae9SMatthew Dillon.\" Redistribution and use in source and binary forms, with or without
248f89eae9SMatthew Dillon.\" modification, are permitted provided that the following conditions
258f89eae9SMatthew Dillon.\" are met:
268f89eae9SMatthew Dillon.\"
278f89eae9SMatthew Dillon.\" 1. Redistributions of source code must retain the above copyright
288f89eae9SMatthew Dillon.\"    notice, this list of conditions and the following disclaimer.
298f89eae9SMatthew Dillon.\" 2. Redistributions in binary form must reproduce the above copyright
308f89eae9SMatthew Dillon.\"    notice, this list of conditions and the following disclaimer in
318f89eae9SMatthew Dillon.\"    the documentation and/or other materials provided with the
328f89eae9SMatthew Dillon.\"    distribution.
338f89eae9SMatthew Dillon.\" 3. Neither the name of The DragonFly Project nor the names of its
348f89eae9SMatthew Dillon.\"    contributors may be used to endorse or promote products derived
358f89eae9SMatthew Dillon.\"    from this software without specific, prior written permission.
368f89eae9SMatthew Dillon.\"
378f89eae9SMatthew Dillon.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
388f89eae9SMatthew Dillon.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
398f89eae9SMatthew Dillon.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
408f89eae9SMatthew Dillon.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
418f89eae9SMatthew Dillon.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
428f89eae9SMatthew Dillon.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
438f89eae9SMatthew Dillon.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
448f89eae9SMatthew Dillon.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
458f89eae9SMatthew Dillon.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
468f89eae9SMatthew Dillon.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
478f89eae9SMatthew Dillon.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
488f89eae9SMatthew Dillon.\" SUCH DAMAGE.
498f89eae9SMatthew Dillon.\"
5026595b18SSascha Wildner.Dd November 28, 2014
51966c0ba2SSascha Wildner.Dt AHCI 4
52966c0ba2SSascha Wildner.Os
53966c0ba2SSascha Wildner.Sh NAME
54966c0ba2SSascha Wildner.Nm ahci
55966c0ba2SSascha Wildner.Nd Advanced Host Controller Interface for Serial ATA
56966c0ba2SSascha Wildner.Sh SYNOPSIS
57966c0ba2SSascha WildnerTo compile this driver into the kernel,
58966c0ba2SSascha Wildnerplace the following line in your
59966c0ba2SSascha Wildnerkernel configuration file:
60966c0ba2SSascha Wildner.Bd -ragged -offset indent
61966c0ba2SSascha Wildner.Cd "device ahci"
62966c0ba2SSascha Wildner.Ed
63966c0ba2SSascha Wildner.Pp
64966c0ba2SSascha WildnerAlternatively, to load the driver as a
65966c0ba2SSascha Wildnermodule at boot time, place the following line in
66966c0ba2SSascha Wildner.Xr loader.conf 5 :
67966c0ba2SSascha Wildner.Bd -literal -offset indent
68966c0ba2SSascha Wildnerahci_load="YES"
69966c0ba2SSascha Wildner.Ed
7031075e01SMatthew Dillon.Pp
7131075e01SMatthew DillonNote that
7231075e01SMatthew Dillon.Dx
7331075e01SMatthew Dilloncompiles this driver into the kernel by default, so you normally do not
7431075e01SMatthew Dillonhave to do anything..
75966c0ba2SSascha Wildner.Sh DESCRIPTION
76966c0ba2SSascha WildnerThe
77966c0ba2SSascha Wildner.Nm
78966c0ba2SSascha Wildnerdriver provides support for Serial ATA controllers conforming to the
79966c0ba2SSascha WildnerAdvanced Host Controller Interface specification.
80966c0ba2SSascha Wildner.Pp
815a205d6eSSascha WildnerSeveral AHCI capable controllers also provide a compatibility mode that
82966c0ba2SSascha Wildnercauses them to appear as a traditional ATA controller supported by
83966c0ba2SSascha Wildner.Xr nata 4 .
84966c0ba2SSascha Wildner.Pp
85966c0ba2SSascha WildnerAlthough
86966c0ba2SSascha Wildner.Nm
87966c0ba2SSascha Wildnercontrollers are actual ATA controllers, the driver emulates SCSI via a
88966c0ba2SSascha Wildnertranslation layer.
8931075e01SMatthew Dillon.Sh Special Features
9031075e01SMatthew DillonThis driver detects chipsets with the FBS capability, indicating FIS-Based
9131075e01SMatthew DillonSwitching support.
9231075e01SMatthew DillonThis capability allows I/O to be queued to multiple targets behind a
9331075e01SMatthew Dillonport-multiplier and will substantially increase performance when
9431075e01SMatthew Dillonoperating on multiple targets at once.
9531075e01SMatthew DillonUnfortunately, most AHCI controllers do not implement FBS.  Without it,
9631075e01SMatthew Dillonconcurrent access to multiple targets behind a port-multiplier will
9731075e01SMatthew Dillonserialize and wind up being quite slow.
9831075e01SMatthew Dillon.Pp
9931075e01SMatthew DillonThis driver detects and supports chipsets with the SPM capability,
10031075e01SMatthew Dillonindicating Port-Multiplier support.
10131075e01SMatthew DillonThis capability allows you to connect a port-multiplier to the SATA port.
10231075e01SMatthew DillonThe driver will then probe and attach all targets loaded into the
10331075e01SMatthew Dillonport-multiplier.
10431075e01SMatthew DillonA few provisios... most port-multipliers implode if no drives are loaded
10531075e01SMatthew Dilloninto them, and most port-multipliers also fail to properly follow the
10631075e01SMatthew DillonAHCI port-multiplier standards, so YMMV.  The driver will do everything it
10731075e01SMatthew Dilloncan to attach to a port-multiplier if it sees one.
10831075e01SMatthew Dillon.Sh WARNINGS
10931075e01SMatthew DilloneSATA PCIe cards -
11031075e01SMatthew DillonThere are many consumer PCIe cards which provide on-board AHCI controllers
11131075e01SMatthew Dillonand internal or external ports.
11231075e01SMatthew DillonThis driver should work with most of them.
11331075e01SMatthew DillonHowever, we strongly recommend that you avoid purchasing any AHCI PCIe
11431075e01SMatthew Dilloncards which provide both external eSATA and internal SATA ports and
11531075e01SMatthew Dillonhave jumpers to select between the two.
11631075e01SMatthew DillonThe jumper header seriously interferes with delicate SATA
11731075e01SMatthew Dilloncommunications and can cause instability and I/O errors even at slower
11831075e01SMatthew Dillon3Gbps speeds.
11931075e01SMatthew Dillon.Pp
12031075e01SMatthew DillonPort-Multipliers -
12131075e01SMatthew DillonThere are many consumer port multipliers.  Nearly all of them fail to
12231075e01SMatthew Dillonproperly follow the spec.  This driver works hard to attach to whatever
12331075e01SMatthew Dillonport-mutilplier it sees.  A good rule of thumb to follow is to
12431075e01SMatthew Dillonalways plug something into the first target slot on the PM.
12531075e01SMatthew DillonDual eSATA/USB port-multipliers are very common but tend to have poorly
12631075e01SMatthew Dillonimplemented firmwares.  Still, you might not have a choice, so YMMV.
12731075e01SMatthew DillonIssues that can arise: The PM fails to probe, or the driver only sees
12831075e01SMatthew Dillonone drive, or hot-swap detection fails to operate properly.
12931075e01SMatthew Dillon.Pp
13031075e01SMatthew DillonPort-Multipliers require PM-capable AHCI chipsets.
13131075e01SMatthew DillonMost AHCI chipsets are not PM-capable... Intel is particularly bad (for
13231075e01SMatthew Dillonreasons unknown).  Marvell chipsets tend to either be PM-capable or
13331075e01SMatthew Dillonimplement virtual PM handling on a (single) normal SATA port.  ASMedia
13431075e01SMatthew Dillonchipsets are usually PM-capable, but the PCIe card might be poorly designed
13531075e01SMatthew Dillonand generate lots of I/O errors due to electrical noise.
13631075e01SMatthew Dillon.Pp
13731075e01SMatthew DillonThe asynchronous attach described below may cause problems detecting your
13831075e01SMatthew Dillonboot drive quickly enough for the kernel to be able to mount it.
13931075e01SMatthew DillonIf you use the feature, the boot drive should normally be on the first
14031075e01SMatthew DillonAHCI controller and not be behind a port-multiplier.
14131075e01SMatthew DillonOnly use the feature if you have a lot of controllers (like three or more).
1427269aafcSSascha Wildner.Sh LOADER TUNABLES
1437269aafcSSascha WildnerThe following hints may be set in
1447269aafcSSascha Wildner.Xr loader.conf 5
1457269aafcSSascha Wildnerto control the
14684bfce7cSMatthew Dillon.Nm
1477269aafcSSascha Wildnerdriver's behavior.
1487269aafcSSascha WildnerNote that the hint need only exist, so removing it requires commenting it out.
14984bfce7cSMatthew Dillon.Pp
1507269aafcSSascha WildnerUsually both the
1517269aafcSSascha Wildner.Xr nata 4
1527269aafcSSascha Wildnerand the
1537269aafcSSascha Wildner.Nm
1547269aafcSSascha Wildnerdrivers are loaded.
1557269aafcSSascha WildnerThe
1567269aafcSSascha Wildner.Xr nata 4
1574938ec92SSascha Wildnerdriver will pick up any ata-like devices which the
1584938ec92SSascha Wildner.Nm
1594938ec92SSascha Wildnerdriver misses.
1607269aafcSSascha WildnerIf the
1617269aafcSSascha Wildner.Nm
1627269aafcSSascha Wildnerdriver is disabled the
1637269aafcSSascha Wildner.Xr nata 4
1647269aafcSSascha Wildnerdriver will typically pick up the
1657269aafcSSascha Wildner.Nm
166d856dabcSThomas Nikolajsendevices, albeit under the
167d856dabcSThomas Nikolajsen.Pa ad
168d856dabcSThomas Nikolajsendisk name rather than the
169d856dabcSThomas Nikolajsen.Pa da
170d856dabcSThomas Nikolajsendisk name.
171d856dabcSThomas Nikolajsen.Bd -literal -offset indent
172d856dabcSThomas Nikolajsenhint.ahci.disabled=1
173d856dabcSThomas Nikolajsen.Ed
17484bfce7cSMatthew Dillon.Pp
1757269aafcSSascha WildnerThe
1767269aafcSSascha Wildner.Nm
177*d088d2a7SMatthew Dillondriver can be told to force a lower-speed 1.5Gb or 3.0Gb link speed
17884bfce7cSMatthew Dillonif necessary, and can also be told to refrain from attempting to send
17984bfce7cSMatthew Dilloncertain higher-level ATA commands to initialize ATA features which
18084bfce7cSMatthew Dillonsome devices might not properly implement.
181*d088d2a7SMatthew DillonDropping the link speed is sometimes necessary to avoid chipset comm errors
182*d088d2a7SMatthew Dillonwhen a machine's cabling is sub-standard.
18384bfce7cSMatthew Dillon.Bd -literal -offset indent
1843002b850SMatthew Dillonhint.ahci.force150=1
185*d088d2a7SMatthew Dillonhint.ahci.force300=1
186*d088d2a7SMatthew Dillonhint.ahci.force600=1
1873002b850SMatthew Dillonhint.ahci.nofeatures=1
18884bfce7cSMatthew Dillon.Ed
1895cee4cf5SSascha Wildner.Pp
1905cee4cf5SSascha WildnerBy default, the driver will use MSI if it is supported.
1915cee4cf5SSascha WildnerThis behavior can be turned off by setting the following tunable:
1925cee4cf5SSascha Wildner.Bd -literal -offset indent
1935cee4cf5SSascha Wildnerhw.ahci.msi.enable=0
1945cee4cf5SSascha Wildner.Ed
19531075e01SMatthew Dillon.Pp
19631075e01SMatthew DillonBy default, on startup the driver will synchronously wait for all ports
19731075e01SMatthew Dillonto probe and attach them in order before allowing the kernel boot to
19831075e01SMatthew Dillonproceed to the next controller.
19931075e01SMatthew DillonEven though ports are probed in parallel, this can slow booting down
20031075e01SMatthew Dillonif your system has multiple AHCI controllers.
20131075e01SMatthew DillonYou can force a full asynchronous probe by setting the following
20231075e01SMatthew Dillontunable.
20331075e01SMatthew DillonThe kernel will still wait for all controllers to finish before
20431075e01SMatthew Dillonproceeding to the mountroot, but all ports will probe in parallel
20531075e01SMatthew Dillonso booting will be a lot faster.
20631075e01SMatthew DillonWARNING!  When probing asynchronously /dev/da* assignments for drives can
20731075e01SMatthew Dillonchange from boot to boot, so be sure to only access drives by their
20831075e01SMatthew Dillon/dev/serno/* path and not by their /dev/da* drive.
20931075e01SMatthew Dillon.Bd -literal -offset indent
21031075e01SMatthew Dillon# Attach everything asynchronously
21131075e01SMatthew Dillonhw.ahci.synchronous_boot=0
21231075e01SMatthew Dillon.Ed
213d856dabcSThomas Nikolajsen.Sh SYSCTL VARIABLES
214d856dabcSThomas NikolajsenLink power management can be set with the sysctl
21526595b18SSascha Wildner.Va dev.ahci.%d.%d.link_pwr_mgmt
216d856dabcSThomas Nikolajsento 0 for `disabled', 1 for `medium', and 2 for `aggressive'.
217d856dabcSThomas NikolajsenLink power state can be read with the sysctl
21826595b18SSascha Wildner.Va dev.ahci.%d.%d.link_pwr_state .
219966c0ba2SSascha Wildner.Sh SEE ALSO
220966c0ba2SSascha Wildner.Xr intro 4 ,
221966c0ba2SSascha Wildner.Xr nata 4 ,
22271990c18SSascha Wildner.Xr nvme 4 ,
22395f9378dSSascha Wildner.Xr pci 4 ,
224966c0ba2SSascha Wildner.Xr scsi 4 ,
22595f9378dSSascha Wildner.Xr sili 4 ,
226966c0ba2SSascha Wildner.Xr loader.conf 5
227966c0ba2SSascha Wildner.Sh HISTORY
228966c0ba2SSascha WildnerThe
229966c0ba2SSascha Wildner.Nm
230966c0ba2SSascha Wildnerdriver first appeared in
231966c0ba2SSascha Wildner.Dx 2.3 .
232966c0ba2SSascha Wildner.Sh AUTHORS
233966c0ba2SSascha Wildner.An -nosplit
234966c0ba2SSascha WildnerThe
235966c0ba2SSascha Wildner.Nm
236966c0ba2SSascha Wildnerdriver was originally written by
237b2a6f486SFranco Fichtner.An David Gwynne Aq Mt dlg@openbsd.org
238966c0ba2SSascha Wildnerand
239b2a6f486SFranco Fichtner.An Christopher Pascoe Aq Mt pascoe@openbsd.org
240966c0ba2SSascha Wildnerfor
241966c0ba2SSascha Wildner.Ox .
242966c0ba2SSascha Wildner.Pp
243966c0ba2SSascha WildnerIt was ported to
244966c0ba2SSascha Wildner.Dx
245966c0ba2SSascha Wildnerby
246b2a6f486SFranco Fichtner.An Matt Dillon Aq Mt dillon@apollo.backplane.com ,
2478f89eae9SMatthew Dillonwho substantially rewrote the driver (honestly, just about from scratch
2488f89eae9SMatthew Dillonbut having the openbsd code as a reference helped a lot), and
24931075e01SMatthew Dillonadded new features such as hot-plug, FIS-based switching, and port
25031075e01SMatthew Dillonmultiplier support.
251