1*4882a593Smuzhiyun.. SPDX-License-Identifier: GPL-2.0 2*4882a593Smuzhiyun.. include:: <isonum.txt> 3*4882a593Smuzhiyun 4*4882a593Smuzhiyun===================================================== 5*4882a593SmuzhiyunAdaptec AHA-1520/1522 SCSI driver for Linux (aha152x) 6*4882a593Smuzhiyun===================================================== 7*4882a593Smuzhiyun 8*4882a593SmuzhiyunCopyright |copy| 1993-1999 Jürgen Fischer <fischer@norbit.de> 9*4882a593Smuzhiyun 10*4882a593SmuzhiyunTC1550 patches by Luuk van Dijk (ldz@xs4all.nl) 11*4882a593Smuzhiyun 12*4882a593Smuzhiyun 13*4882a593SmuzhiyunIn Revision 2 the driver was modified a lot (especially the 14*4882a593Smuzhiyunbottom-half handler complete()). 15*4882a593Smuzhiyun 16*4882a593SmuzhiyunThe driver is much cleaner now, has support for the new 17*4882a593Smuzhiyunerror handling code in 2.3, produced less cpu load (much 18*4882a593Smuzhiyunless polling loops), has slightly higher throughput (at 19*4882a593Smuzhiyunleast on my ancient test box; a i486/33Mhz/20MB). 20*4882a593Smuzhiyun 21*4882a593Smuzhiyun 22*4882a593SmuzhiyunConfiguration Arguments 23*4882a593Smuzhiyun======================= 24*4882a593Smuzhiyun 25*4882a593Smuzhiyun============ ======================================== ====================== 26*4882a593SmuzhiyunIOPORT base io address (0x340/0x140) 27*4882a593SmuzhiyunIRQ interrupt level (9-12; default 11) 28*4882a593SmuzhiyunSCSI_ID scsi id of controller (0-7; default 7) 29*4882a593SmuzhiyunRECONNECT allow targets to disconnect from the bus (0/1; default 1 [on]) 30*4882a593SmuzhiyunPARITY enable parity checking (0/1; default 1 [on]) 31*4882a593SmuzhiyunSYNCHRONOUS enable synchronous transfers (0/1; default 1 [on]) 32*4882a593SmuzhiyunDELAY: bus reset delay (default 100) 33*4882a593SmuzhiyunEXT_TRANS: enable extended translation (0/1: default 0 [off]) 34*4882a593Smuzhiyun (see NOTES) 35*4882a593Smuzhiyun============ ======================================== ====================== 36*4882a593Smuzhiyun 37*4882a593SmuzhiyunCompile Time Configuration 38*4882a593Smuzhiyun========================== 39*4882a593Smuzhiyun 40*4882a593Smuzhiyun(go into AHA152X in drivers/scsi/Makefile): 41*4882a593Smuzhiyun 42*4882a593Smuzhiyun- DAUTOCONF 43*4882a593Smuzhiyun use configuration the controller reports (AHA-152x only) 44*4882a593Smuzhiyun 45*4882a593Smuzhiyun- DSKIP_BIOSTEST 46*4882a593Smuzhiyun Don't test for BIOS signature (AHA-1510 or disabled BIOS) 47*4882a593Smuzhiyun 48*4882a593Smuzhiyun- DSETUP0="{ IOPORT, IRQ, SCSI_ID, RECONNECT, PARITY, SYNCHRONOUS, DELAY, EXT_TRANS }" 49*4882a593Smuzhiyun override for the first controller 50*4882a593Smuzhiyun 51*4882a593Smuzhiyun- DSETUP1="{ IOPORT, IRQ, SCSI_ID, RECONNECT, PARITY, SYNCHRONOUS, DELAY, EXT_TRANS }" 52*4882a593Smuzhiyun override for the second controller 53*4882a593Smuzhiyun 54*4882a593Smuzhiyun- DAHA152X_DEBUG 55*4882a593Smuzhiyun enable debugging output 56*4882a593Smuzhiyun 57*4882a593Smuzhiyun- DAHA152X_STAT 58*4882a593Smuzhiyun enable some statistics 59*4882a593Smuzhiyun 60*4882a593Smuzhiyun 61*4882a593SmuzhiyunLILO Command Line Options 62*4882a593Smuzhiyun========================= 63*4882a593Smuzhiyun 64*4882a593Smuzhiyun :: 65*4882a593Smuzhiyun 66*4882a593Smuzhiyun aha152x=<IOPORT>[,<IRQ>[,<SCSI-ID>[,<RECONNECT>[,<PARITY>[,<SYNCHRONOUS>[,<DELAY> [,<EXT_TRANS]]]]]]] 67*4882a593Smuzhiyun 68*4882a593Smuzhiyun The normal configuration can be overridden by specifying a command line. 69*4882a593Smuzhiyun When you do this, the BIOS test is skipped. Entered values have to be 70*4882a593Smuzhiyun valid (known). Don't use values that aren't supported under normal 71*4882a593Smuzhiyun operation. If you think that you need other values: contact me. 72*4882a593Smuzhiyun For two controllers use the aha152x statement twice. 73*4882a593Smuzhiyun 74*4882a593Smuzhiyun 75*4882a593SmuzhiyunSymbols for Module Configuration 76*4882a593Smuzhiyun================================ 77*4882a593Smuzhiyun 78*4882a593SmuzhiyunChoose from 2 alternatives: 79*4882a593Smuzhiyun 80*4882a593Smuzhiyun1. specify everything (old):: 81*4882a593Smuzhiyun 82*4882a593Smuzhiyun aha152x=IOPORT,IRQ,SCSI_ID,RECONNECT,PARITY,SYNCHRONOUS,DELAY,EXT_TRANS 83*4882a593Smuzhiyun 84*4882a593Smuzhiyun configuration override for first controller 85*4882a593Smuzhiyun 86*4882a593Smuzhiyun :: 87*4882a593Smuzhiyun 88*4882a593Smuzhiyun aha152x1=IOPORT,IRQ,SCSI_ID,RECONNECT,PARITY,SYNCHRONOUS,DELAY,EXT_TRANS 89*4882a593Smuzhiyun 90*4882a593Smuzhiyun configuration override for second controller 91*4882a593Smuzhiyun 92*4882a593Smuzhiyun2. specify only what you need to (irq or io is required; new) 93*4882a593Smuzhiyun 94*4882a593Smuzhiyunio=IOPORT0[,IOPORT1] 95*4882a593Smuzhiyun IOPORT for first and second controller 96*4882a593Smuzhiyun 97*4882a593Smuzhiyunirq=IRQ0[,IRQ1] 98*4882a593Smuzhiyun IRQ for first and second controller 99*4882a593Smuzhiyun 100*4882a593Smuzhiyunscsiid=SCSIID0[,SCSIID1] 101*4882a593Smuzhiyun SCSIID for first and second controller 102*4882a593Smuzhiyun 103*4882a593Smuzhiyunreconnect=RECONNECT0[,RECONNECT1] 104*4882a593Smuzhiyun allow targets to disconnect for first and second controller 105*4882a593Smuzhiyun 106*4882a593Smuzhiyunparity=PAR0[PAR1] 107*4882a593Smuzhiyun use parity for first and second controller 108*4882a593Smuzhiyun 109*4882a593Smuzhiyunsync=SYNCHRONOUS0[,SYNCHRONOUS1] 110*4882a593Smuzhiyun enable synchronous transfers for first and second controller 111*4882a593Smuzhiyun 112*4882a593Smuzhiyundelay=DELAY0[,DELAY1] 113*4882a593Smuzhiyun reset DELAY for first and second controller 114*4882a593Smuzhiyun 115*4882a593Smuzhiyunexttrans=EXTTRANS0[,EXTTRANS1] 116*4882a593Smuzhiyun enable extended translation for first and second controller 117*4882a593Smuzhiyun 118*4882a593Smuzhiyun 119*4882a593SmuzhiyunIf you use both alternatives the first will be taken. 120*4882a593Smuzhiyun 121*4882a593Smuzhiyun 122*4882a593SmuzhiyunNotes on EXT_TRANS 123*4882a593Smuzhiyun================== 124*4882a593Smuzhiyun 125*4882a593SmuzhiyunSCSI uses block numbers to address blocks/sectors on a device. 126*4882a593SmuzhiyunThe BIOS uses a cylinder/head/sector addressing scheme (C/H/S) 127*4882a593Smuzhiyunscheme instead. DOS expects a BIOS or driver that understands this 128*4882a593SmuzhiyunC/H/S addressing. 129*4882a593Smuzhiyun 130*4882a593SmuzhiyunThe number of cylinders/heads/sectors is called geometry and is required 131*4882a593Smuzhiyunas base for requests in C/H/S addressing. SCSI only knows about the 132*4882a593Smuzhiyuntotal capacity of disks in blocks (sectors). 133*4882a593Smuzhiyun 134*4882a593SmuzhiyunTherefore the SCSI BIOS/DOS driver has to calculate a logical/virtual 135*4882a593Smuzhiyungeometry just to be able to support that addressing scheme. The geometry 136*4882a593Smuzhiyunreturned by the SCSI BIOS is a pure calculation and has nothing to 137*4882a593Smuzhiyundo with the real/physical geometry of the disk (which is usually 138*4882a593Smuzhiyunirrelevant anyway). 139*4882a593Smuzhiyun 140*4882a593SmuzhiyunBasically this has no impact at all on Linux, because it also uses block 141*4882a593Smuzhiyuninstead of C/H/S addressing. Unfortunately C/H/S addressing is also used 142*4882a593Smuzhiyunin the partition table and therefore every operating system has to know 143*4882a593Smuzhiyunthe right geometry to be able to interpret it. 144*4882a593Smuzhiyun 145*4882a593SmuzhiyunMoreover there are certain limitations to the C/H/S addressing scheme, 146*4882a593Smuzhiyunnamely the address space is limited to up to 255 heads, up to 63 sectors 147*4882a593Smuzhiyunand a maximum of 1023 cylinders. 148*4882a593Smuzhiyun 149*4882a593SmuzhiyunThe AHA-1522 BIOS calculates the geometry by fixing the number of heads 150*4882a593Smuzhiyunto 64, the number of sectors to 32 and by calculating the number of 151*4882a593Smuzhiyuncylinders by dividing the capacity reported by the disk by 64*32 (1 MB). 152*4882a593SmuzhiyunThis is considered to be the default translation. 153*4882a593Smuzhiyun 154*4882a593SmuzhiyunWith respect to the limit of 1023 cylinders using C/H/S you can only 155*4882a593Smuzhiyunaddress the first GB of your disk in the partition table. Therefore 156*4882a593SmuzhiyunBIOSes of some newer controllers based on the AIC-6260/6360 support 157*4882a593Smuzhiyunextended translation. This means that the BIOS uses 255 for heads, 158*4882a593Smuzhiyun63 for sectors and then divides the capacity of the disk by 255*63 159*4882a593Smuzhiyun(about 8 MB), as soon it sees a disk greater than 1 GB. That results 160*4882a593Smuzhiyunin a maximum of about 8 GB addressable diskspace in the partition table 161*4882a593Smuzhiyun(but there are already bigger disks out there today). 162*4882a593Smuzhiyun 163*4882a593SmuzhiyunTo make it even more complicated the translation mode might/might 164*4882a593Smuzhiyunnot be configurable in certain BIOS setups. 165*4882a593Smuzhiyun 166*4882a593SmuzhiyunThis driver does some more or less failsafe guessing to get the 167*4882a593Smuzhiyungeometry right in most cases: 168*4882a593Smuzhiyun 169*4882a593Smuzhiyun- for disks<1GB: use default translation (C/32/64) 170*4882a593Smuzhiyun 171*4882a593Smuzhiyun- for disks>1GB: 172*4882a593Smuzhiyun 173*4882a593Smuzhiyun - take current geometry from the partition table 174*4882a593Smuzhiyun (using scsicam_bios_param and accept only 'valid' geometries, 175*4882a593Smuzhiyun ie. either (C/32/64) or (C/63/255)). This can be extended translation 176*4882a593Smuzhiyun even if it's not enabled in the driver. 177*4882a593Smuzhiyun 178*4882a593Smuzhiyun - if that fails, take extended translation if enabled by override, 179*4882a593Smuzhiyun kernel or module parameter, otherwise take default translation and 180*4882a593Smuzhiyun ask the user for verification. This might on not yet partitioned 181*4882a593Smuzhiyun disks. 182*4882a593Smuzhiyun 183*4882a593Smuzhiyun 184*4882a593SmuzhiyunReferences Used 185*4882a593Smuzhiyun=============== 186*4882a593Smuzhiyun 187*4882a593Smuzhiyun "AIC-6260 SCSI Chip Specification", Adaptec Corporation. 188*4882a593Smuzhiyun 189*4882a593Smuzhiyun "SCSI COMPUTER SYSTEM INTERFACE - 2 (SCSI-2)", X3T9.2/86-109 rev. 10h 190*4882a593Smuzhiyun 191*4882a593Smuzhiyun "Writing a SCSI device driver for Linux", Rik Faith (faith@cs.unc.edu) 192*4882a593Smuzhiyun 193*4882a593Smuzhiyun "Kernel Hacker's Guide", Michael K. Johnson (johnsonm@sunsite.unc.edu) 194*4882a593Smuzhiyun 195*4882a593Smuzhiyun "Adaptec 1520/1522 User's Guide", Adaptec Corporation. 196*4882a593Smuzhiyun 197*4882a593Smuzhiyun Michael K. Johnson (johnsonm@sunsite.unc.edu) 198*4882a593Smuzhiyun 199*4882a593Smuzhiyun Drew Eckhardt (drew@cs.colorado.edu) 200*4882a593Smuzhiyun 201*4882a593Smuzhiyun Eric Youngdale (eric@andante.org) 202*4882a593Smuzhiyun 203*4882a593Smuzhiyun special thanks to Eric Youngdale for the free(!) supplying the 204*4882a593Smuzhiyun documentation on the chip. 205