3 -=< The IBM Microchannel SCSI-Subsystem >=-
5 for the IBM PS/2 series
7 Low Level Software-Driver for Linux
9 Copyright (c) 1995 Strom Systems, Inc. under the terms of the GNU
10 General Public License. Originally written by Martin Kolinek, December 1995.
11 Officially maintained by Michael Lang since January 1999.
16 Last update: 20 February 1999
19 Authors of this Driver
20 ----------------------
21 - Chris Beauregard (improvement of the SCSI-device mapping by the driver)
22 - Martin Kolinek (origin, first release of this driver)
23 - Klaus Kudielka (multiple SCSI-host management/detection, adaption to
24 Linux Kernel 2.1.x, module support)
25 - Michael Lang (assigning original pun,lun mapping, dynamical ldn
26 assignment, this file, patch, official driver maintenance)
32 2.1 IBM SCSI-Subsystem Detection
33 2.2 Physical Units, Logical Units, and Logical Devices
34 2.3 SCSI-Device Recognition and dynamical ldn Assignment
36 2.5 Regular SCSI-Command-Processing
37 2.6 Abort & Reset Commands
39 2.8 Kernel Boot Option
40 2.9 Driver Module Support
41 2.10 Multiple Hostadapter Support
42 2.11 /proc/scsi-Filesystem Information
43 2.12 /proc/mca-Filesystem Information
44 2.13 Supported IBM SCSI-Subsystems
45 2.14 Linux Kernel Versions
49 5.1 Commandline Parameters
60 This README-file describes the IBM SCSI-subsystem low level driver for
61 Linux. The descriptions which were formerly kept in the source-code have
62 been taken out to this file to easify the codes' readability. The driver
63 description has been updated, as most of the former description was already
64 quite outdated. The history of the driver development is also kept inside
65 here. Multiple historical developments have been summarized to shorten the
66 textsize a bit. At the end of this file you can find a small manual for
67 this driver and hints to get it running even on your machine (hopefully).
71 2.1 IBM SCSI-Subsystem Detection
72 --------------------------------
73 This is done in the ibmmca_detect() function. It first checks, if the
74 Microchannel-bus support is enabled, as the IBM SCSI-subsystem needs the
75 Microchannel. In a next step, a free interrupt is chosen and the main
76 interrupt handler is connected to it to handle answers of the SCSI-
77 subsystem(s). In a further step, it is checked, wether there was a forced
78 detection of the adapter via the kernel commandline, where the I/O port
79 and the SCSI-subsystem id can be specified. The next step checks if there
80 is an integrated SCSI-subsystem installed. This register area is fixed
81 through all IBM PS/2 MCA-machines and appears as something like a virtual
82 slot 10 of the MCA-bus. If POS-register 2 is not 0xff, there must be a SCSI-
83 subsystem present and it will be registered as IBM Integrated SCSI-
84 Subsystem. The next step checks, if there is a slot-adapter installed on
85 the MCA-bus. To get this, the first two POS-registers, that represent the
86 adapter ID are checked. If they fit to one of the ids, stored in the
87 adapter list, a SCSI-subsystem is assumed to be found and will be
88 registered. This check is done through all possible MCA-bus slots to allow
89 more than one SCSI-adapter to be present in the PS/2-system and this is
90 already the first point of problems. Looking into the technical reference
91 manual for the IBM PS/2 common interfaces, the POS2 register must have
92 different interpretation of its single bits. While one can assume, that the
93 integrated subsystem has a fix I/O-address at 0x3540 - 0x3547, further
94 installed IBM SCSI-adapters must use a different I/O-address. This is
95 expressed by bit 1 to 3 of POS2 (multiplied by 8 + 0x3540). Bits 2 and 3
96 are reserved for the integrated subsystem, but not for the adapters! The
97 following list shows, how the bits of POS2 and POS3 should be interpreted.
99 The POS2-register of all PS/2 models' integrated SCSI-subsystems has the
100 following interpretation of bits:
101 Bit 7 - 4 : Chip Revision ID (Release)
103 Bit 1 : 8k NVRAM Disabled
104 Bit 0 : Chip Enable (EN-Signal)
105 The POS3-register is interpreted as follows (for ALL IBM SCSI-subsys.):
107 Bit 4 - 0 : Reserved = 0
108 (taken from "IBM, PS/2 Hardware Interface Technical Reference, Common
110 In short words, this means, that IBM PS/2 machines only support 1 single
111 subsystem by default. But (additional) slot-adapters must have another
112 configuration on pos2 in order to be enabled to use more than one IBM SCSI-
113 subsystem, e.g. for a network server. From tests with the IBM SCSI Adapter
114 w/cache, the POS2-register for slot adapters should be interpreted in the
116 Bit 7 - 4 : Chip Revision ID (Release)
117 Bit 3 - 1 : port offset factor ( * 8 + 0x3540 )
118 Bit 0 : Chip Enable (EN-Signal)
120 One day I found a patch in ibmmca_detect(), forcing the I/O-address to be
121 0x3540 for integrated SCSI-subsystems, there was a remark placed, that on
122 integrated IBM SCSI-subsystems of model 56, the POS2 register was showing 5.
123 This means, that really for these models, POS2 has to be interpreted
124 sticking to the technical reference guide. In this case, the bit 2 (4) is
125 a reserved bit and may not be interpreted. These differences between the
126 adapters and the integrated controllers are taken into account by the
127 detection routine of the driver on from version >3.0g.
129 Every time, a SCSI-subsystem is discovered, the ibmmca_register() function
130 is called. This function checks first, if the requested area for the I/O-
131 address of this SCSI-subsystem is still available and assigns this I/O-
132 area to the SCSI-subsystem. There are always 8 sequential I/O-addresses
133 taken for each individual SCSI-subsystem found, which are:
135 Offset Type Permissions
136 0 Command Interface Register 1 Read/Write
137 1 Command Interface Register 2 Read/Write
138 2 Command Interface Register 3 Read/Write
139 3 Command Interface Register 4 Read/Write
140 4 Attention Register Read/Write
141 5 Basic Control Register Read/Write
142 6 Interrupt Status Register Read
143 7 Basic Status Register Read
145 After the I/O-address range is assigned, the host-adapter is assigned
146 to a local structure which keeps all adapter information needed for the
147 driver itself and the mid- and higher-level SCSI-drivers. The SCSI pun/lun
148 and the adapters' ldn tables are initialized and get probed afterwards by
149 the check_devices() function. If no further adapters are found,
150 ibmmca_detect() quits.
152 2.2 Physical Units, Logical Units, and Logical Devices
153 ------------------------------------------------------
154 There can be up to 56 devices on the SCSI bus (besides the adapter):
155 there are up to 7 "physical units" (each identified by physical unit
156 number or pun, also called the scsi id, this is the number you select
157 with hardware jumpers), and each physical unit can have up to 8
158 "logical units" (each identified by logical unit number, or lun,
161 Typically the adapter has pun=7, so puns of other physical units
162 are between 0 and 6. Almost all physical units have only one
163 logical unit, with lun=0. A CD-ROM jukebox would be an example of
164 a physical unit with more than one logical unit.
166 The embedded microprocessor of the IBM SCSI-subsystem hides the complex
167 two-dimensional (pun,lun) organization from the operating system.
168 When the machine is powered-up (or rebooted), the embedded microprocessor
169 checks, on its own, all 56 possible (pun,lun) combinations, and the first
170 15 devices found are assigned into a one-dimensional array of so-called
171 "logical devices", identified by "logical device numbers" or ldn. The last
172 ldn=15 is reserved for the subsystem itself.
174 2.3 SCSI-Device Recognition and dynamical ldn Assignment
175 --------------------------------------------------------
176 One consequence of information hiding is that the real (pun,lun)
177 numbers are also hidden. The two possibilities to get around this problem
178 is to offer fake pun/lun combinations to the operating system or to
179 delete the whole mapping of the adapter and to reassign the ldns, using
180 the immediate assign command of the SCSI-subsystem. At the beginning of the
181 development of this driver, the following approach was used:
182 First, the driver checked the ldn's (0 to 6) to find out which ldn's
183 have devices assigned. This was done by the functions check_devices() and
184 device_exists(). The interrupt handler has a special paragraph of code
185 (see local_checking_phase_flag) to assist in the checking. Assume, for
186 example, that three logical devices were found assigned at ldn 0, 1, 2.
187 These are presented to the upper layer of Linux SCSI driver
188 as devices with bogus (pun, lun) equal to (0,0), (1,0), (2,0).
189 On the other hand, if the upper layer issues a command to device
190 say (4,0), this driver returns DID_NO_CONNECT error.
192 In a second step of the driver development, the following improvement has
193 been applied: The first approach limited the number of devices to 7, far
194 fewer than the 15 that it could usem then it just maped ldn ->
195 (ldn/8,ldn%8) for pun,lun. We ended up with a real mishmash of puns
196 and luns, but it all seemed to work.
198 The latest development, which is implemented from the driver version 3.0
199 and later, realizes the device recognition in the following way:
200 The physical SCSI-devices on the SCSI-bus are probed via immediate_assign-
201 and device_inquiry-commands, that is all implemented in a completely new
202 made check_devices() subroutine. This delivers a exact map of the physical
203 SCSI-world that is now stored in the get_scsi[][]-array. This means,
204 that the once hidden pun,lun assignment is now known to this driver.
205 It no longer believes in default-settings of the subsystem and maps all
206 ldns to existing pun,lun "by foot". This assures full control of the ldn
207 mapping and allows dynamical remapping of ldns to different pun,lun, if
208 there are more SCSI-devices installed than ldns available (n>15). The
209 ldns from 0 to 6 get 'hardwired' by this driver to puns 0 to 7 at lun=0,
210 excluding the pun of the subsystem. This assures, that at least simple
211 SCSI-installations have optimum access-speed and are not touched by
212 dynamical remapping. The ldns 7 to 14 are put to existing devices with
213 lun>0 or to non-existing devices, in order to satisfy the subsystem, if
214 there are less than 15 SCSI-devices connected. In the case of more than 15
215 devices, the dynamical mapping goes active. If the get_scsi[][] reports a
216 device to be existant, but it has no ldn assigned, it gets a ldn out of 7
217 to 14. The numbers are assigned in cyclic order. Therefore it takes 8
218 dynamical reassignments on the SCSI-devices, until a certain device
219 looses its ldn again. This assures, that dynamical remapping is avoided
220 during intense I/O between up to 15 SCSI-devices (means pun,lun
221 combinations). A further advantage of this method is, that people who
222 build their kernel without probing on all luns will get what they expect,
223 because the driver just won't assign everything with lun>0 when
224 multpile lun probing is inactive.
226 2.4 SCSI-Device Order
227 ---------------------
228 Because of the now correct recognition of physical pun,lun, and
229 their report to mid-level- and higher-level-drivers, the new reported puns
230 can be different from the old, faked puns. Therefore, Linux will eventually
231 change /dev/sdXXX assignments and prompt you for corrupted superblock
232 repair on boottime. In this case DO NOT PANIC, YOUR DISKS ARE STILL OK!!!
233 You have to reboot (CTRL-D) with a old kernel and set the /etc/fstab-file
234 entries right. After that, the system should come up as errorfree as before.
235 If your boot-partition is not coming up, also edit the /etc/lilo.conf-file
236 in a Linux session booted on old kernel and run lilo before reboot. Check
237 lilo.conf anyway to get boot on other partitions with foreign OSes right
238 again. But there exists a feature of this driver that allows you to change
239 the assignment order of the SCSI-devices by flipping the PUN-assignment.
240 See the next paragraph for a description.
242 The problem for this is, that Linux does not assign the SCSI-devices in the
243 way as described in the ANSI-SCSI-standard. Linux assigns /dev/sda to
244 the device with at minimum id 0. But the first drive should be at id 6,
245 because for historical reasons, drive at id 6 has, by hardware, the highest
246 priority and a drive at id 0 the lowest. IBM was one of the rare producers,
247 where the BIOS assigns drives belonging to the ANSI-SCSI-standard. Most
248 other producers' BIOS does not (I think even Adaptec-BIOS). The
249 IBMMCA_SCSI_ORDER_STANDARD flag, which you set while configuring the
250 kernel enables to choose the preferred way of SCSI-device-assignment.
251 Defining this flag would result in Linux determining the devices in the
252 same order as DOS and OS/2 does on your MCA-machine. This is also standard
253 on most industrial computers and OSes, like e.g. OS-9. Leaving this flag
254 undefined will get your devices ordered in the default way of Linux. See
255 also the remarks of Chris Beauregard from Dec 15, 1997 and the followups
258 2.5 Regular SCSI-Command-Processing
259 -----------------------------------
260 Only three functions get involved: ibmmca_queuecommand(), issue_cmd(),
261 and interrupt_handler().
263 The upper layer issues a scsi command by calling function
264 ibmmca_queuecommand(). This function fills a "subsystem control block"
265 (scb) and calls a local function issue_cmd(), which writes a scb
266 command into subsystem I/O ports. Once the scb command is carried out,
267 the interrupt_handler() is invoked. If a device is determined to be
268 existant and it has not assigned any ldn, it gets one dynamically.
269 For this, the whole stuff is done in ibmmca_queuecommand().
271 2.6 Abort & Reset Commands
272 --------------------------
273 These are implemented with busy waiting for interrupt to arrive.
274 ibmmca_reset() and ibmmca_abort() do not work sufficently well
275 up to now and need still a lot of development work. But, this seems
276 to be even a problem with other SCSI-low level drivers, too. However,
277 this should be no excuse.
281 The ibmmca_biosparams() function should return the same disk geometry
282 as the bios. This is needed for fdisk, etc. The returned geometry is
283 certainly correct for disks smaller than 1 gigabyte. In the meantime,
284 it has been proved, that this works fine even with disks larger than
287 2.8 Kernel Boot Option
288 ----------------------
289 The function ibmmca_scsi_setup() is called if option ibmmcascsi=n
290 is passed to the kernel. See file linux/init/main.c for details.
292 2.9 Driver Module Support
293 -------------------------
294 Is implemented and tested by K. Kudielka. This could probably not work
297 2.10 Multiple Hostadapter Support
298 ---------------------------------
299 This driver supports up to eight interfaces of type IBM-SCSI-Subsystem.
300 Integrated-, and MCA-adapters are automatically recognized. Unrecognizable
301 IBM-SCSI-Subsystem interfaces can be specified as kernel-parameters.
303 2.11 /proc/scsi-Filesystem Information
304 --------------------------------------
305 Information about the driver condition is given in
306 /proc/scsi/ibmmca/<host_no>. ibmmca_proc_info() provides this information.
308 This table is quite informative for interested users. It shows the load
309 of commands on the subsystem and wether you are running the bypassed
310 (software) or integrated (hardware) SCSI-command set (see below). The
311 amount of accesses is shown. Read, write, modeselect is shown seperately
312 in order to help debugging problems with CD-ROMs or tapedrives.
314 The following table shows the list of 15 logical device numbers, that are
315 used by the SCSI-subsystem. The load on each ldn is shown in the table,
316 again, read and write commands are split. The last column shows the amount
317 of reassignments, that have been applied to the ldns, if you have more than
318 15 pun/lun combinations available on the SCSI-bus.
320 The last two tables show the pun/lun map and the positions of the ldns
321 on this pun/lun map. This may change during operation, when a ldn is
322 reassigned to another pun/lun combination. If the necessity for dynamical
323 assignments is set to 'no', the ldn structure keeps static.
325 2.12 /proc/mca-Filesystem Information
326 -------------------------------------
327 The slot-file contains all default entries and in addition chip and I/O-
328 address information of the SCSI-subsystem. This information is provided
331 2.13 Supported IBM SCSI-Subsystems
332 ----------------------------------
333 The following IBM SCSI-subsystems are supported by this driver:
335 - IBM Fast SCSI-2 Adapter
336 - IBM 7568 Industrial Computer SCSI Adapter w/cache
337 - IBM Expansion Unit SCSI Controller
338 - IBM SCSI Adapter w/Cache
340 - IBM Integrated SCSI Controller
342 2.14 Linux Kernel Versions
343 --------------------------
344 The IBM SCSI-subsystem low level driver is prepared to be used with
345 all versions of Linux between 2.0.x and 2.2.x. The compatibility checks
346 are fully implemented up from version 3.1e of the driver. This means, that
347 you just need the latest ibmmca.h and ibmmca.c file and copy it in the
348 linux/drivers/scsi directory. The code is automatically adapted during
353 Jan 15 1996: First public release.
356 Jan 23 1996: Scrapped code which reassigned scsi devices to logical
357 device numbers. Instead, the existing assignment (created
358 when the machine is powered-up or rebooted) is used.
359 A side effect is that the upper layer of Linux SCSI
360 device driver gets bogus scsi ids (this is benign),
361 and also the hard disks are ordered under Linux the
362 same way as they are under dos (i.e., C: disk is sda,
363 D: disk is sdb, etc.).
366 I think that the CD-ROM is now detected only if a CD is
367 inside CD_ROM while Linux boots. This can be fixed later,
368 once the driver works on all types of PS/2's.
371 Feb 7 1996: Modified biosparam function. Fixed the CD-ROM detection.
372 For now, devices other than harddisk and CD_ROM are
373 ignored. Temporarily modified abort() function
374 to behave like reset().
377 Mar 31 1996: The integrated scsi subsystem is correctly found
378 in PS/2 models 56,57, but not in model 76. Therefore
379 the ibmmca_scsi_setup() function has been added today.
380 This function allows the user to force detection of
381 scsi subsystem. The kernel option has format
383 where n is the scsi_id (pun) of the subsystem. Most likely, n is 7.
386 Aug 21 1996: Modified the code which maps ldns to (pun,0). It was
387 insufficient for those of us with CD-ROM changers.
390 Dec 14 1996: More improvements to the ldn mapping. See check_devices
391 for details. Did more fiddling with the integrated SCSI detection,
392 but I think it's ultimately hopeless without actually testing the
393 model of the machine. The 56, 57, 76 and 95 (ultimedia) all have
394 different integrated SCSI register configurations. However, the 56
395 and 57 are the only ones that have problems with forced detection.
398 Mar 8-16 1997: Modified driver to run as a module and to support
399 multiple adapters. A structure, called ibmmca_hostdata, is now
400 present, containing all the variables, that were once only
401 available for one single adapter. The find_subsystem-routine has vanished.
402 The hardware recognition is now done in ibmmca_detect directly.
403 This routine checks for presence of MCA-bus, checks the interrupt
404 level and continues with checking the installed hardware.
405 Certain PS/2-models do not recognize a SCSI-subsystem automatically.
406 Hence, the setup defined by command-line-parameters is checked first.
407 Thereafter, the routine probes for an integrated SCSI-subsystem.
408 Finally, adapters are checked. This method has the advantage to cover all
409 possible combinations of multiple SCSI-subsystems on one MCA-board. Up to
410 eight SCSI-subsystems can be recognized and announced to the upper-level
411 drivers with this improvement. A set of defines made changes to other
412 routines as small as possible.
416 1) SCSI-command capability enlarged by the recognition of MODE_SELECT.
417 This needs the RD-Bit to be disabled on IM_OTHER_SCSI_CMD_CMD which
418 allows data to be written from the system to the device. It is a
419 necessary step to be allowed to set blocksize of SCSI-tape-drives and
420 the tape-speed, whithout confusing the SCSI-Subsystem.
421 2) The recognition of a tape is included in the check_devices routine.
422 This is done by checking for TYPE_TAPE, that is already defined in
423 the kernel-scsi-environment. The markup of a tape is done in the
424 global ldn_is_tape[] array. If the entry on index ldn
425 is 1, there is a tapedrive connected.
426 3) The ldn_is_tape[] array is necessary to distinguish between tape- and
427 other devices. Fixed blocklength devices should not cause a problem
428 with the SCB-command for read and write in the ibmmca_queuecommand
429 subroutine. Therefore, I only derivate the READ_XX, WRITE_XX for
430 the tape-devices, as recommended by IBM in this Technical Reference,
431 mentioned below. (IBM recommends to avoid using the read/write of the
432 subsystem, but the fact was, that read/write causes a command error from
433 the subsystem and this causes kernel-panic.)
434 4) In addition, I propose to use the ldn instead of a fix char for the
435 display of PS2_DISK_LED_ON(). On 95, one can distinguish between the
436 devices that are accessed. It shows activity and easyfies debugging.
437 The tape-support has been tested with a SONY SDT-5200 and a HP DDS-2
438 (I do not know yet the type). Optimization and CD-ROM audio-support,
442 June 19 1997: (v1.6b)
443 1) Submitting the extra-array ldn_is_tape[] -> to the local ld[]
445 2) CD-ROM Audio-Play seems to work now.
446 3) When using DDS-2 (120M) DAT-Tapes, mtst shows still density-code
447 0x13 for ordinary DDS (61000 BPM) instead 0x24 for DDS-2. This appears
448 also on Adaptec 2940 adaptor in a PCI-System. Therefore, I assume that
449 the problem is independent of the low-level-driver/bus-architecture.
450 4) Hexadecimal ldn on PS/2-95 LED-display.
451 5) Fixing of the PS/2-LED on/off that it works right with tapedrives and
452 does not confuse the disk_rw_in_progress counter.
455 June 21 1997: (v1.7b)
456 1) Adding of a proc_info routine to inform in /proc/scsi/ibmmca/<host> the
457 outer-world about operational load statistics on the different ldns,
458 seen by the driver. Everybody that has more than one IBM-SCSI should
459 test this, because I only have one and cannot see what happens with more
460 than one IBM-SCSI hosts.
461 2) Definition of a driver version-number to have a better recognition of
462 the source when there are existing too much releases that may confuse
463 the user, when reading about release-specific problems. Up to know,
464 I calculated the version-number to be 1.7. Because we are in BETA-test
465 yet, it is today 1.7b.
466 3) Sorry for the heavy bug I programmed on June 19 1997! After that, the
467 CD-ROM did not work any more! The C7-command was a fake impression
468 I got while programming. Now, the READ and WRITE commands for CD-ROM are
469 no longer running over the subsystem, but just over
470 IM_OTHER_SCSI_CMD_CMD. On my observations (PS/2-95), now CD-ROM mounts
471 much faster(!) and hopefully all fancy multimedia-functions, like direct
472 digital recording from audio-CDs also work. (I tried it with cdda2wav
473 from the cdwtools-package and it filled up the harddisk immediately :-).)
474 To easify boolean logics, a further local device-type in ld[], called
475 is_cdrom has been included.
476 4) If one uses a SCSI-device of unsupported type/commands, one
477 immediately runs into a kernel-panic caused by Command Error. To better
478 understand which SCSI-command caused the problem, I extended this
479 specific panic-message slightly.
482 June 25 1997: (v1.8b)
483 1) Some cosmetical changes for the handling of SCSI-device-types.
484 Now, also CD-Burners / WORMs and SCSI-scanners should work. For
485 MO-drives I have no experience, therefore not yet supported.
486 In logical_devices I changed from different type-variables to one
487 called 'device_type' where the values, corresponding to scsi.h,
488 of a SCSI-device are stored.
489 2) There existed a small bug, that maps a device, coming after a SCSI-tape
490 wrong. Therefore, e.g. a CD-ROM changer would have been mapped wrong
492 3) Extension of the logical_device structure. Now it contains also device,
493 vendor and revision-level of a SCSI-device for internal usage.
496 June 26-29 1997: (v2.0b)
497 1) The release number 2.0b is necessary because of the completely new done
498 recognition and handling of SCSI-devices with the adapter. As I got
499 from Chris the hint, that the subsystem can reassign ldns dynamically,
500 I remembered this immediate_assign-command, I found once in the handbook.
501 Now, the driver first kills all ldn assignments that are set by default
502 on the SCSI-subsystem. After that, it probes on all puns and luns for
503 devices by going through all combinations with immediate_assign and
504 probing for devices, using device_inquiry. The found physical(!) pun,lun
505 structure is stored in get_scsi[][] as device types. This is followed
506 by the assignment of all ldns to existing SCSI-devices. If more ldns
507 than devices are available, they are assigned to non existing pun,lun
508 combinations to satisfy the adapter. With this, the dynamical mapping
509 was possible to implement. (For further info see the text in the
510 source-code and in the description below. Read the description
511 below BEFORE installing this driver on your system!)
512 2) Changed the name IBMMCA_DRIVER_VERSION to IBMMCA_SCSI_DRIVER_VERSION.
513 3) The LED-display shows on PS/2-95 no longer the ldn, but the SCSI-ID
514 (pun) of the accessed SCSI-device. This is now senseful, because the
515 pun known within the driver is exactly the pun of the physical device
516 and no longer a fake one.
517 4) The /proc/scsi/ibmmca/<host_no> consists now of the first part, where
518 hit-statistics of ldns is shown and a second part, where the maps of
519 physical and logical SCSI-devices are displayed. This could be very
520 interesting, when one is using more than 15 SCSI-devices in order to
521 follow the dynamical remapping of ldns.
524 June 26-29 1997: (v2.0b-1)
525 1) I forgot to switch the local_checking_phase_flag to 1 and back to 0
526 in the dynamical remapping part in ibmmca_queuecommand for the
527 device_exist routine. Sorry.
530 July 1-13 1997: (v3.0b,c)
531 1) Merging of the driver-developments of Klaus Kudielka and Michael Lang
532 in order to get a optimum and unified driver-release for the
533 IBM-SCSI-Subsystem-Adapter(s).
534 For people, using the Kernel-release >=2.1.0, module-support should
535 be no problem. For users, running under <2.1.0, module-support may not
536 work, because the methods have changed between 2.0.x and 2.1.x.
537 2) Added some more effective statistics for /proc-output.
538 3) Change typecasting at necessary points from (unsigned long) to
540 4) Included #if... at special points to have specific adaption of the
541 driver to kernel 2.0.x and 2.1.x. It should therefore also run with
543 5) Magneto-Optical drives and medium-changers are also recognized, now.
544 Therefore, we have a completely gapfree recognition of all SCSI-
545 device-types, that are known by Linux up to kernel 2.1.31.
546 6) The flag SCSI_IBMMCA_DEV_RESET has been inserted. If it is set within
547 the configuration, each connected SCSI-device will get a reset command
548 during boottime. This can be necessary for some special SCSI-devices.
549 This flag should be included in Config.in.
550 (See also the new Config.in file.)
551 Probable next improvement: bad disk handler.
554 Sept 14 1997: (v3.0c)
555 1) Some debugging and speed optimization applied.
559 - chrisb@truespectra.com
560 - made the front panel display thingy optional, specified from the
561 command-line via ibmmcascsi=display. Along the lines of the /LED
562 option for the OS/2 driver.
563 - fixed small bug in the LED display that would hang some machines.
564 - reversed ordering of the drives (using the
565 IBMMCA_SCSI_ORDER_STANDARD define). This is necessary for two main
567 - users who've already installed Linux won't be screwed. Keep
568 in mind that not everyone is a kernel hacker.
569 - be consistent with the BIOS ordering of the drives. In the
570 BIOS, id 6 is C:, id 0 might be D:. With this scheme, they'd be
571 backwards. This confuses the crap out of those heathens who've
572 got a impure Linux installation (which, <wince>, I'm one of).
573 This whole problem arises because IBM is actually non-standard with
574 the id to BIOS mappings. You'll find, in fdomain.c, a similar
575 comment about a few FD BIOS revisions. The Linux (and apparently
576 industry) standard is that C: maps to scsi id (0,0). Let's stick
578 - Since this is technically a branch of my own, I changed the
579 version number to 3.0e-cpb.
581 Jan 17, 1998: (v3.0f)
582 1) Addition of some statistical info for /proc in proc_info.
583 2) Taking care of the SCSI-assignment problem, dealed by Chris at Dec 15
584 1997. In fact, IBM is right, concerning the assignment of SCSI-devices
585 to driveletters. It is conform to the ANSI-definition of the SCSI-
586 standard to assign drive C: to SCSI-id 6, because it is the highest
587 hardware priority after the hostadapter (that has still today by
588 default everywhere id 7). Also realtime-operating systems that I use,
589 like LynxOS and OS9, which are quite industrial systems use top-down
590 numbering of the harddisks, that is also starting at id 6. Now, one
591 sits a bit between two chairs. On one hand side, using the define
592 IBMMCA_SCSI_ORDER_STANDARD makes Linux assigning disks conform to
593 the IBM- and ANSI-SCSI-standard and keeps this driver downward
594 compatible to older releases, on the other hand side, people is quite
595 habituated in believing that C: is assigned to (0,0) and much other
596 SCSI-BIOS do so. Therefore, I moved the IBMMCA_SCSI_ORDER_STANDARD
597 define out of the driver and put it into Config.in as subitem of
598 'IBM SCSI support'. A help, added to Documentation/Configure.help
599 explains the differences between saying 'y' or 'n' to the user, when
600 IBMMCA_SCSI_ORDER_STANDARD prompts, so the ordinary user is enabled to
601 choose the way of assignment, depending on his own situation and gusto.
602 3) Adapted SCSI_IBMMCA_DEV_RESET to the local naming convention, so it is
603 now called IBMMCA_SCSI_DEV_RESET.
604 4) Optimization of proc_info and its subroutines.
605 5) Added more in-source-comments and extended the driver description by
606 some explanation about the SCSI-device-assignment problem.
609 Jan 18, 1998: (v3.0g)
610 1) Correcting names to be absolutely conform to the later 2.1.x releases.
611 This is necessary for
612 IBMMCA_SCSI_DEV_RESET -> CONFIG_IBMMCA_SCSI_DEV_RESET
613 IBMMCA_SCSI_ORDER_STANDARD -> CONFIG_IBMMCA_SCSI_ORDER_STANDARD
616 Jan 18, 1999: (v3.1 MCA-team internal)
617 1) The multiple hosts structure is accessed from every subroutine, so there
618 is no longer the address of the device structure passed from function
619 to function, but only the hostindex. A call by value, nothing more. This
620 should really be understood by the compiler and the subsystem should get
621 the right values and addresses.
622 2) The SCSI-subsystem detection was not complete and quite hugely buggy up
623 to now, compared to the technical manual. The interpretation of the pos2
624 register is not as assumed by people before, therefore, I dropped a note
625 in the ibmmca_detect function to show the registers' interpretation.
626 The pos-registers of integrated SCSI-subsystems do not contain any
627 information concerning the IO-port offset, really. Instead, they contain
628 some info about the adapter, the chip, the NVRAM .... The I/O-port is
629 fixed to 0x3540 - 0x3547. There can be more than one adapters in the
630 slots and they get an offset for the I/O area in order to get their own
631 I/O-address area. See chapter 2 for detailed description. At least, the
632 detection should now work right, even on models other than 95. The 95ers
633 came happily around the bug, as their pos2 register contains always 0
634 in the critical area. Reserved bits are not allowed to be interpreted,
635 therefore, IBM is allowed to set those bits as they like and they may
636 really vary between different PS/2 models. So, now, no interpretation
637 of reserved bits - hopefully no trouble here anymore.
638 3) The command error, which you may get on models 55, 56, 57, 70, 77 and
639 P70 may have been caused by the fact, that adapters of older design do
640 not like sending commands to non-existing SCSI-devices and will react
641 with a command error as a sign of protest. While this error is not
642 present on IBM SCSI Adapter w/cache, it appears on IBM Integrated SCSI
643 Adapters. Therefore, I implemented a workarround to forgive those
644 adapters their protests, but it is marked up in the statisctis, so
645 after a successful boot, you can see in /proc/scsi/ibmmca/<host_number>
646 how often the command errors have been forgiven to the SCSI-subsystem.
647 If the number is bigger than 0, you have a SCSI subsystem of older
648 design, what should no longer matter.
649 4) ibmmca_getinfo() has been adapted very carefully, so it shows in the
650 slotn file really, what is senseful to be presented.
651 5) ibmmca_register() has been extended in its parameter list in order to
652 pass the right name of the SCSI-adapter to Linux.
656 1) Finally, after some 3.1Beta-releases, the 3.1 release. Sorry, for
657 the delayed release, but it was not finished with the release of
662 1) Added a new commandline parameter called 'bypass' in order to bypass
663 every integrated subsystem SCSI-command consequently in case of
665 2) Concatenated read_capacity requests to the harddisks. It gave a lot
666 of troubles with some controllers and after I wanted to apply some
667 extensions, it jumped out in the same situation, on my w/cache, as like
668 on D. Weinehalls' Model 56, having integrated SCSI. This gave me the
669 descissive hint to move the code-part out and declare it global. Now,
670 it seems to work by far much better an more stable. Let us see, what
671 the world thinks of it...
672 3) By the way, only Sony DAT-drives seem to show density code 0x13. A
673 test with a HP drive gave right results, so the problem is vendor-
674 specific and not a problem of the OS or the driver.
678 1) The abort command and the reset function have been checked for
679 inconsistencies. From the logical point of thinking, they work
680 at their optimum, now, but as the subsystem does not answer with an
681 interrupt, abort never finishes, sigh...
682 2) Everything, that is accessed by a busmaster request from the adapter
683 is now declared as global variable, even the return-buffer in the
684 local checking phase. This assures, that no accesses to undefined memory
686 3) In ibmmca.h, the line unchecked_isa_dma is added with 1 in order to
687 avoid memory-pointers for the areas higher than 16MByte in order to
688 be sure, it also works on 16-Bit Microchannel bus systems.
689 4) A lot of small things have been found, but nothing that endangered the
690 driver operations. Just it should be more stable, now.
694 1) I took the warning from the Linux Kernel Hackers Guide serious and
695 checked the cmd->result return value to the done-function very carefuly.
696 It is obvious, that the IBM SCSI only delivers the tsb.dev_status, if
697 some error appeared, else it is undefined. Now, this is fixed. Before
698 any SCB command gets queued, the tsb.dev_status is set to 0, so the
699 cmd->result won't screw up Linux higher level drivers.
700 2) The reset-function has slightly improved. This is still planed for
701 abort. During the abort and the reset function, no interrupts are
702 allowed. This is however quite hard to cope with, so the INT-status
703 register is read. When the interrupt gets queued, one can find its
704 status immediately on that register and is enabled to continue in the
705 reset function. I had no chance to test this really, only in a bogus
706 situation, I got this function running, but the situation was too much
707 worse for Linux :-(, so tests will continue.
708 3) Buffers got now consistent. No open address mapping, as before and
709 therefore no further troubles with the unassigned memory segmentation
710 faults that scrambled probes on 95XX series and even on 85XX series,
711 when the kernel is done in a not so perfectly fitting way.
712 4) Spontaneous interrupts from the subsystem, appearing without any
713 command previously queued are answered with a DID_BAD_INTR result.
714 5) Taken into account ZP Gus' proposals to reverse the SCSI-device
715 scan order. As it does not work on Kernel 2.1.x or 2.2.x, as proposed
716 by him, I implemented it in a slightly derived way, which offers in
717 addition more flexibility.
722 - It seems that the handling of bad disks is really bad -
723 non-existent, in fact.
724 - More testing of the full driver-controlled dynamical ldn
725 (re)mapping for up to 56 SCSI-devices.
726 - Support more of the SCSI-command set.
727 - Support some of the caching abilities, particularly Read Prefetch.
728 This fetches data into the cache, which later gets hit by the
729 regular Read Data. (<--- This is coming soon!!!!)
730 - Abort and Reset functions still slightly buggy or better say,
731 it is the new episode, called SCREAM III.
735 5.1 Commandline Parameters
736 --------------------------
737 There exist several features for the IBM SCSI-subsystem driver.
738 The commandline parameter format is:
740 ibmmcascsi=<command1>,<command2>,<command3>,...
742 where commandN can be one of the following:
744 display Owners of a model 95 or other PS/2 systems with an
745 alphanumeric LED display may set this to have their
746 display showing the following output of the 8 digits:
750 where '-' stays dark, 'D' shows the SCSI-device id
751 and 'A' shows the SCSI hostindex, beeing currently
753 adisplay This works like display, but gives more optical overview
754 of the activities on the SCSI-bus. The display will have
755 the following output:
759 where the numbers 0 to 6 light up at the shown position,
760 when the SCSI-device is accessed. A shows again the SCSI
761 hostindex. If display nor adisplay is set, the internal
762 PS/2 harddisk LED is used for media-activities. So, if
763 you really do not have a system with a LED-display, you
764 should not set display or adisplay.
765 bypass This commandline parameter forces the driver never to use
766 SCSI-subsystems' integrated SCSI-command set. Except of
767 the immediate assign, which is of vital importance for
768 every IBM SCSI-subsystem to set its ldns right. Instead,
769 the ordinary ANSI-SCSI-commands are used and passed by the
770 controller to the SCSI-devices, therefore 'bypass'. The
771 effort, done by the subsystem is quite bogus and at a
772 minimum and therefore it should work everywhere. This
773 could maybe solve troubles with old or integrated SCSI-
774 controllers and nasty harddisks. Keep in mind, that using
775 this flag will slow-down SCSI-accesses slightly, as the
776 software generated commands are always slower than the
777 hardware. Non-harddisk devices always get read/write-
778 commands in bypass mode.
779 normal This is the parameter, introduced on the 2.0.x development
780 rail by ZP Gu. This parameter defines the SCSI-device
781 scan order in the new industry standard. This means, that
782 the first SCSI-device is the one with the lowest pun.
783 E.g. harddisk at pun=0 is scanned before harddisk at
784 pun=6, which means, that harddisk at pun=0 gets sda
785 and the one at pun=6 gets sdb.
786 ansi The ANSI-standard for the right scan order, as done by
787 IBM, Microware and Microsoft, scans SCSI-devices starting
788 at the highest pun, which means, that e.g. harddisk at
789 pun=6 gets sda and a harddisk at pun=0 gets sdb. If you
790 like to have the same SCSI-device order, as in DOS, OS-9
791 or OS/2, just use this parameter.
793 A further option is that you can force the SCSI-driver to accept a SCSI-
794 subsystem at a certain I/O-address with a predefined adapter PUN. This
798 commandN+1 = adapter PUN
800 e.g. ibmmcascsi=0x3540,7 will force the driver to detect a SCSI-subsystem
801 at I/O-address 0x3540 with adapter PUN 7.
805 ibmmcascsi=adisplay,bypass
807 This will use the advanced display mode for the model 95 LED display and
808 every SCSI-command passed to a attached device will get bypassed in order
809 not to use any of the subsystem built-in commands.
811 ibmmcascsi=display,0x3558,7
813 This will activate the default display mode for the model 95 LED display
814 and will force the driver to accept a SCSI-subsystem at I/O-base 0x3558
819 The following FAQs should help you to solve some major problems with this
822 Q: "Reset SCSI-devices at boottime" halts the system at boottime, why?
823 A: This is only tested with the IBM SCSI Adapter w/cache. It is not
824 yet prooved to run on other adapters, however you may be lucky.
825 In version 3.1d this has been hugely improved and should work better,
826 now. Normally you really won't need to activate this flag in the
827 kernel configuration, as all post 1989 SCSI-devices should accept
828 the reset-signal, when the computer is switched on. The SCSI-
829 subsystem generates this reset while beeing initialized. This flag
830 is really reserved for users with very old, very strange or self-made
832 Q: Why is the SCSI-order of my drives mirrored to the device-order
833 seen from OS/2 or DOS ?
834 A: It depends on the operating system, if it looks at the devices in
835 ANSI-SCSI-standard (starting from pun 6 and going down to pun 0) or
836 if it just starts at pun 0 and counts up. If you want to be conform
837 with OS/2 and DOS, you have to activate this flag in the kernel
838 configuration or you should set 'ansi' as parameter for the kernel.
839 The parameter 'normal' sets the new industry standard, starting
840 from pun 0, scaning up to pun 6. This allows you to change your
841 opinion still after having already compiled the kernel.
842 Q: Why can I not find the IBM MCA SCSI support in the config menue?
843 A: You have to activate MCA bus support, first.
844 Q: Where can I find the latest info about this driver?
845 A: See the file MAINTAINERS for the current WWW-address, which offers
846 updates, info and Q/A lists. At this files' origin, the webaddress
847 was: http://www.uni-mainz.de/~langm000/linux.html
848 Q: My SCSI-adapter is not recognized by the driver, what can I do?
849 A: Just force it to be recognized by kernel parameters. See section 5.1.
850 Q: The driver screws up, if it starts to probe SCSI-devices, is there
852 A: This is based on some problems with the driver. In such cases, send
853 e-mail to the maintainer. If you are owner of a model with the serial
854 number 95XX, just send as subject NOTIFY 95XX PROBLEM and the
855 maintainer immediately knows about your problem. But please:
856 Check your hardware and only if it works fine with other operating
857 systems, send E-Mail to me to notify the troubles. See the homepage
858 for how to send bug-reports or please read the next Q/A, here:
859 Q: I get a message: panic IBM MCA SCSI: command error .... , what can
861 A: Previously, I followed the way by ignoring command errors by using
862 ibmmcascsi=forgiveall, but this command no longer exists and is
863 obsolete. If such a problem appears, it is caused by some segmentation
864 fault of the driver, which maps to some unallowed area. The latest
865 version of the driver should be ok, as most bugs have been solved.
866 Q: There are still kernel panics, even after having set
867 ibmmcascsi=forgiveall. Are there other possibilities to prevent
869 A: No, get just the latest release of the driver and it should work
870 better and better with increasing version number. Forget this
871 ibmmcascsi=forgiveall, as also ignorecmd are obsolete.
872 Q: Linux panics or stops without any comment, but it is probable, that my
873 harddisk(s) have bad blocks.
874 A: Sorry, the bad-block handling is still a feeble point of this driver,
875 but is on the schedule for development in the near future.
876 Q: Linux panics while dynamically assigning SCSI-ids or ldns.
877 A: If you disconnect a SCSI-device from the machine, while Linux is up
878 and the driver uses dynamical reassignment of logical device numbers
879 (ldn), it really gets "angry" if it won't find devices, that were still
880 present at boottime and stops Linux.
881 Q: The system does not recover after an abort-command has been generated.
882 A: This is regrettably true, as it is not yet understood, why the
883 SCSI-adapter does really NOT generate any interrupt at the end of
884 the abort-command. As no interrupt is generated, the abort command
885 cannot get finished and the system hangs, sorry, but checks are
886 running to hunt down this problem. If there is a real pending command,
887 the interrupt MUST get generated after abort. In this case, it
889 Q: The system gets in bad shape after a SCSI-reset, is this known?
890 A: Yes, as there are a lot of prescriptions (see the Linux Hackers'
891 Guide) what has to be done for reset, we still share the bad shape of
892 the reset functions with all other low level SCSI-drivers.
893 Astonishingly, reset works in most cases quite ok, but the harddisks
894 won't run in synchonous mode anymore after a reset, until you reboot.
895 Q: Why does my XXX w/Cache adapter not use read-prefetch?
896 A: w/Cache technical manuals are incoming here, so if I understood the
897 command of read-prefetch, it should be an easy thing to get harddisks
898 read in read-prefetch with w/Cache controllers. Some weeks or months,
899 still ahead and a lot of work still to do, sigh ...
903 If you really find bugs in the sourcecode or the driver will successfully
904 refuse to work on your machine, you should send a bug report to me. The
905 best for this is to follow the instructions on the WWW-page for this
906 driver. Fill out the bug-report form, placed on the WWW-page and ship it,
907 so the bugs can be taken into account with maximum efforts. But, please
908 do not send bug reports about this driver to Linus Torvalds or Leonard
909 Zubkoff, as Linus is burried in E-Mail and Leonard is supervising all
910 SCSI-drivers and won't have the time left to look inside every single
911 driver to fix a bug and especially DO NOT send modified code to Linus
912 Torvalds, which has not been checked here!!! Recently, I got a lot of
913 bugreports for errors in the ibmmca.c code, which I could not imagine, but
914 a look inside some Linux-distribution showed me quite often some modified
915 code, which did no longer work on most other machines than the one of the
916 modifier. Ok, so now that there is maintenance service available for this
917 driver, please use this address first in order to keep the level of
918 confusion low. Thank you!
920 When you get a SCSI-error message that panics your system, a list of
921 register-entries of the SCSI-subsystem is shown (from Version 3.1d). With
922 this list, it is very easy for the maintainer to localize the problem in
923 the driver or in the configuration of the user. Please write down all the
924 values from this report and send them to the maintainer. This would really
925 help a lot and makes life easier concerning misunderstandings.
927 Use the bug-report form (see 5.4 for its address) to send all the bug-
928 stuff to the maintainer or write e-mail with the values from the table.
932 The address of the IBM SCSI-subsystem supporting WWW-page is:
934 http://www.uni-mainz.de/~langm000/linux.html
936 Here you can find info about the background of this driver, patches,
937 news and a bugreport form.
941 The source of information is "Update for the PS/2 Hardware
942 Interface Technical Reference, Common Interfaces", September 1991,
943 part number 04G3281, available in the U.S. for $21.75 at
944 1-800-IBM-PCTB, elsewhere call your local friendly IBM
945 representative. E.g. in Germany, "Hallo IBM" works really great.
946 In addition to SCSI subsystem, this update contains fairly detailed
947 (at hardware register level) sections on diskette controller,
948 keyboard controller, serial port controller, VGA, and XGA.
950 Additional information from "Personal System/2 Micro Channel SCSI
951 Adapter with Cache Technical Reference", March 1990, PN 68X2365,
952 probably available from the same source (or possibly found buried
953 in officemates desk).
955 Friedhelm Schmidt, "SCSI-Bus und IDE-Schnittstelle - Moderne Peripherie-
956 Schnittstellen: Hardware, Protokollbeschreibung und Anwendung", 2. Aufl.
957 Addison Wesley, 1996.
959 Michael K. Johnson, "The Linux Kernel Hackers' Guide", Version 0.6, Chapel
960 Hill - North Carolina, 1995
962 Andreas Kaiser, "SCSI TAPE BACKUP for OS/2 2.0", Version 2.12, Stuttgart
965 Helmut Rompel, "IBM Computerwelt GUIDE", What is what bei IBM., Systeme *
966 Programme * Begriffe, IWT-Verlag GmbH - Muenchen, 1988
970 IBM, PS/2, OS/2, Microchannel are registered trademarks of International
971 Business Machines Corp.
973 MS-DOS is a registered trademark of Microsoft Corporation
975 OS-9 is a registered trademark of Microware Systems
979 (langa2@kph.uni-mainz.de)