1.\" $NetBSD: ahc.4,v 1.36 2018/02/11 14:15:14 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 <bitmask of units> 67.\" .Pp 68.\" For one or more SCSI buses: 69.\" .Cd device scbus0 at ahc0 70For SCSI buses: 71.Cd scsibus* at ahc? 72.Sh DESCRIPTION 73.\" This driver provides access to the SCSI bus(es) connected to Adaptec 74.\" AIC7770, 75.\" AIC7850, 76.\" AIC7860, 77.\" AIC7870, 78.\" AIC7880, 79.\" AIC7890, 80.\" AIC7891, 81.\" AIC7892, 82.\" AIC7895, 83.\" AIC7896, 84.\" AIC7897 85.\" and 86.\" AIC7899 87.\" host adapter chips. 88.\" These chips are found on many motherboards as well as the following 89.\" Adaptec SCSI controller cards: 90.\" 274X(W), 91.\" 274X(T), 92.\" 284X, 93.\" 2910, 94.\" 2915, 95.\" 2920C, 96.\" 2930C, 97.\" 2930U2, 98.\" 2940, 99.\" 2940U, 100.\" 2940AU, 101.\" 2940UW, 102.\" 2940UW Dual, 103.\" 2940UW Pro, 104.\" 2940U2W, 105.\" 2940U2B, 106.\" 2950U2W, 107.\" 2950U2B, 108.\" 19160B, 109.\" 29160, 110.\" 29160B, 111.\" 29160N, 112.\" 3940, 113.\" 3940U, 114.\" 3940AU, 115.\" 3940UW, 116.\" 3940AUW, 117.\" 3940U2W, 118.\" 3950U2, 119.\" 3960, 120.\" 39160, 121.\" 3985, 122.\" and 123.\" 4944UW . 124The 125.Nm 126device driver supports SCSI controllers based on Adaptec AIC77xx 127and AIC78xx SCSI host adapter chips found on many motherboards as well as 128Adaptec SCSI controller cards. 129.Pp 130Driver features include support for twin and wide buses, 131fast, ultra or ultra2 synchronous transfers depending on controller type, 132.\" tagged queuing, SCB paging, and target mode. 133tagged queuing and SCB paging. 134.Pp 135Memory mapped I/O can be enabled for PCI devices with the 136.Dq Dv AHC_ALLOW_MEMIO 137configuration option. 138Memory mapped I/O is more efficient than the alternative, programmed I/O. 139Most PCI BIOSes will map devices so that either technique for communicating 140with the card is available. 141In some cases, 142usually when the PCI device is sitting behind a PCI->PCI bridge, 143the BIOS may fail to properly initialize the chip for memory mapped I/O. 144The typical symptom of this problem is a system hang if memory mapped I/O 145is attempted. 146Most modern motherboards perform the initialization correctly and work fine 147with this option enabled. 148.Pp 149.\" Individual controllers may be configured to operate in the target role 150.\" through the 151.\" .Dq Dv AHC_TMODE_ENABLE 152.\" configuration option. 153.\" The value assigned to this option should be a bitmap 154.\" of all units where target mode is desired. 155.\" For example, a value of 0x25, would enable target mode on units 0, 2, and 5. 156.\" .Pp 157Per target configuration performed in the SCSI-Select menu, accessible at boot 158in non-EISA models, 159or through an EISA configuration utility for EISA models, 160is honored by this driver. 161This includes synchronous/asynchronous transfers, 162maximum synchronous negotiation rate, 163wide transfers, 164disconnection, 165the host adapter's SCSI ID, 166and, 167in the case of EISA Twin Channel controllers, 168the primary channel selection. 169For systems that store non-volatile settings in a system specific manner 170rather than a serial EEPROM directly connected to the aic7xxx controller, 171the BIOS must be enabled for the driver to access this information. 172This restriction applies to all EISA and many motherboard configurations. 173.Pp 174Note that I/O addresses are determined automatically by the probe routines, 175but care should be taken when using a 284x 176.Pq VESA No local bus controller 177in an EISA system. 178The jumpers setting the I/O area for the 284x should match the EISA 179slot into which the card is inserted to prevent conflicts with other 180EISA cards. 181.Pp 182Performance and feature sets vary throughout the aic7xxx product line. 183The following table provides a comparison of the different chips supported 184by the 185.Nm 186driver. 187Note that wide and twin channel features, although always supported 188by a particular chip, may be disabled in a particular motherboard 189or card design. 190.Bl -column "aic7895c" "MIPS" "EISA/VL" "MaxSync" "MaxWidth" "SCBs" "2 3 4 5 6 7 8" 191.It Sy Chip Ta Sy MIPS Ta Sy Bus Ta Sy MaxSync Ta Sy MaxWidth Ta Sy SCBs Ta Sy Features 192.It aic7770 Ta 10 Ta EISA/VL Ta 10MHz Ta 16Bit Ta 4 Ta 1 193.It aic7850 Ta 10 Ta PCI/32 Ta 10MHz Ta 8Bit Ta 3 Ta "" 194.It aic7860 Ta 10 Ta PCI/32 Ta 20MHz Ta 8Bit Ta 3 Ta "" 195.It aic7870 Ta 10 Ta PCI/32 Ta 10MHz Ta 16Bit Ta 16 Ta "" 196.It aic7880 Ta 10 Ta PCI/32 Ta 20MHz Ta 16Bit Ta 16 Ta "" 197.It aic7890 Ta 20 Ta PCI/32 Ta 40MHz Ta 16Bit Ta 16 Ta 3 4 5 6 7 8 198.It aic7891 Ta 20 Ta PCI/64 Ta 40MHz Ta 16Bit Ta 16 Ta 3 4 5 6 7 8 199.It aic7892 Ta 20 Ta PCI/64 Ta 80MHz Ta 16Bit Ta 16 Ta 3 4 5 6 7 8 200.It aic7895 Ta 15 Ta PCI/32 Ta 20MHz Ta 16Bit Ta 16 Ta 2 3 4 5 201.It aic7895C Ta 15 Ta PCI/32 Ta 20MHz Ta 16Bit Ta 16 Ta 2 3 4 5 8 202.It aic7896 Ta 20 Ta PCI/32 Ta 40MHz Ta 16Bit Ta 16 Ta 2 3 4 5 6 7 8 203.It aic7897 Ta 20 Ta PCI/64 Ta 40MHz Ta 16Bit Ta 16 Ta 2 3 4 5 6 7 8 204.It aic7899 Ta 20 Ta PCI/64 Ta 80MHz Ta 16Bit Ta 16 Ta 2 3 4 5 6 7 8 205.El 206.Bl -enum -compact 207.It 208Multiplexed Twin Channel Device - One controller servicing two buses. 209.It 210Multi-function Twin Channel Device - Two controllers on one chip. 211.It 212Command Channel Secondary DMA Engine - Allows scatter gather list and 213SCB prefetch. 214.It 21564 Byte SCB Support - SCSI CDB is embedded in the SCB to eliminate an extra DMA. 216.It 217Block Move Instruction Support - Doubles the speed of certain sequencer 218operations. 219.It 220.Sq Bayonet 221style Scatter Gather Engine - Improves S/G prefetch performance. 222.It 223Queuing Registers - Allows queuing of new transactions without pausing the 224sequencer. 225.It 226Multiple Target IDs - Allows the controller to respond to selection as a 227target on multiple SCSI IDs. 228.El 229.Sh HARDWARE 230Supported SCSI controllers include: 231.Bl -item -offset indent 232.It 233Adaptec AHA-2742W EISA Fast Wide SCSI adapter 234.It 235Adaptec AHA-274xAT EISA dual channel Fast SCSI adapter 236.It 237Adaptec AHA-284x VL Fast SCSI adapter 238.It 239Adaptec AHA-2910 PCI Fast SCSI adapter (no SCSI BIOS) 240.It 241Adaptec AHA-2915 PCI Fast SCSI adapter (no SCSI BIOS) 242.It 243Adaptec AHA-2920C PCI Fast SCSI adapter 244.Bl -item -offset indent 245.It 246Note: 247Adaptec AHA-2920/A which use the Future Domain's chips are not supported 248by this driver. 249.El 250.It 251Adaptec AHA-2930C PCI Ultra SCSI adapter 252.It 253Adaptec AHA-2930U2 PCI Ultra2 Wide LVD SCSI adapter 254.It 255Adaptec AHA-2940 PCI Fast SCSI adapter 256.It 257Adaptec AHA-2940U PCI Ultra SCSI adapter 258.It 259Adaptec AHA-2940AU PCI Ultra SCSI adapter 260.It 261Adaptec AHA-2940UW PCI Ultra Wide SCSI adapter 262.It 263Adaptec AHA-2940UW Dual PCI dual channel Ultra Wide SCSI adapter 264.It 265Adaptec AHA-2940UW Pro PCI Ultra Wide SCSI adapter 266.It 267Adaptec AHA-2940U2W PCI Ultra2 Wide LVD SCSI adapter 268.It 269Adaptec AHA-2940U2B PCI Ultra2 Wide LVD SCSI adapter 270.It 271Adaptec AHA-2944W PCI Fast Wide Differential SCSI adapter 272.It 273Adaptec AHA-2944UW PCI Ultra Wide Differential SCSI adapter 274.It 275Adaptec AHA-2950U2W 276.It 277Adaptec AHA-2950U2B 64bit PCI Ultra2 Wide LVD SCSI adapter 278.It 279Adaptec AHA-19160B PCI Ultra160 Wide LVD SCSI adapter 280.It 281Adaptec ASC-29160 PCI Ultra160 Wide LVD SCSI adapter 282.It 283Adaptec AHA-29160N PCI Ultra160 Wide LVD SCSI adapter 284.It 285Adaptec AHA-29160B 64bit PCI Ultra160 Wide LVD SCSI adapter 286.It 287Adaptec AHA-3940 PCI dual channel Fast SCSI adapter 288.It 289Adaptec AHA-3940U PCI dual channel Ultra SCSI adapter 290.It 291Adaptec AHA-3940AU PCI dual channel Ultra SCSI adapter 292.It 293Adaptec AHA-3940UW PCI dual channel Ultra Wide SCSI adapter 294.It 295Adaptec AHA-3940AUW PCI dual channel Ultra Wide SCSI adapter 296.It 297Adaptec AHA-3940U2W PCI dual channel Ultra2 Wide LVD SCSI adapter 298.It 299Adaptec AHA-3950U2 64bit PCI dual channel Ultra2 Wide LVD SCSI adapter 300.It 301Adaptec AHA-3960 64bit PCI dual channel Ultra160 Wide LVD SCSI adapter 302.It 303Adaptec AHA-3985 PCI dual channel Fast SCSI RAID adapter 304.It 305Adaptec AHA-39160 64bit PCI dual channel Ultra160 Wide LVD SCSI adapter 306.It 307Adaptec AHA-4944UW PCI quad channel PCI Ultra Wide Differential SCSI adapter 308.It 309Other SCSI controllers based on the Adaptec AIC7770, AIC7850, 310AIC7860, AIC7870, AIC7880, AIC7890, AIC7891, AIC7892, AIC7895, 311AIC7896, AIC7897 and AIC7899 SCSI host adapter chips. 312.El 313.Sh SCSI CONTROL BLOCKS (SCBs) 314Every transaction sent to a device on the SCSI bus is assigned a 315.Sq SCSI Control Block 316(SCB). 317The SCB contains all of the information required by the controller 318to process a transaction. 319The chip feature table lists the number of SCBs that can be stored 320in on-chip memory. 321All chips with model numbers greater than or equal to 7870 allow 322for the on chip SCB space to be augmented with external SRAM up to 323a maximum of 255 SCBs. 324Very few Adaptec controller configurations have external SRAM. 325.Pp 326If external SRAM is not available, SCBs are a limited resource. 327Using the SCBs in a straight forward manner would only allow the driver to 328handle as many concurrent transactions as there are physical SCBs. 329To fully use the SCSI bus and the devices on it, 330requires much more concurrency. 331The solution to this problem is 332.Em SCB Paging , 333a concept similar to memory paging. 334SCB paging takes advantage of the fact that devices usually disconnect 335from the SCSI bus for long periods of time without talking to the 336controller. 337The SCBs for disconnected transactions are only of use to the 338controller when the transfer is resumed. 339When the host queues another transaction for the controller to 340execute, the controller firmware will use a free SCB if one is 341available. 342Otherwise, the state of the most recently disconnected (and therefore 343most likely to stay disconnected) SCB is saved, via DMA, to host 344memory, and the local SCB reused to start the new transaction. 345This allows the controller to queue up to 346255 transactions regardless of the amount of SCB space. 347Since the local SCB space serves as a cache for disconnected 348transactions, the more SCB space available, the less host bus 349traffic consumed saving and restoring SCB data. 350.Sh SEE ALSO 351.Xr aha 4 , 352.Xr ahb 4 , 353.Xr ahd 4 , 354.Xr cd 4 , 355.Xr ch 4 , 356.Xr intro 4 , 357.Xr scsi 4 , 358.Xr sd 4 , 359.Xr st 4 360.Sh HISTORY 361The 362.Nm 363driver appeared in 364.Fx 2.0 365and 366.Nx 1.1 . 367.Sh AUTHORS 368The 369.Nm 370driver, the AIC7xxx sequencer-code assembler, 371and the firmware running on the aic7xxx chips was written by 372.An Justin T. Gibbs . 373.Nx 374porting is done by Stefan Grefen, Charles M. Hannum, 375Michael Graff, Jason R. Thorpe, Pete Bentley, 376Frank van der Linden and Noriyuki Soda. 377.Sh BUGS 378Some Quantum drives (at least the Empire 2100 and 1080s) will not run on an 379AIC7870 Rev B in synchronous mode at 10MHz. 380Controllers with this problem have a 38142 MHz clock crystal on them and run slightly above 10MHz. 382This confuses the drive and hangs the bus. 383Setting a maximum synchronous negotiation rate of 8MHz in the SCSI-Select 384utility will allow normal operation. 385.Pp 386.\" Although the Ultra2 and Ultra160 products have sufficient instruction 387.\" ram space to support both the initiator and target roles concurrently, 388.\" this configuration is disabled in favor of allowing the target role 389.\" to respond on multiple target ids. 390.\" A method for configuring dual 391.\" role mode should be provided. 392.\" .Pp 393.\" Tagged Queuing is not supported in target mode. 394.\" .Pp 395.\" Reselection in target mode fails to function correctly on all high 396.\" voltage differential boards as shipped by Adaptec. 397.\" Information on 398.\" how to modify HVD board to work correctly in target mode is available 399.\" from Adaptec. 400Target mode is not supported on 401.Nx 402version of this driver. 403