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