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