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