aic7xxx_old.txt 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  1. AIC7xxx Driver for Linux
  2. Introduction
  3. ----------------------------
  4. The AIC7xxx SCSI driver adds support for Adaptec (http://www.adaptec.com)
  5. SCSI controllers and chipsets. Major portions of the driver and driver
  6. development are shared between both Linux and FreeBSD. Support for the
  7. AIC-7xxx chipsets have been in the default Linux kernel since approximately
  8. linux-1.1.x and fairly stable since linux-1.2.x, and are also in FreeBSD
  9. 2.1.0 or later.
  10. Supported cards/chipsets
  11. ----------------------------
  12. Adaptec Cards
  13. ----------------------------
  14. AHA-274x
  15. AHA-274xT
  16. AHA-2842
  17. AHA-2910B
  18. AHA-2920C
  19. AHA-2930
  20. AHA-2930U
  21. AHA-2930CU
  22. AHA-2930U2
  23. AHA-2940
  24. AHA-2940W
  25. AHA-2940U
  26. AHA-2940UW
  27. AHA-2940UW-PRO
  28. AHA-2940AU
  29. AHA-2940U2W
  30. AHA-2940U2
  31. AHA-2940U2B
  32. AHA-2940U2BOEM
  33. AHA-2944D
  34. AHA-2944WD
  35. AHA-2944UD
  36. AHA-2944UWD
  37. AHA-2950U2
  38. AHA-2950U2W
  39. AHA-2950U2B
  40. AHA-29160M
  41. AHA-3940
  42. AHA-3940U
  43. AHA-3940W
  44. AHA-3940UW
  45. AHA-3940AUW
  46. AHA-3940U2W
  47. AHA-3950U2B
  48. AHA-3950U2D
  49. AHA-3960D
  50. AHA-39160M
  51. AHA-3985
  52. AHA-3985U
  53. AHA-3985W
  54. AHA-3985UW
  55. Motherboard Chipsets
  56. ----------------------------
  57. AIC-777x
  58. AIC-785x
  59. AIC-786x
  60. AIC-787x
  61. AIC-788x
  62. AIC-789x
  63. AIC-3860
  64. Bus Types
  65. ----------------------------
  66. W - Wide SCSI, SCSI-3, 16bit bus, 68pin connector, will also support
  67. SCSI-1/SCSI-2 50pin devices, transfer rates up to 20MB/s.
  68. U - Ultra SCSI, transfer rates up to 40MB/s.
  69. U2- Ultra 2 SCSI, transfer rates up to 80MB/s.
  70. D - Differential SCSI.
  71. T - Twin Channel SCSI. Up to 14 SCSI devices.
  72. AHA-274x - EISA SCSI controller
  73. AHA-284x - VLB SCSI controller
  74. AHA-29xx - PCI SCSI controller
  75. AHA-394x - PCI controllers with two separate SCSI controllers on-board.
  76. AHA-398x - PCI RAID controllers with three separate SCSI controllers
  77. on-board.
  78. Not Supported Devices
  79. ------------------------------
  80. Adaptec Cards
  81. ----------------------------
  82. AHA-2920 (Only the cards that use the Future Domain chipset are not
  83. supported, any 2920 cards based on Adaptec AIC chipsets,
  84. such as the 2920C, are supported)
  85. AAA-13x Raid Adapters
  86. AAA-113x Raid Port Card
  87. Motherboard Chipsets
  88. ----------------------------
  89. AIC-7810
  90. Bus Types
  91. ----------------------------
  92. R - Raid Port busses are not supported.
  93. The hardware RAID devices sold by Adaptec are *NOT* supported by this
  94. driver (and will people please stop emailing me about them, they are
  95. a totally separate beast from the bare SCSI controllers and this driver
  96. cannot be retrofitted in any sane manner to support the hardware RAID
  97. features on those cards - Doug Ledford).
  98. People
  99. ------------------------------
  100. Justin T Gibbs gibbs@plutotech.com
  101. (BSD Driver Author)
  102. Dan Eischen deischen@iworks.InterWorks.org
  103. (Original Linux Driver Co-maintainer)
  104. Dean Gehnert deang@teleport.com
  105. (Original Linux FTP/patch maintainer)
  106. Jess Johnson jester@frenzy.com
  107. (AIC7xxx FAQ author)
  108. Doug Ledford dledford@redhat.com
  109. (Current Linux aic7xxx-5.x.x Driver/Patch/FTP maintainer)
  110. Special thanks go to John Aycock (aycock@cpsc.ucalgary.ca), the original
  111. author of the driver. John has since retired from the project. Thanks
  112. again for all his work!
  113. Mailing list
  114. ------------------------------
  115. There is a mailing list available for users who want to track development
  116. and converse with other users and developers. This list is for both
  117. FreeBSD and Linux support of the AIC7xxx chipsets.
  118. To subscribe to the AIC7xxx mailing list send mail to the list server,
  119. with "subscribe AIC7xxx" in the body (no Subject: required):
  120. To: majordomo@FreeBSD.ORG
  121. ---
  122. subscribe AIC7xxx
  123. To unsubscribe from the list, send mail to the list server with:
  124. To: majordomo@FreeBSD.ORG
  125. ---
  126. unsubscribe AIC7xxx
  127. Send regular messages and replies to: AIC7xxx@FreeBSD.ORG
  128. Boot Command line options
  129. ------------------------------
  130. "aic7xxx=no_reset" - Eliminate the SCSI bus reset during startup.
  131. Some SCSI devices need the initial reset that this option disables
  132. in order to work. If you have problems at bootup, please make sure
  133. you aren't using this option.
  134. "aic7xxx=reverse_scan" - Certain PCI motherboards scan for devices at
  135. bootup by scanning from the highest numbered PCI device to the
  136. lowest numbered PCI device, others do just the opposite and scan
  137. from lowest to highest numbered PCI device. There is no reliable
  138. way to autodetect this ordering. So, we default to the most common
  139. order, which is lowest to highest. Then, in case your motherboard
  140. scans from highest to lowest, we have this option. If your BIOS
  141. finds the drives on controller A before controller B but the linux
  142. kernel finds your drives on controller B before A, then you should
  143. use this option.
  144. "aic7xxx=extended" - Force the driver to detect extended drive translation
  145. on your controller. This helps those people who have cards without
  146. a SEEPROM make sure that linux and all other operating systems think
  147. the same way about your hard drives.
  148. "aic7xxx=scbram" - Some cards have external SCB RAM that can be used to
  149. give the card more hardware SCB slots. This allows the driver to use
  150. that SCB RAM. Without this option, the driver won't touch the SCB
  151. RAM because it is known to cause problems on a few cards out there
  152. (such as 3985 class cards).
  153. "aic7xxx=irq_trigger:x" - Replace x with either 0 or 1 to force the kernel
  154. to use the correct IRQ type for your card. This only applies to EISA
  155. based controllers. On these controllers, 0 is for Edge triggered
  156. interrupts, and 1 is for Level triggered interrupts. If you aren't
  157. sure or don't know which IRQ trigger type your EISA card uses, then
  158. let the kernel autodetect the trigger type.
  159. "aic7xxx=verbose" - This option can be used in one of two ways. If you
  160. simply specify aic7xxx=verbose, then the kernel will automatically
  161. pick the default set of verbose messages for you to see.
  162. Alternatively, you can specify the command as
  163. "aic7xxx=verbose:0xXXXX" where the X entries are replaced with
  164. hexadecimal digits. This option is a bit field type option. For
  165. a full listing of the available options, search for the
  166. #define VERBOSE_xxxxxx lines in the aic7xxx.c file. If you want
  167. verbose messages, then it is recommended that you simply use the
  168. aic7xxx=verbose variant of this command.
  169. "aic7xxx=pci_parity:x" - This option controls whether or not the driver
  170. enables PCI parity error checking on the PCI bus. By default, this
  171. checking is disabled. To enable the checks, simply specify pci_parity
  172. with no value afterwords. To reverse the parity from even to odd,
  173. supply any number other than 0 or 255. In short:
  174. pci_parity - Even parity checking (even is the normal PCI parity)
  175. pci_parity:x - Where x > 0, Odd parity checking
  176. pci_parity:0 - No check (default)
  177. NOTE: In order to get Even PCI parity checking, you must use the
  178. version of the option that does not include the : and a number at
  179. the end (unless you want to enter exactly 2^32 - 1 as the number).
  180. "aic7xxx=no_probe" - This option will disable the probing for any VLB
  181. based 2842 controllers and any EISA based controllers. This is
  182. needed on certain newer motherboards where the normal EISA I/O ranges
  183. have been claimed by other PCI devices. Probing on those machines
  184. will often result in the machine crashing or spontaneously rebooting
  185. during startup. Examples of machines that need this are the
  186. Dell PowerEdge 6300 machines.
  187. "aic7xxx=seltime:2" - This option controls how long the card waits
  188. during a device selection sequence for the device to respond.
  189. The original SCSI spec says that this "should be" 256ms. This
  190. is generally not required with modern devices. However, some
  191. very old SCSI I devices need the full 256ms. Most modern devices
  192. can run fine with only 64ms. The default for this option is
  193. 64ms. If you need to change this option, then use the following
  194. table to set the proper value in the example above:
  195. 0 - 256ms
  196. 1 - 128ms
  197. 2 - 64ms
  198. 3 - 32ms
  199. "aic7xxx=panic_on_abort" - This option is for debugging and will cause
  200. the driver to panic the linux kernel and freeze the system the first
  201. time the drivers abort or reset routines are called. This is most
  202. helpful when some problem causes infinite reset loops that scroll too
  203. fast to see. By using this option, you can write down what the errors
  204. actually are and send that information to me so it can be fixed.
  205. "aic7xxx=dump_card" - This option will print out the *entire* set of
  206. configuration registers on the card during the init sequence. This
  207. is a debugging aid used to see exactly what state the card is in
  208. when we finally finish our initialization routines. If you don't
  209. have documentation on the chipsets, this will do you absolutely
  210. no good unless you are simply trying to write all the information
  211. down in order to send it to me.
  212. "aic7xxx=dump_sequencer" - This is the same as the above options except
  213. that instead of dumping the register contents on the card, this
  214. option dumps the contents of the sequencer program RAM. This gives
  215. the ability to verify that the instructions downloaded to the
  216. card's sequencer are indeed what they are supposed to be. Again,
  217. unless you have documentation to tell you how to interpret these
  218. numbers, then it is totally useless.
  219. "aic7xxx=override_term:0xffffffff" - This option is used to force the
  220. termination on your SCSI controllers to a particular setting. This
  221. is a bit mask variable that applies for up to 8 aic7xxx SCSI channels.
  222. Each channel gets 4 bits, divided as follows:
  223. bit 3 2 1 0
  224. | | | Enable/Disable Single Ended Low Byte Termination
  225. | | En/Disable Single Ended High Byte Termination
  226. | En/Disable Low Byte LVD Termination
  227. En/Disable High Byte LVD Termination
  228. The upper 2 bits that deal with LVD termination only apply to Ultra2
  229. controllers. Furthermore, due to the current Ultra2 controller
  230. designs, these bits are tied together such that setting either bit
  231. enables both low and high byte LVD termination. It is not possible
  232. to only set high or low byte LVD termination in this manner. This is
  233. an artifact of the BIOS definition on Ultra2 controllers. For other
  234. controllers, the only important bits are the two lowest bits. Setting
  235. the higher bits on non-Ultra2 controllers has no effect. A few
  236. examples of how to use this option:
  237. Enable low and high byte termination on a non-ultra2 controller that
  238. is the first aic7xxx controller (the correct bits are 0011),
  239. aic7xxx=override_term:0x3
  240. Enable all termination on the third aic7xxx controller, high byte
  241. termination on the second aic7xxx controller, and low and high byte
  242. SE termination on the first aic7xxx controller
  243. (bits are 1111 0010 0011),
  244. aic7xxx=override_term:0xf23
  245. No attempt has been made to make this option non-cryptic. It really
  246. shouldn't be used except in dire circumstances, and if that happens,
  247. I'm probably going to be telling you what to set this to anyway :)
  248. "aic7xxx=stpwlev:0xffffffff" - This option is used to control the STPWLEV
  249. bit in the DEVCONFIG PCI register. Currently, this is one of the
  250. very few registers that we have absolutely *no* way of detecting
  251. what the variable should be. It depends entirely on how the chipset
  252. and external terminators were coupled by the card/motherboard maker.
  253. Further, a chip reset (at power up) always sets this bit to 0. If
  254. there is no BIOS to run on the chipset/card (such as with a 2910C
  255. or a motherboard controller with the BIOS totally disabled) then
  256. the variable may not get set properly. Of course, if the proper
  257. setting was 0, then that's what it would be after the reset, but if
  258. the proper setting is actually 1.....you get the picture. Now, since
  259. we can't detect this at all, I've added this option to force the
  260. setting. If you have a BIOS on your controller then you should never
  261. need to use this option. However, if you are having lots of SCSI
  262. reset problems and can't seem to get them knocked out, this may help.
  263. Here's a test to know for certain if you need this option. Make
  264. a boot floppy that you can use to boot your computer up and that
  265. will detect the aic7xxx controller. Next, power down your computer.
  266. While it's down, unplug all SCSI cables from your Adaptec SCSI
  267. controller. Boot the system back up to the Adaptec EZ-SCSI BIOS
  268. and then make sure that termination is enabled on your adapter (if
  269. you have an Adaptec BIOS of course). Next, boot up the floppy you
  270. made and wait for it to detect the aic7xxx controller. If the kernel
  271. finds the controller fine, says scsi : x hosts and then tries to
  272. detect your devices like normal, up to the point where it fails to
  273. mount your root file system and panics, then you're fine. If, on
  274. the other hand, the system goes into an infinite reset loop, then
  275. you need to use this option and/or the previous option to force the
  276. proper termination settings on your controller. If this happens,
  277. then you next need to figure out what your settings should be.
  278. To find the correct settings, power your machine back down, connect
  279. back up the SCSI cables, and boot back into your machine like normal.
  280. However, boot with the aic7xxx=verbose:0x39 option. Record the
  281. initial DEVCONFIG values for each of your aic7xxx controllers as
  282. they are listed, and also record what the machine is detecting as
  283. the proper termination on your controllers. NOTE: the order in
  284. which the initial DEVCONFIG values are printed out is not guaranteed
  285. to be the same order as the SCSI controllers are registered. The
  286. above option and this option both work on the order of the SCSI
  287. controllers as they are registered, so make sure you match the right
  288. DEVCONFIG values with the right controllers if you have more than
  289. one aic7xxx controller.
  290. Once you have the detected termination settings and the initial
  291. DEVCONFIG values for each controller, then figure out what the
  292. termination on each of the controllers *should* be. Hopefully, that
  293. part is correct, but it could possibly be wrong if there is
  294. bogus cable detection logic on your controller or something similar.
  295. If all the controllers have the correct termination settings, then
  296. don't set the aic7xxx=override_term variable at all, leave it alone.
  297. Next, on any controllers that go into an infinite reset loop when
  298. you unplug all the SCSI cables, get the starting DEVCONFIG value.
  299. If the initial DEVCONFIG value is divisible by 2, then the correct
  300. setting for that controller is 0. If it's an odd number, then
  301. the correct setting for that controller is 1. For any other
  302. controllers that didn't have an infinite reset problem, then reverse
  303. the above options. If DEVCONFIG was even, then the correct setting
  304. is 1, if not then the correct setting is 0.
  305. Now that you know what the correct setting was for each controller,
  306. we need to encode that into the aic7xxx=stpwlev:0x... variable.
  307. This variable is a bit field encoded variable. Bit 0 is for the first
  308. aic7xxx controller, bit 1 for the next, etc. Put all these bits
  309. together and you get a number. For example, if the third aic7xxx
  310. needed a 1, but the second and first both needed a 0, then the bits
  311. would be 100 in binary. This then translates to 0x04. You would
  312. therefore set aic7xxx=stpwlev:0x04. This is fairly standard binary
  313. to hexadecimal conversions here. If you aren't up to speed on the
  314. binary->hex conversion then send an email to the aic7xxx mailing
  315. list and someone can help you out.
  316. "aic7xxx=tag_info:{{8,8..},{8,8..},..}" - This option is used to disable
  317. or enable Tagged Command Queueing (TCQ) on specific devices. As of
  318. driver version 5.1.11, TCQ is now either on or off by default
  319. according to the setting you choose during the make config process.
  320. In order to en/disable TCQ for certain devices at boot time, a user
  321. may use this boot param. The driver will then parse this message out
  322. and en/disable the specific device entries that are present based upon
  323. the value given. The param line is parsed in the following manner:
  324. { - first instance indicates the start of this parameter values
  325. second instance is the start of entries for a particular
  326. device entry
  327. } - end the entries for a particular host adapter, or end the entire
  328. set of parameter entries
  329. , - move to next entry. Inside of a set of device entries, this
  330. moves us to the next device on the list. Outside of device
  331. entries, this moves us to the next host adapter
  332. . - Same effect as , but is safe to use with insmod.
  333. x - the number to enter into the array at this position.
  334. 0 = Enable tagged queueing on this device and use the default
  335. queue depth
  336. 1-254 = Enable tagged queueing on this device and use this
  337. number as the queue depth
  338. 255 = Disable tagged queueing on this device.
  339. Note: anything above 32 for an actual queue depth is wasteful
  340. and not recommended.
  341. A few examples of how this can be used:
  342. tag_info:{{8,12,,0,,255,4}}
  343. This line will only effect the first aic7xxx card registered. It
  344. will set scsi id 0 to a queue depth of 8, id 1 to 12, leave id 2
  345. at the default, set id 3 to tagged queueing enabled and use the
  346. default queue depth, id 4 default, id 5 disabled, and id 6 to 4.
  347. Any not specified entries stay at the default value, repeated
  348. commas with no value specified will simply increment to the next id
  349. without changing anything for the missing values.
  350. tag_info:{,,,{,,,255}}
  351. First, second, and third adapters at default values. Fourth
  352. adapter, id 3 is disabled. Notice that leading commas simply
  353. increment what the first number effects, and there are no need
  354. for trailing commas. When you close out an adapter, or the
  355. entire entry, anything not explicitly set stays at the default
  356. value.
  357. A final note on this option. The scanner I used for this isn't
  358. perfect or highly robust. If you mess the line up, the worst that
  359. should happen is that the line will get ignored. If you don't
  360. close out the entire entry with the final bracket, then any other
  361. aic7xxx options after this will get ignored. So, in general, be
  362. sure of what you are entering, and after you have it right, just
  363. add it to the lilo.conf file so there won't be any mistakes. As
  364. a means of checking this parser, the entire tag_info array for
  365. each card is now printed out in the /proc/scsi/aic7xxx/x file. You
  366. can use that to verify that your options were parsed correctly.
  367. Boot command line options may be combined to form the proper set of options
  368. a user might need. For example, the following is valid:
  369. aic7xxx=verbose,extended,irq_trigger:1
  370. The only requirement is that individual options be separated by a comma or
  371. a period on the command line.
  372. Module Loading command options
  373. ------------------------------
  374. When loading the aic7xxx driver as a module, the exact same options are
  375. available to the user. However, the syntax to specify the options changes
  376. slightly. For insmod, you need to wrap the aic7xxx= argument in quotes
  377. and replace all ',' with '.'. So, for example, a valid insmod line
  378. would be:
  379. insmod aic7xxx aic7xxx='verbose.irq_trigger:1.extended'
  380. This line should result in the *exact* same behaviour as if you typed
  381. it in at the lilo prompt and the driver was compiled into the kernel
  382. instead of being a module. The reason for the single quote is so that
  383. the shell won't try to interpret anything in the line, such as {.
  384. Insmod assumes any options starting with a letter instead of a number
  385. is a character string (which is what we want) and by switching all of
  386. the commas to periods, insmod won't interpret this as more than one
  387. string and write junk into our binary image. I consider it a bug in
  388. the insmod program that even if you wrap your string in quotes (quotes
  389. that pass the shell mind you and that insmod sees) it still treats
  390. a comma inside of those quotes as starting a new variable, resulting
  391. in memory scribbles if you don't switch the commas to periods.
  392. Kernel Compile options
  393. ------------------------------
  394. The various kernel compile time options for this driver are now fairly
  395. well documented in the file drivers/scsi/Kconfig. In order to
  396. see this documentation, you need to use one of the advanced configuration
  397. programs (menuconfig and xconfig). If you are using the "make menuconfig"
  398. method of configuring your kernel, then you would simply highlight the
  399. option in question and hit the ? key. If you are using the "make xconfig"
  400. method of configuring your kernel, then simply click on the help button
  401. next to the option you have questions about. The help information from
  402. the Configure.help file will then get automatically displayed.
  403. /proc support
  404. ------------------------------
  405. The /proc support for the AIC7xxx can be found in the /proc/scsi/aic7xxx/
  406. directory. That directory contains a file for each SCSI controller in
  407. the system. Each file presents the current configuration and transfer
  408. statistics (enabled with #define in aic7xxx.c) for each controller.
  409. Thanks to Michael Neuffer for his upper-level SCSI help, and
  410. Matthew Jacob for statistics support.
  411. Debugging the driver
  412. ------------------------------
  413. Should you have problems with this driver, and would like some help in
  414. getting them solved, there are a couple debugging items built into
  415. the driver to facilitate getting the needed information from the system.
  416. In general, I need a complete description of the problem, with as many
  417. logs as possible concerning what happens. To help with this, there is
  418. a command option aic7xxx=panic_on_abort. This option, when set, forces
  419. the driver to panic the kernel on the first SCSI abort issued by the
  420. mid level SCSI code. If your system is going to reset loops and you
  421. can't read the screen, then this is what you need. Not only will it
  422. stop the system, but it also prints out a large amount of state
  423. information in the process. Second, if you specify the option
  424. "aic7xxx=verbose:0x1ffff", the system will print out *SOOOO* much
  425. information as it runs that you won't be able to see anything.
  426. However, this can actually be very useful if your machine simply
  427. locks up when trying to boot, since it will pin-point what was last
  428. happening (in regards to the aic7xxx driver) immediately prior to
  429. the lockup. This is really only useful if your machine simply can
  430. not boot up successfully. If you can get your machine to run, then
  431. this will produce far too much information.
  432. FTP sites
  433. ------------------------------
  434. ftp://ftp.redhat.com/pub/aic/
  435. - Out of date. I used to keep stuff here, but too many people
  436. complained about having a hard time getting into Red Hat's ftp
  437. server. So use the web site below instead.
  438. ftp://ftp.pcnet.com/users/eischen/Linux/
  439. - Dan Eischen's driver distribution area
  440. ftp://ekf2.vsb.cz/pub/linux/kernel/aic7xxx/ftp.teleport.com/
  441. - European Linux mirror of Teleport site
  442. Web sites
  443. ------------------------------
  444. http://people.redhat.com/dledford/
  445. - My web site, also the primary aic7xxx site with several related
  446. pages.
  447. Dean W. Gehnert
  448. deang@teleport.com
  449. $Revision: 3.0 $
  450. Modified by Doug Ledford 1998-2000