b53854391ab27705bbfb7639bbfd6460634a5a0e
[games.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.6 2007/09/26 21:01:16 swildner Exp $
29 .\"
30 .Dd September 26, 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 compile in debugging code:
54 .Cd options AHC_DEBUG
55 .Cd options AHC_DEBUG_OPTS=<bitmask of options>
56 .Cd options AHC_REG_PRETTY_PRINT
57 .Pp
58 To configure one or more controllers to assume the target role:
59 .Cd options AHC_TMODE_ENABLE <bitmask of units>
60 .Ed
61 .Pp
62 Alternatively, to load the driver as a
63 module at boot time, place the following lines in
64 .Xr loader.conf 5 :
65 .Bd -literal -offset indent
66 ahc_load="YES"
67 ahc_eisa_load="YES"
68 ahc_isa_load="YES"
69 ahc_pci_load="YES"
70 .Ed
71 .Sh DESCRIPTION
72 This driver provides access to the
73 .Tn SCSI
74 bus(es) connected to the Adaptec AIC77xx and AIC78xx
75 host adapter chips.
76 .Pp
77 Driver features include support for twin and wide busses,
78 fast, ultra or ultra2 synchronous transfers depending on controller type,
79 tagged queueing, SCB paging, and target mode.
80 .Pp
81 Memory mapped I/O can be enabled for PCI devices with the
82 .Dq Dv AHC_ALLOW_MEMIO
83 configuration option.
84 Memory mapped I/O is more efficient than the alternative, programmed I/O.
85 Most PCI BIOSes will map devices so that either technique for communicating
86 with the card is available.
87 In some cases,
88 usually when the PCI device is sitting behind a PCI->PCI bridge,
89 the BIOS may fail to properly initialize the chip for memory mapped I/O.
90 The typical symptom of this problem is a system hang if memory mapped I/O
91 is attempted.
92 Most modern motherboards perform the initialization correctly and work fine
93 with this option enabled.
94 .Pp
95 The
96 .Dv AHC_DEBUG_OPTS
97 option is used to control which diagnostic messages are printed to the
98 console when
99 .Dv AHC_DEBUG
100 is enabled.
101 Logically OR the following bits together:
102 .Bl -column -offset indent Value Function
103 .Em "Value      Function"
104 0x0001  Show miscellaneous information
105 0x0002  Show sense data
106 0x0004  Show Serial EEPROM contents
107 0x0008  Show bus termination settings
108 0x0010  Show host memory usage
109 0x0020  Show SCSI protocol messages
110 .\"0x0040 XXX: AHC_SHOW_DV
111 0x0080  Show selection timeouts
112 0x0200  Show Queue Full status
113 0x0400  Show SCB queue status
114 0x0800  Show inbound packet information
115 .\"0x1000 XXX: AHC_SHOW_MASKED_ERRORS
116 0x2000  Enable extra diagnostic code in the firmware
117 .El
118 .Pp
119 The
120 .Dv AHC_REG_PRETTY_PRINT
121 option compiles in support for human-readable bit definitions for each register
122 that is printed by the debugging code.
123 .Pp
124 Individual controllers may be configured to operate in the target role
125 through the
126 .Dq Dv AHC_TMODE_ENABLE
127 configuration option.
128 The value assigned to this option should be a bitmap
129 of all units where target mode is desired.
130 For example, a value of 0x25, would enable target mode on units 0, 2, and 5.
131 A value of 0x8a enables it for units 1, 3, and 7.
132 .Pp
133 Per target configuration performed in the
134 .Tn SCSI-Select
135 menu, accessible at boot
136 in
137 .No non- Ns Tn EISA
138 models,
139 or through an
140 .Tn EISA
141 configuration utility for
142 .Tn EISA
143 models,
144 is honored by this driver.
145 This includes synchronous/asynchronous transfers,
146 maximum synchronous negotiation rate,
147 wide transfers,
148 disconnection,
149 the host adapter's SCSI ID,
150 and,
151 in the case of
152 .Tn EISA
153 Twin Channel controllers,
154 the primary channel selection.
155 For systems that store non-volatile settings in a system specific manner
156 rather than a serial eeprom directly connected to the aic7xxx controller,
157 the
158 .Tn BIOS
159 must be enabled for the driver to access this information.
160 This restriction applies to all
161 .Tn EISA
162 and many motherboard configurations.
163 .Pp
164 Note that I/O addresses are determined automatically by the probe routines,
165 but care should be taken when using a 284x
166 .Pq Tn VESA No local bus controller
167 in an
168 .Tn EISA
169 system.
170 The jumpers setting the I/O area for the 284x should match the
171 .Tn EISA
172 slot into which the card is inserted to prevent conflicts with other
173 .Tn EISA
174 cards.
175 .Pp
176 Performance and feature sets vary throughout the aic7xxx product line.
177 The following table provides a comparison of the different chips supported
178 by the
179 .Nm
180 driver.
181 Note that wide and twin channel features, although always supported
182 by a particular chip, may be disabled in a particular motherboard or card
183 design.
184 .Pp
185 .Bd -ragged -offset indent
186 .Bl -column "aic7770 " "10 " "EISA/VL  " "10MHz " "16bit " "SCBs " Features
187 .Em "Chip       MIPS    Bus      MaxSync   MaxWidth  SCBs  Features"
188 aic7770     10    EISA/VL    10MHz     16Bit     4    1
189 aic7850     10    PCI/32     10MHz      8Bit     3
190 aic7860     10    PCI/32     20MHz      8Bit     3
191 aic7870     10    PCI/32     10MHz     16Bit    16
192 aic7880     10    PCI/32     20MHz     16Bit    16
193 aic7890     20    PCI/32     40MHz     16Bit    16        3 4 5 6 7 8
194 aic7891     20    PCI/64     40MHz     16Bit    16        3 4 5 6 7 8
195 aic7892     20    PCI/64     80MHz     16Bit    16        3 4 5 6 7 8
196 aic7895     15    PCI/32     20MHz     16Bit    16      2 3 4 5
197 aic7895C    15    PCI/32     20MHz     16Bit    16      2 3 4 5     8
198 aic7896     20    PCI/32     40MHz     16Bit    16      2 3 4 5 6 7 8
199 aic7897     20    PCI/64     40MHz     16Bit    16      2 3 4 5 6 7 8
200 aic7899     20    PCI/64     80MHz     16Bit    16      2 3 4 5 6 7 8
201 .El
202 .Pp
203 .Bl -enum -compact
204 .It
205 Multiplexed Twin Channel Device - One controller servicing two busses.
206 .It
207 Multi-function Twin Channel Device - Two controllers on one chip.
208 .It
209 Command Channel Secondary DMA Engine - Allows scatter gather list and
210 SCB prefetch.
211 .It
212 64 Byte SCB Support - SCSI CDB is embedded in the SCB to eliminate an extra DMA.
213 .It
214 Block Move Instruction Support - Doubles the speed of certain sequencer
215 operations.
216 .It
217 .Sq Bayonet
218 style Scatter Gather Engine - Improves S/G prefetch performance.
219 .It
220 Queuing Registers - Allows queueing of new transactions without pausing the
221 sequencer.
222 .It
223 Multiple Target IDs - Allows the controller to respond to selection as a
224 target on multiple SCSI IDs.
225 .El
226 .Ed
227 .Sh HARDWARE
228 The
229 .Nm
230 driver supports the following
231 .Tn SCSI
232 host adapter chips and
233 .Tn SCSI
234 controller cards:
235 .Pp
236 .Bl -bullet -compact
237 .It
238 Adaptec
239 .Tn AIC7770
240 host adapter chip
241 .It
242 Adaptec
243 .Tn AIC7850
244 host adapter chip
245 .It
246 Adaptec
247 .Tn AIC7860
248 host adapter chip
249 .It
250 Adaptec
251 .Tn AIC7870
252 host adapter chip
253 .It
254 Adaptec
255 .Tn AIC7880
256 host adapter chip
257 .It
258 Adaptec
259 .Tn AIC7890
260 host adapter chip
261 .It
262 Adaptec
263 .Tn AIC7891
264 host adapter chip
265 .It
266 Adaptec
267 .Tn AIC7892
268 host adapter chip
269 .It
270 Adaptec
271 .Tn AIC7895
272 host adapter chip
273 .It
274 Adaptec
275 .Tn AIC7896
276 host adapter chip
277 .It
278 Adaptec
279 .Tn AIC7897
280 host adapter chip
281 .It
282 Adaptec
283 .Tn AIC7899
284 host adapter chip
285 .It
286 Adaptec
287 .Tn 274X(W)
288 .It
289 Adaptec
290 .Tn 274X(T)
291 .It
292 Adaptec
293 .Tn 284X
294 .It
295 Adaptec
296 .Tn 2910
297 .It
298 Adaptec
299 .Tn 2915
300 .It
301 Adaptec
302 .Tn 2920
303 .It
304 Adaptec
305 .Tn 2930C
306 .It
307 Adaptec
308 .Tn 2930U2
309 .It
310 Adaptec
311 .Tn 2940
312 .It
313 Adaptec
314 .Tn 2940J
315 .It
316 Adaptec
317 .Tn 2940N
318 .It
319 Adaptec
320 .Tn 2940U
321 .It
322 Adaptec
323 .Tn 2940AU
324 .It
325 Adaptec
326 .Tn 2940UW
327 .It
328 Adaptec
329 .Tn 2940UW Dual
330 .It
331 Adaptec
332 .Tn 2940UW Pro
333 .It
334 Adaptec
335 .Tn 2940U2W
336 .It
337 Adaptec
338 .Tn 2940U2B
339 .It
340 Adaptec
341 .Tn 2950U2W
342 .It
343 Adaptec
344 .Tn 2950U2B
345 .It
346 Adaptec
347 .Tn 19160B
348 .It
349 Adaptec
350 .Tn 29160B
351 .It
352 Adaptec
353 .Tn 29160N
354 .It
355 Adaptec
356 .Tn 3940
357 .It
358 Adaptec
359 .Tn 3940U
360 .It
361 Adaptec
362 .Tn 3940AU
363 .It
364 Adaptec
365 .Tn 3940UW
366 .It
367 Adaptec
368 .Tn 3940AUW
369 .It
370 Adaptec
371 .Tn 3940U2W
372 .It
373 Adaptec
374 .Tn 3950U2
375 .It
376 Adaptec
377 .Tn 3960
378 .It
379 Adaptec
380 .Tn 39160
381 .It
382 Adaptec
383 .Tn 3985
384 .It
385 Adaptec
386 .Tn 4944UW
387 .It
388 NEC PC-9821Xt13 (PC-98)
389 .It
390 NEC RvII26 (PC-98)
391 .It
392 NEC PC-9821X-B02L/B09 (PC-98)
393 .It
394 NEC SV-98/2-B03 (PC-98)
395 .It
396 Many motherboards with on-board
397 .Tn SCSI
398 support
399 .El
400 .Sh SCSI CONTROL BLOCKS (SCBs)
401 Every transaction sent to a device on the SCSI bus is assigned a
402 .Sq SCSI Control Block
403 (SCB).
404 The SCB contains all of the information required by the
405 controller to process a transaction.
406 The chip feature table lists
407 the number of SCBs that can be stored in on-chip memory.
408 All chips
409 with model numbers greater than or equal to 7870 allow for the on chip
410 SCB space to be augmented with external SRAM up to a maximum of 255 SCBs.
411 Very few Adaptec controller configurations have external SRAM.
412 .Pp
413 If external SRAM is not available, SCBs are a limited resource.
414 Using the SCBs in a straight forward manner would only allow the driver to
415 handle as many concurrent transactions as there are physical SCBs.
416 To fully utilize the SCSI bus and the devices on it,
417 requires much more concurrency.
418 The solution to this problem is
419 .Em SCB Paging ,
420 a concept similar to memory paging.
421 SCB paging takes advantage of
422 the fact that devices usually disconnect from the SCSI bus for long
423 periods of time without talking to the controller.
424 The SCBs for disconnected transactions are only of use to the controller
425 when the transfer is resumed.
426 When the host queues another transaction
427 for the controller to execute, the controller firmware will use a
428 free SCB if one is available.
429 Otherwise, the state of the most recently
430 disconnected (and therefore most likely to stay disconnected) SCB is
431 saved, via dma, to host memory, and the local SCB reused to start
432 the new transaction.
433 This allows the controller to queue up to
434 255 transactions regardless of the amount of SCB space.
435 Since the
436 local SCB space serves as a cache for disconnected transactions, the
437 more SCB space available, the less host bus traffic consumed saving
438 and restoring SCB data.
439 .Sh SEE ALSO
440 .Xr aha 4 ,
441 .Xr ahb 4 ,
442 .Xr cd 4 ,
443 .Xr da 4 ,
444 .Xr sa 4 ,
445 .Xr scsi 4
446 .Sh HISTORY
447 The
448 .Nm
449 driver appeared in
450 .Fx 2.0 .
451 .Sh AUTHORS
452 The
453 .Nm
454 driver, the
455 .Tn AIC7xxx
456 sequencer-code assembler,
457 and the firmware running on the aic7xxx chips was written by
458 .An Justin T. Gibbs .
459 .Sh BUGS
460 Some Quantum drives (at least the Empire 2100 and 1080s) will not run on an
461 .Tn AIC7870
462 Rev B in synchronous mode at 10MHz.
463 Controllers with this problem have a
464 42 MHz clock crystal on them and run slightly above 10MHz.
465 This confuses the drive and hangs the bus.
466 Setting a maximum synchronous negotiation rate of 8MHz in the
467 .Tn SCSI-Select
468 utility will allow normal operation.
469 .Pp
470 Although the Ultra2 and Ultra160 products have sufficient instruction
471 ram space to support both the initiator and target roles concurrently,
472 this configuration is disabled in favor of allowing the target role
473 to respond on multiple target ids.
474 A method for configuring dual role mode should be provided.
475 .Pp
476 Tagged Queuing is not supported in target mode.
477 .Pp
478 Reselection in target mode fails to function correctly on all high
479 voltage differential boards as shipped by Adaptec.
480 Information on
481 how to modify HVD board to work correctly in target mode is available
482 from Adaptec.