xref: /freebsd/share/man/man4/ata.4 (revision 6c89995002b9c6d1a9c7365483c55c106fc752d5)
1126123eaSAlexander Motin.\" Copyright (c) 2011 Alexander Motin <mav@FreeBSD.org>
2689701d8SJeroen Ruigrok van der Werven.\" All rights reserved.
3689701d8SJeroen Ruigrok van der Werven.\"
4689701d8SJeroen Ruigrok van der Werven.\" Redistribution and use in source and binary forms, with or without
5689701d8SJeroen Ruigrok van der Werven.\" modification, are permitted provided that the following conditions
6689701d8SJeroen Ruigrok van der Werven.\" are met:
7689701d8SJeroen Ruigrok van der Werven.\" 1. Redistributions of source code must retain the above copyright
8126123eaSAlexander Motin.\"    notice, this list of conditions and the following disclaimer.
9689701d8SJeroen Ruigrok van der Werven.\" 2. Redistributions in binary form must reproduce the above copyright
10689701d8SJeroen Ruigrok van der Werven.\"    notice, this list of conditions and the following disclaimer in the
11689701d8SJeroen Ruigrok van der Werven.\"    documentation and/or other materials provided with the distribution.
12689701d8SJeroen Ruigrok van der Werven.\"
13126123eaSAlexander Motin.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14126123eaSAlexander Motin.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15126123eaSAlexander Motin.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16126123eaSAlexander Motin.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17126123eaSAlexander Motin.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18126123eaSAlexander Motin.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19126123eaSAlexander Motin.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20126123eaSAlexander Motin.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21126123eaSAlexander Motin.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22126123eaSAlexander Motin.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23126123eaSAlexander Motin.\" SUCH DAMAGE.
24689701d8SJeroen Ruigrok van der Werven.\"
25689701d8SJeroen Ruigrok van der Werven.\" $FreeBSD$
26689701d8SJeroen Ruigrok van der Werven.\"
279c87d811SAlexander Motin.Dd October 3, 2012
288ea643adSJeroen Ruigrok van der Werven.Dt ATA 4
293d45e180SRuslan Ermilov.Os
30689701d8SJeroen Ruigrok van der Werven.Sh NAME
31126123eaSAlexander Motin.Nm ata
32126123eaSAlexander Motin.Nd generic ATA/SATA controller driver
33689701d8SJeroen Ruigrok van der Werven.Sh SYNOPSIS
34126123eaSAlexander MotinTo compile this driver into the kernel, place the following lines in your
35126123eaSAlexander Motinkernel configuration file:
36126123eaSAlexander Motin.Bd -ragged -offset indent
37126123eaSAlexander Motin.Cd "device scbus"
38126123eaSAlexander Motin.Cd "device ata"
39126123eaSAlexander Motin.Ed
40547d4262SKazutaka YOKOTA.Pp
41126123eaSAlexander MotinAlternatively, to load the driver as set of modules at boot time,
42126123eaSAlexander Motinplace some of the following lines in
43126123eaSAlexander Motin.Xr loader.conf 5 :
44126123eaSAlexander Motin.Bd -literal -offset indent
45126123eaSAlexander Motinata_load="YES"
46126123eaSAlexander Motin
47126123eaSAlexander Motinatacard_load="YES"
48126123eaSAlexander Motinataisa_load="YES"
49126123eaSAlexander Motinatapci_load="YES"
50126123eaSAlexander Motin
51126123eaSAlexander Motinataacard_load="YES"
52126123eaSAlexander Motinataacerlabs_load="YES"
53126123eaSAlexander Motinataadaptec_load="YES"
54126123eaSAlexander Motinataahci_load="YES"
55126123eaSAlexander Motinataamd_load="YES"
56126123eaSAlexander Motinataati_load="YES"
57126123eaSAlexander Motinatacenatek_load="YES"
58126123eaSAlexander Motinatacypress_load="YES"
59126123eaSAlexander Motinatacyrix_load="YES"
60126123eaSAlexander Motinatahighpoint_load="YES"
61126123eaSAlexander Motinataintel_load="YES"
62126123eaSAlexander Motinataite_load="YES"
63126123eaSAlexander Motinatajmicron_load="YES"
64126123eaSAlexander Motinatamarvell_load="YES"
65126123eaSAlexander Motinatamicron_load="YES"
66126123eaSAlexander Motinatanational_load="YES"
67126123eaSAlexander Motinatanetcell_load="YES"
68126123eaSAlexander Motinatanvidia_load="YES"
69126123eaSAlexander Motinatapromise_load="YES"
70126123eaSAlexander Motinataserverworks_load="YES"
71126123eaSAlexander Motinatasiliconimage_load="YES"
72126123eaSAlexander Motinatasis_load="YES"
73126123eaSAlexander Motinatavia_load="YES"
74126123eaSAlexander Motin.Ed
75689701d8SJeroen Ruigrok van der Werven.Pp
76df523242SChristian BruefferThe first line is for the common hardware independent code, and is a
77df523242SChristian Bruefferprerequisite for the other modules.
78df523242SChristian BruefferThe next three lines are generic bus-specific drivers.
79df523242SChristian BruefferOf the rest, ataahci is the AHCI driver.
80df523242SChristian BruefferThe others are vendor-specific PCI drivers.
818ba4488cSSøren Schmidt.Pp
82126123eaSAlexander MotinThe following tunables are settable from the
83126123eaSAlexander Motin.Xr loader 8 :
84f4c4488aSRuslan Ermilov.Bl -ohang
8578c3ff73SMarius Strobl.It Va hw.ahci.force
8678c3ff73SMarius Stroblset to nonzero value for forcing drivers to attach to some known AHCI-capable
8778c3ff73SMarius Stroblchips even if they are configured for legacy IDE emulation (the default is 1,
8878c3ff73SMarius Stroblforce the attach).
8919a71edbSPhilip Paeps.It Va hw.ata.ata_dma_check_80pin
9078c3ff73SMarius Stroblset to 0 to disable the 80pin cable check (the default is 1, check the cable).
91f64d65b2SAlexander Motin.It Va hint.atapci.X.msi
92df523242SChristian Bruefferset to 1 to allow Message Signalled Interrupts (MSI) to be used by the
93f64d65b2SAlexander Motinspecified PCI ATA controller, if supported.
947ce1f3e5SAlexander Motin.It Va hint.ata.X.devX.mode
959c87d811SAlexander Motinlimits the initial ATA mode for the specified device on the specified channel.
967ce1f3e5SAlexander Motin.It Va hint.ata.X.mode
97df523242SChristian Bruefferlimits the initial ATA mode for every device on the specified channel.
98f64d65b2SAlexander Motin.It Va hint.ata.X.pm_level
99df523242SChristian Brueffercontrols SATA interface Power Management for the specified channel,
100df523242SChristian Bruefferallowing some power savings at the cost of additional command latency.
101f64d65b2SAlexander MotinPossible values:
1027e3de069SJoel Dahl.Pp
1037e3de069SJoel Dahl.Bl -tag -width 4n -offset indent -compact
104f64d65b2SAlexander Motin.It 0
105df523242SChristian BruefferInterface Power Management is disabled.
106df523242SChristian BruefferThis is the default value.
107f64d65b2SAlexander Motin.It 1
108df523242SChristian BruefferThe device is allowed to initiate a PM state change; the host is passive.
109f64d65b2SAlexander Motin.It 2
110df523242SChristian BruefferThe host initiates a PARTIAL PM state transition every time a port becomes idle.
111f64d65b2SAlexander Motin.It 3
112f64d65b2SAlexander Motinhost initiates SLUMBER PM state transition every time port becomes idle.
113f64d65b2SAlexander Motin.El
1147e3de069SJoel Dahl.Pp
115df523242SChristian BruefferModes 2 and 3 are only supported for AHCI.
1169c87d811SAlexander Motin.It Va hint.ata. Ns Ar X Ns Va .dev Ns Ar X Ns Va .sata_rev
1179c87d811SAlexander Motinlimits the initial SATA revision (speed) for the specified device
1189c87d811SAlexander Motinon the specified channel.
1199c87d811SAlexander MotinValues 1, 2 and 3 are respectively 1.5, 3 and 6Gbps.
1209c87d811SAlexander Motin.It Va hint.ata. Ns Ar X Ns Va .sata_rev
1219c87d811SAlexander MotinSame, but for every device on the specified channel.
122f4c4488aSRuslan Ermilov.El
123689701d8SJeroen Ruigrok van der Werven.Sh DESCRIPTION
124688e92fcSSøren SchmidtThe
125688e92fcSSøren Schmidt.Nm
126df523242SChristian Bruefferdriver gives the
127df523242SChristian Brueffer.Xr CAM 4
128df523242SChristian Brueffersubsystem access to the ATA (IDE) and SATA ports
129126123eaSAlexander Motinof many generic controllers.
130df523242SChristian BruefferDepending on the controller, each PATA (IDE)
131df523242SChristian Bruefferport or each one or two SATA ports are
132126123eaSAlexander Motinrepresented to CAM as a separate bus with one or two targets.
133126123eaSAlexander MotinMost of the bus-management details are handled by the ATA/SATA-specific
134126123eaSAlexander Motintransport of CAM.
135126123eaSAlexander MotinConnected ATA disks are handled by the ATA protocol disk peripheral driver
136126123eaSAlexander Motin.Xr ada 4 .
137126123eaSAlexander MotinATAPI devices are handled by the SCSI protocol peripheral drivers
138126123eaSAlexander Motin.Xr cd 4 ,
139126123eaSAlexander Motin.Xr da 4 ,
140126123eaSAlexander Motin.Xr sa 4 ,
141126123eaSAlexander Motinetc.
142689701d8SJeroen Ruigrok van der Werven.Pp
143df523242SChristian BruefferThis driver supports ATA, and for the most of controllers, ATAPI devices.
144126123eaSAlexander MotinCommand queuing and SATA port multipliers are not supported.
145df523242SChristian BruefferDevice hot-plug and SATA interface power management is supported only on
146126123eaSAlexander Motinsome controllers.
147126123eaSAlexander Motin.Pp
148126123eaSAlexander MotinThe
149126123eaSAlexander Motin.Nm
150126123eaSAlexander Motindriver can change the transfer mode when the system is up and running.
151df523242SChristian BruefferSee the
152df523242SChristian Brueffer.Cm negotiate
153df523242SChristian Brueffersubcommand of
154df523242SChristian Brueffer.Xr camcontrol 8 .
155126123eaSAlexander Motin.Pp
156126123eaSAlexander MotinThe
157126123eaSAlexander Motin.Nm
158126123eaSAlexander Motindriver sets the maximum transfer mode supported by the hardware as default.
159df523242SChristian BruefferHowever, the
160126123eaSAlexander Motin.Nm
161126123eaSAlexander Motindriver sometimes warns:
162126123eaSAlexander Motin.Dq Sy "DMA limited to UDMA33, non-ATA66 cable or device".
163126123eaSAlexander MotinThis means that
164126123eaSAlexander Motinthe
165126123eaSAlexander Motin.Nm
166126123eaSAlexander Motindriver has detected that the required 80 conductor cable is not present
167126123eaSAlexander Motinor could not be detected properly,
168126123eaSAlexander Motinor that one of the devices on the channel only accepts up
169126123eaSAlexander Motinto UDMA2/ATA33.
170126123eaSAlexander MotinThe
171126123eaSAlexander Motin.Va hw.ata.ata_dma_check_80pin
172126123eaSAlexander Motintunable can be set to 0 to disable this check.
173126123eaSAlexander Motin.Sh HARDWARE
174688e92fcSSøren SchmidtThe currently supported ATA/SATA controller chips are:
175689701d8SJeroen Ruigrok van der Werven.Pp
176688e92fcSSøren Schmidt.Bl -tag -width "Silicon Image:" -compact
177688e92fcSSøren Schmidt.It Acard:
178c6fd52cbSJoel DahlATP850P, ATP860A, ATP860R, ATP865A, ATP865R.
179688e92fcSSøren Schmidt.It ALI:
18039915804SAlexander MotinM5228, M5229, M5281, M5283, M5287, M5288, M5289.
181688e92fcSSøren Schmidt.It AMD:
182da31a86aSChristian BruefferAMD756, AMD766, AMD768, AMD8111, CS5536.
1833a22b03dSJoel Dahl.It ATI:
1841f02c0f7SAlexander MotinIXP200, IXP300, IXP400, IXP600, IXP700, IXP800.
185688e92fcSSøren Schmidt.It CMD:
186c94b6c42SJoel DahlCMD646, CMD646U2, CMD648, CMD649.
187688e92fcSSøren Schmidt.It Cypress:
188688e92fcSSøren SchmidtCypress 82C693.
189d8f934daSChristian Brueffer.It Cyrix:
190d8f934daSChristian BruefferCyrix 5530.
191688e92fcSSøren Schmidt.It HighPoint:
192c94b6c42SJoel DahlHPT302, HPT366, HPT368, HPT370, HPT371, HPT372, HPT372N, HPT374.
193688e92fcSSøren Schmidt.It Intel:
19439915804SAlexander Motin6300ESB, 31244, PIIX, PIIX3, PIIX4, ESB2, ICH, ICH0, ICH2, ICH3, ICH4, ICH5,
19539915804SAlexander MotinICH6, ICH7, ICH8, ICH9, ICH10, SCH, PCH.
19639d1acc3SChristian Brueffer.It ITE:
197129e5ac6SChristian BruefferIT8211F, IT8212F, IT8213F.
198aed1a1f1SChristian Brueffer.It JMicron:
199dbd1ddacSChristian BruefferJMB360, JMB361, JMB363, JMB365, JMB366, JMB368.
200232c858fSChristian Brueffer.It Marvell
20193644902SAlexander Motin88SX5040, 88SX5041, 88SX5080, 88SX5081, 88SX6041, 88SX6042, 88SX6081, 88SE6101,
20293644902SAlexander Motin88SE6102, 88SE6111, 88SE6121, 88SE6141, 88SE6145, 88SX7042.
203688e92fcSSøren Schmidt.It National:
204688e92fcSSøren SchmidtSC1100.
205cebf4a4eSChristian Brueffer.It NetCell:
206cebf4a4eSChristian BruefferNC3000, NC5000.
207688e92fcSSøren Schmidt.It nVidia:
2081f02c0f7SAlexander MotinnForce, nForce2, nForce2 MCP, nForce3, nForce3 MCP, nForce3 Pro, nForce4,
2091f02c0f7SAlexander MotinMCP51, MCP55, MCP61, MCP65, MCP67, MCP73, MCP77, MCP79, MCP89.
210688e92fcSSøren Schmidt.It Promise:
211be8c7f2aSSergey KandaurovPDC20246, PDC20262, PDC20263, PDC20265, PDC20267, PDC20268, PDC20269, PDC20270,
212be8c7f2aSSergey KandaurovPDC20271, PDC20275, PDC20276, PDC20277, PDC20318, PDC20319, PDC20371, PDC20375,
213be8c7f2aSSergey KandaurovPDC20376, PDC20377, PDC20378, PDC20379, PDC20571, PDC20575, PDC20579, PDC20580,
214be8c7f2aSSergey KandaurovPDC20617, PDC20618, PDC20619, PDC20620, PDC20621, PDC20622, PDC40518, PDC40519,
215be8c7f2aSSergey KandaurovPDC40718, PDC40719.
216688e92fcSSøren Schmidt.It ServerWorks:
217dbd1ddacSChristian BruefferHT1000, ROSB4, CSB5, CSB6, K2, Frodo4, Frodo8.
218688e92fcSSøren Schmidt.It Silicon Image:
219199dc74dSChristian BruefferSiI0680, SiI3112, SiI3114, SiI3124, SiI3132, SiI3512.
220688e92fcSSøren Schmidt.It SiS:
221be8c7f2aSSergey KandaurovSIS180, SIS181, SIS182, SIS5513, SIS530, SIS540, SIS550, SIS620, SIS630,
222be8c7f2aSSergey KandaurovSIS630S, SIS633, SIS635, SIS730, SIS733, SIS735, SIS745, SIS961, SIS962,
223be8c7f2aSSergey KandaurovSIS963, SIS964, SIS965.
224688e92fcSSøren Schmidt.It VIA:
22539915804SAlexander MotinVT6410, VT6420, VT6421, VT82C586, VT82C586B, VT82C596, VT82C596B, VT82C686,
22639915804SAlexander MotinVT82C686A, VT82C686B, VT8231, VT8233, VT8233A, VT8233C, VT8235, VT8237,
227cd48d66cSAlexander MotinVT8237A, VT8237S, VT8251, CX700, VX800, VX855, VX900.
228689701d8SJeroen Ruigrok van der Werven.El
229689701d8SJeroen Ruigrok van der Werven.Pp
230126123eaSAlexander MotinSome of above chips are also supported by the more featured
231126123eaSAlexander Motin.Xr ahci 4 ,
232126123eaSAlexander Motin.Xr mvs 4 ,
233126123eaSAlexander Motinand
234126123eaSAlexander Motin.Xr siis 4
235126123eaSAlexander Motindrivers.
236126123eaSAlexander MotinIf both drivers are loaded at the same time, those will have precedence.
237126123eaSAlexander Motin.Pp
238688e92fcSSøren SchmidtUnknown ATA chipsets are supported in PIO modes, and if the standard
2398ff5952aSSøren Schmidtbusmaster DMA registers are present and contain valid setup, DMA is
240c48524c2SMike Pritchardalso enabled, although the max mode is limited to UDMA33, as it is
241688e92fcSSøren Schmidtnot known what the chipset can do and how to program it.
242689701d8SJeroen Ruigrok van der Werven.Sh NOTES
243688e92fcSSøren SchmidtPlease remember that in order to use UDMA4/ATA66 and above modes you
244688e92fcSSøren Schmidt.Em must
245c9753c58SSimon L. B. Nielsenuse 80 conductor cables.
2465512804bSRebecca CranPlease assure that ribbon cables are no longer than 45cm.
2478ff5952aSSøren SchmidtIn case of rounded ATA cables, the length depends on the
248c9753c58SSimon L. B. Nielsenquality of the cables.
2498ff5952aSSøren SchmidtSATA cables can be up to 1m long according to the specification.
250126123eaSAlexander MotinExternal SATA cables can be 2m long and more, but not all controllers
251126123eaSAlexander Motinwork well on long cables, especially at high speeds.
252f4c4488aSRuslan Ermilov.Sh SEE ALSO
253126123eaSAlexander Motin.Xr ada 4 ,
25439915804SAlexander Motin.Xr ahci 4 ,
25539915804SAlexander Motin.Xr cam 4 ,
256126123eaSAlexander Motin.Xr camcontrol 8 ,
2577ea6a15dSJohn-Mark Gurney.Xr cd 4 ,
258126123eaSAlexander Motin.Xr mvs 4 ,
25939915804SAlexander Motin.Xr siis 4
260ed403116SRuslan Ermilov.Sh HISTORY
261ed403116SRuslan ErmilovThe
262ed403116SRuslan Ermilov.Nm
263ed403116SRuslan Ermilovdriver first appeared in
264ed403116SRuslan Ermilov.Fx 4.0 .
265df523242SChristian BruefferIt was turned into a
266df523242SChristian Brueffer.Xr CAM 4
267df523242SChristian Bruefferinterface module in
268126123eaSAlexander Motin.Fx 9.0 .
2698ff5952aSSøren Schmidt.Sh AUTHORS
270*6c899950SBaptiste Daroussin.An Alexander Motin Aq Mt mav@FreeBSD.org
271*6c899950SBaptiste Daroussin.An S\(/oren Schmidt Aq Mt sos@FreeBSD.org
272