Merge from vendor branch BIND:
[dragonfly.git] / share / man / man4 / ahc.4
1 .\"
2 .\" Copyright (c) 1995, 1996, 1997, 1998, 2000
3 .\"     Justin T. Gibbs.  All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\" 3. The name of the author may not be used to endorse or promote products
14 .\"    derived from this software without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 .\"
27 .\" $FreeBSD: src/share/man/man4/ahc.4,v 1.38.2.1 2006/06/05 19:30:28 brueffer Exp $
28 .\" $DragonFly: src/share/man/man4/ahc.4,v 1.5 2007/07/07 18:31:59 swildner Exp $
29 .\"
30 .Dd July 7, 2007
31 .Dt AHC 4
32 .Os
33 .Sh NAME
34 .Nm ahc
35 .Nd Adaptec VL/EISA/PCI SCSI host adapter driver
36 .Sh SYNOPSIS
37 To compile this driver into the kernel,
38 place the following lines in your
39 kernel configuration file:
40 .Bd -ragged -offset indent
41 .Cd "device scbus"
42 .Cd "device ahc"
43 .Pp
44 For one or more VL/EISA cards:
45 .Cd "device eisa"
46 .Pp
47 For one or more PCI cards:
48 .Cd "device pci"
49 .Pp
50 To allow PCI adapters to use memory mapped I/O if enabled:
51 .Cd options AHC_ALLOW_MEMIO
52 .Pp
53 To configure one or more controllers to assume the target role:
54 .Cd options AHC_TMODE_ENABLE <bitmask of units>
55 .Ed
56 .Pp
57 Alternatively, to load the driver as a
58 module at boot time, place the following lines in
59 .Xr loader.conf 5 :
60 .Bd -literal -offset indent
61 ahc_load="YES"
62 ahc_eisa_load="YES"
63 ahc_isa_load="YES"
64 ahc_pci_load="YES"
65 .Ed
66 .Sh DESCRIPTION
67 This driver provides access to the
68 .Tn SCSI
69 bus(es) connected to the Adaptec AIC77xx and AIC78xx
70 host adapter chips.
71 .Pp
72 Driver features include support for twin and wide busses,
73 fast, ultra or ultra2 synchronous transfers depending on controller type,
74 tagged queueing, SCB paging, and target mode.
75 .Pp
76 Memory mapped I/O can be enabled for PCI devices with the
77 .Dq Dv AHC_ALLOW_MEMIO
78 configuration option.
79 Memory mapped I/O is more efficient than the alternative, programmed I/O.
80 Most PCI BIOSes will map devices so that either technique for communicating
81 with the card is available.
82 In some cases,
83 usually when the PCI device is sitting behind a PCI->PCI bridge,
84 the BIOS may fail to properly initialize the chip for memory mapped I/O.
85 The typical symptom of this problem is a system hang if memory mapped I/O
86 is attempted.
87 Most modern motherboards perform the initialization correctly and work fine
88 with this option enabled.
89 .Pp
90 Individual controllers may be configured to operate in the target role
91 through the
92 .Dq Dv AHC_TMODE_ENABLE
93 configuration option.
94 The value assigned to this option should be a bitmap
95 of all units where target mode is desired.
96 For example, a value of 0x25, would enable target mode on units 0, 2, and 5.
97 A value of 0x8a enables it for units 1, 3, and 7.
98 .Pp
99 Per target configuration performed in the
100 .Tn SCSI-Select
101 menu, accessible at boot
102 in
103 .No non- Ns Tn EISA
104 models,
105 or through an
106 .Tn EISA
107 configuration utility for
108 .Tn EISA
109 models,
110 is honored by this driver.
111 This includes synchronous/asynchronous transfers,
112 maximum synchronous negotiation rate,
113 wide transfers,
114 disconnection,
115 the host adapter's SCSI ID,
116 and,
117 in the case of
118 .Tn EISA
119 Twin Channel controllers,
120 the primary channel selection.
121 For systems that store non-volatile settings in a system specific manner
122 rather than a serial eeprom directly connected to the aic7xxx controller,
123 the
124 .Tn BIOS
125 must be enabled for the driver to access this information.
126 This restriction applies to all
127 .Tn EISA
128 and many motherboard configurations.
129 .Pp
130 Note that I/O addresses are determined automatically by the probe routines,
131 but care should be taken when using a 284x
132 .Pq Tn VESA No local bus controller
133 in an
134 .Tn EISA
135 system.
136 The jumpers setting the I/O area for the 284x should match the
137 .Tn EISA
138 slot into which the card is inserted to prevent conflicts with other
139 .Tn EISA
140 cards.
141 .Pp
142 Performance and feature sets vary throughout the aic7xxx product line.
143 The following table provides a comparison of the different chips supported
144 by the
145 .Nm
146 driver.
147 Note that wide and twin channel features, although always supported
148 by a particular chip, may be disabled in a particular motherboard or card
149 design.
150 .Pp
151 .Bd -ragged -offset indent
152 .Bl -column "aic7770 " "10 " "EISA/VL  " "10MHz " "16bit " "SCBs " Features
153 .Em "Chip       MIPS    Bus      MaxSync   MaxWidth  SCBs  Features"
154 aic7770     10    EISA/VL    10MHz     16Bit     4    1
155 aic7850     10    PCI/32     10MHz      8Bit     3
156 aic7860     10    PCI/32     20MHz      8Bit     3
157 aic7870     10    PCI/32     10MHz     16Bit    16
158 aic7880     10    PCI/32     20MHz     16Bit    16
159 aic7890     20    PCI/32     40MHz     16Bit    16        3 4 5 6 7 8
160 aic7891     20    PCI/64     40MHz     16Bit    16        3 4 5 6 7 8
161 aic7892     20    PCI/64     80MHz     16Bit    16        3 4 5 6 7 8
162 aic7895     15    PCI/32     20MHz     16Bit    16      2 3 4 5
163 aic7895C    15    PCI/32     20MHz     16Bit    16      2 3 4 5     8
164 aic7896     20    PCI/32     40MHz     16Bit    16      2 3 4 5 6 7 8
165 aic7897     20    PCI/64     40MHz     16Bit    16      2 3 4 5 6 7 8
166 aic7899     20    PCI/64     80MHz     16Bit    16      2 3 4 5 6 7 8
167 .El
168 .Pp
169 .Bl -enum -compact
170 .It
171 Multiplexed Twin Channel Device - One controller servicing two busses.
172 .It
173 Multi-function Twin Channel Device - Two controllers on one chip.
174 .It
175 Command Channel Secondary DMA Engine - Allows scatter gather list and
176 SCB prefetch.
177 .It
178 64 Byte SCB Support - SCSI CDB is embedded in the SCB to eliminate an extra DMA.
179 .It
180 Block Move Instruction Support - Doubles the speed of certain sequencer
181 operations.
182 .It
183 .Sq Bayonet
184 style Scatter Gather Engine - Improves S/G prefetch performance.
185 .It
186 Queuing Registers - Allows queueing of new transactions without pausing the
187 sequencer.
188 .It
189 Multiple Target IDs - Allows the controller to respond to selection as a
190 target on multiple SCSI IDs.
191 .El
192 .Ed
193 .Sh HARDWARE
194 The
195 .Nm
196 driver supports the following
197 .Tn SCSI
198 host adapter chips and
199 .Tn SCSI
200 controller cards:
201 .Pp
202 .Bl -bullet -compact
203 .It
204 Adaptec
205 .Tn AIC7770
206 host adapter chip
207 .It
208 Adaptec
209 .Tn AIC7850
210 host adapter chip
211 .It
212 Adaptec
213 .Tn AIC7860
214 host adapter chip
215 .It
216 Adaptec
217 .Tn AIC7870
218 host adapter chip
219 .It
220 Adaptec
221 .Tn AIC7880
222 host adapter chip
223 .It
224 Adaptec
225 .Tn AIC7890
226 host adapter chip
227 .It
228 Adaptec
229 .Tn AIC7891
230 host adapter chip
231 .It
232 Adaptec
233 .Tn AIC7892
234 host adapter chip
235 .It
236 Adaptec
237 .Tn AIC7895
238 host adapter chip
239 .It
240 Adaptec
241 .Tn AIC7896
242 host adapter chip
243 .It
244 Adaptec
245 .Tn AIC7897
246 host adapter chip
247 .It
248 Adaptec
249 .Tn AIC7899
250 host adapter chip
251 .It
252 Adaptec
253 .Tn 274X(W)
254 .It
255 Adaptec
256 .Tn 274X(T)
257 .It
258 Adaptec
259 .Tn 284X
260 .It
261 Adaptec
262 .Tn 2910
263 .It
264 Adaptec
265 .Tn 2915
266 .It
267 Adaptec
268 .Tn 2920
269 .It
270 Adaptec
271 .Tn 2930C
272 .It
273 Adaptec
274 .Tn 2930U2
275 .It
276 Adaptec
277 .Tn 2940
278 .It
279 Adaptec
280 .Tn 2940J
281 .It
282 Adaptec
283 .Tn 2940N
284 .It
285 Adaptec
286 .Tn 2940U
287 .It
288 Adaptec
289 .Tn 2940AU
290 .It
291 Adaptec
292 .Tn 2940UW
293 .It
294 Adaptec
295 .Tn 2940UW Dual
296 .It
297 Adaptec
298 .Tn 2940UW Pro
299 .It
300 Adaptec
301 .Tn 2940U2W
302 .It
303 Adaptec
304 .Tn 2940U2B
305 .It
306 Adaptec
307 .Tn 2950U2W
308 .It
309 Adaptec
310 .Tn 2950U2B
311 .It
312 Adaptec
313 .Tn 19160B
314 .It
315 Adaptec
316 .Tn 29160B
317 .It
318 Adaptec
319 .Tn 29160N
320 .It
321 Adaptec
322 .Tn 3940
323 .It
324 Adaptec
325 .Tn 3940U
326 .It
327 Adaptec
328 .Tn 3940AU
329 .It
330 Adaptec
331 .Tn 3940UW
332 .It
333 Adaptec
334 .Tn 3940AUW
335 .It
336 Adaptec
337 .Tn 3940U2W
338 .It
339 Adaptec
340 .Tn 3950U2
341 .It
342 Adaptec
343 .Tn 3960
344 .It
345 Adaptec
346 .Tn 39160
347 .It
348 Adaptec
349 .Tn 3985
350 .It
351 Adaptec
352 .Tn 4944UW
353 .It
354 NEC PC-9821Xt13 (PC-98)
355 .It
356 NEC RvII26 (PC-98)
357 .It
358 NEC PC-9821X-B02L/B09 (PC-98)
359 .It
360 NEC SV-98/2-B03 (PC-98)
361 .It
362 Many motherboards with on-board
363 .Tn SCSI
364 support
365 .El
366 .Sh SCSI CONTROL BLOCKS (SCBs)
367 Every transaction sent to a device on the SCSI bus is assigned a
368 .Sq SCSI Control Block
369 (SCB).
370 The SCB contains all of the information required by the
371 controller to process a transaction.
372 The chip feature table lists
373 the number of SCBs that can be stored in on-chip memory.
374 All chips
375 with model numbers greater than or equal to 7870 allow for the on chip
376 SCB space to be augmented with external SRAM up to a maximum of 255 SCBs.
377 Very few Adaptec controller configurations have external SRAM.
378 .Pp
379 If external SRAM is not available, SCBs are a limited resource.
380 Using the SCBs in a straight forward manner would only allow the driver to
381 handle as many concurrent transactions as there are physical SCBs.
382 To fully utilize the SCSI bus and the devices on it,
383 requires much more concurrency.
384 The solution to this problem is
385 .Em SCB Paging ,
386 a concept similar to memory paging.
387 SCB paging takes advantage of
388 the fact that devices usually disconnect from the SCSI bus for long
389 periods of time without talking to the controller.
390 The SCBs for disconnected transactions are only of use to the controller
391 when the transfer is resumed.
392 When the host queues another transaction
393 for the controller to execute, the controller firmware will use a
394 free SCB if one is available.
395 Otherwise, the state of the most recently
396 disconnected (and therefore most likely to stay disconnected) SCB is
397 saved, via dma, to host memory, and the local SCB reused to start
398 the new transaction.
399 This allows the controller to queue up to
400 255 transactions regardless of the amount of SCB space.
401 Since the
402 local SCB space serves as a cache for disconnected transactions, the
403 more SCB space available, the less host bus traffic consumed saving
404 and restoring SCB data.
405 .Sh SEE ALSO
406 .Xr aha 4 ,
407 .Xr ahb 4 ,
408 .Xr cd 4 ,
409 .Xr da 4 ,
410 .Xr sa 4 ,
411 .Xr scsi 4
412 .Sh HISTORY
413 The
414 .Nm
415 driver appeared in
416 .Fx 2.0 .
417 .Sh AUTHORS
418 The
419 .Nm
420 driver, the
421 .Tn AIC7xxx
422 sequencer-code assembler,
423 and the firmware running on the aic7xxx chips was written by
424 .An Justin T. Gibbs .
425 .Sh BUGS
426 Some Quantum drives (at least the Empire 2100 and 1080s) will not run on an
427 .Tn AIC7870
428 Rev B in synchronous mode at 10MHz.
429 Controllers with this problem have a
430 42 MHz clock crystal on them and run slightly above 10MHz.
431 This confuses the drive and hangs the bus.
432 Setting a maximum synchronous negotiation rate of 8MHz in the
433 .Tn SCSI-Select
434 utility will allow normal operation.
435 .Pp
436 Although the Ultra2 and Ultra160 products have sufficient instruction
437 ram space to support both the initiator and target roles concurrently,
438 this configuration is disabled in favor of allowing the target role
439 to respond on multiple target ids.
440 A method for configuring dual role mode should be provided.
441 .Pp
442 Tagged Queuing is not supported in target mode.
443 .Pp
444 Reselection in target mode fails to function correctly on all high
445 voltage differential boards as shipped by Adaptec.
446 Information on
447 how to modify HVD board to work correctly in target mode is available
448 from Adaptec.