Root/Documentation/mca.txt

1i386 Micro Channel Architecture Support
2=======================================
3
4MCA support is enabled using the CONFIG_MCA define. A machine with a MCA
5bus will have the kernel variable MCA_bus set, assuming the BIOS feature
6bits are set properly (see arch/i386/boot/setup.S for information on
7how this detection is done).
8
9Adapter Detection
10=================
11
12The ideal MCA adapter detection is done through the use of the
13Programmable Option Select registers. Generic functions for doing
14this have been added in include/linux/mca.h and arch/i386/kernel/mca.c.
15Everything needed to detect adapters and read (and write) configuration
16information is there. A number of MCA-specific drivers already use
17this. The typical probe code looks like the following:
18
19    #include <linux/mca.h>
20
21    unsigned char pos2, pos3, pos4, pos5;
22    struct net_device* dev;
23    int slot;
24
25    if( MCA_bus ) {
26        slot = mca_find_adapter( ADAPTER_ID, 0 );
27        if( slot == MCA_NOTFOUND ) {
28            return -ENODEV;
29        }
30        /* optional - see below */
31        mca_set_adapter_name( slot, "adapter name & description" );
32        mca_set_adapter_procfn( slot, dev_getinfo, dev );
33
34        /* read the POS registers. Most devices only use 2 and 3 */
35        pos2 = mca_read_stored_pos( slot, 2 );
36        pos3 = mca_read_stored_pos( slot, 3 );
37        pos4 = mca_read_stored_pos( slot, 4 );
38        pos5 = mca_read_stored_pos( slot, 5 );
39    } else {
40        return -ENODEV;
41    }
42
43    /* extract configuration from pos[2345] and set everything up */
44
45Loadable modules should modify this to test that the specified IRQ and
46IO ports (plus whatever other stuff) match. See 3c523.c for example
47code (actually, smc-mca.c has a slightly more complex example that can
48handle a list of adapter ids).
49
50Keep in mind that devices should never directly access the POS registers
51(via inb(), outb(), etc). While it's generally safe, there is a small
52potential for blowing up hardware when it's done at the wrong time.
53Furthermore, accessing a POS register disables a device temporarily.
54This is usually okay during startup, but do _you_ want to rely on it?
55During initial configuration, mca_init() reads all the POS registers
56into memory. mca_read_stored_pos() accesses that data. mca_read_pos()
57and mca_write_pos() are also available for (safer) direct POS access,
58but their use is _highly_ discouraged. mca_write_pos() is particularly
59dangerous, as it is possible for adapters to be put in inconsistent
60states (i.e. sharing IO address, etc) and may result in crashes, toasted
61hardware, and blindness.
62
63User level drivers (such as the AGX X server) can use /proc/mca/pos to
64find adapters (see below).
65
66Some MCA adapters can also be detected via the usual ISA-style device
67probing (many SCSI adapters, for example). This sort of thing is highly
68discouraged. Perfectly good information is available telling you what's
69there, so there's no excuse for messing with random IO ports. However,
70we MCA people still appreciate any ISA-style driver that will work with
71our hardware. You take what you can get...
72
73Level-Triggered Interrupts
74==========================
75
76Because MCA uses level-triggered interrupts, a few problems arise with
77what might best be described as the ISA mindset and its effects on
78drivers. These sorts of problems are expected to become less common as
79more people use shared IRQs on PCI machines.
80
81In general, an interrupt must be acknowledged not only at the ICU (which
82is done automagically by the kernel), but at the device level. In
83particular, IRQ 0 must be reset after a timer interrupt (now done in
84arch/i386/kernel/time.c) or the first timer interrupt hangs the system.
85There were also problems with the 1.3.x floppy drivers, but that seems
86to have been fixed.
87
88IRQs are also shareable, and most MCA-specific devices should be coded
89with shared IRQs in mind.
90
91/proc/mca
92=========
93
94/proc/mca is a directory containing various files for adapters and
95other stuff.
96
97    /proc/mca/pos Straight listing of POS registers
98    /proc/mca/slot[1-8] Information on adapter in specific slot
99    /proc/mca/video Same for integrated video
100    /proc/mca/scsi Same for integrated SCSI
101    /proc/mca/machine Machine information
102
103See Appendix A for a sample.
104
105Device drivers can easily add their own information function for
106specific slots (including integrated ones) via the
107mca_set_adapter_procfn() call. Drivers that support this are ESDI, IBM
108SCSI, and 3c523. If a device is also a module, make sure that the proc
109function is removed in the module cleanup. This will require storing
110the slot information in a private structure somewhere. See the 3c523
111driver for details.
112
113Your typical proc function will look something like this:
114
115    static int
116    dev_getinfo( char* buf, int slot, void* d ) {
117        struct net_device* dev = (struct net_device*) d;
118        int len = 0;
119
120        len += sprintf( buf+len, "Device: %s\n", dev->name );
121        len += sprintf( buf+len, "IRQ: %d\n", dev->irq );
122        len += sprintf( buf+len, "IO Port: %#lx-%#lx\n", ... );
123        ...
124
125        return len;
126    }
127
128Some of the standard MCA information will already be printed, so don't
129bother repeating it. Don't try putting in more than 3K of information.
130
131Enable this function with:
132    mca_set_adapter_procfn( slot, dev_getinfo, dev );
133
134Disable it with:
135    mca_set_adapter_procfn( slot, NULL, NULL );
136
137It is also recommended that, even if you don't write a proc function, to
138set the name of the adapter (i.e. "PS/2 ESDI Controller") via
139mca_set_adapter_name( int slot, char* name ).
140
141MCA Device Drivers
142==================
143
144Currently, there are a number of MCA-specific device drivers.
145
1461) PS/2 SCSI
147    drivers/scsi/ibmmca.c
148    drivers/scsi/ibmmca.h
149   The driver for the IBM SCSI subsystem. Includes both integrated
150   controllers and adapter cards. May require command-line arg
151   "ibmmcascsi=io_port" to force detection of an adapter. If you have a
152   machine with a front-panel display (i.e. model 95), you can use
153   "ibmmcascsi=display" to enable a drive activity indicator.
154
1552) 3c523
156    drivers/net/3c523.c
157    drivers/net/3c523.h
158   3Com 3c523 Etherlink/MC ethernet driver.
159
1603) SMC Ultra/MCA and IBM Adapter/A
161    drivers/net/smc-mca.c
162    drivers/net/smc-mca.h
163    Driver for the MCA version of the SMC Ultra and various other
164    OEM'ed and work-alike cards (Elite, Adapter/A, etc).
165
1664) NE/2
167    driver/net/ne2.c
168    driver/net/ne2.h
169    The NE/2 is the MCA version of the NE2000. This may not work
170    with clones that have a different adapter id than the original
171    NE/2.
172
1735) Future Domain MCS-600/700, OEM'd IBM Fast SCSI Adapter/A and
174   Reply Sound Blaster/SCSI (SCSI part)
175    Better support for these cards than the driver for ISA.
176   Supports multiple cards with IRQ sharing.
177
178Also added boot time option of scsi-probe, which can do reordering of
179SCSI host adapters. This will direct the kernel on the order which
180SCSI adapter should be detected. Example:
181  scsi-probe=ibmmca,fd_mcs,adaptec1542,buslogic
182
183The serial drivers were modified to support the extended IO port range
184of the typical MCA system (also #ifdef CONFIG_MCA).
185
186The following devices work with existing drivers:
1871) Token-ring
1882) Future Domain SCSI (MCS-600, MCS-700, not MCS-350, OEM'ed IBM SCSI)
1893) Adaptec 1640 SCSI (using the aha1542 driver)
1904) Bustek/Buslogic SCSI (various)
1915) Probably all Arcnet cards.
1926) Some, possibly all, MCA IDE controllers.
1937) 3Com 3c529 (MCA version of 3c509) (patched)
194
1958) Intel EtherExpressMC (patched version)
196   You need to have CONFIG_MCA defined to have EtherExpressMC support.
1979) Reply Sound Blaster/SCSI (SB part) (patched version)
198
199Bugs & Other Weirdness
200======================
201
202NMIs tend to occur with MCA machines because of various hardware
203weirdness, bus timeouts, and many other non-critical things. Some basic
204code to handle them (inspired by the NetBSD MCA code) has been added to
205detect the guilty device, but it's pretty incomplete. If NMIs are a
206persistent problem (on some model 70 or 80s, they occur every couple
207shell commands), the CONFIG_IGNORE_NMI flag will take care of that.
208
209Various Pentium machines have had serious problems with the FPU test in
210bugs.h. Basically, the machine hangs after the HLT test. This occurs,
211as far as we know, on the Pentium-equipped 85s, 95s, and some PC Servers.
212The PCI/MCA PC 750s are fine as far as I can tell. The ``mca-pentium''
213boot-prompt flag will disable the FPU bug check if this is a problem
214with your machine.
215
216The model 80 has a raft of problems that are just too weird and unique
217to get into here. Some people have no trouble while others have nothing
218but problems. I'd suspect some problems are related to the age of the
219average 80 and accompanying hardware deterioration, although others
220are definitely design problems with the hardware. Among the problems
221include SCSI controller problems, ESDI controller problems, and serious
222screw-ups in the floppy controller. Oh, and the parallel port is also
223pretty flaky. There were about 5 or 6 different model 80 motherboards
224produced to fix various obscure problems. As far as I know, it's pretty
225much impossible to tell which bugs a particular model 80 has (other than
226triggering them, that is).
227
228Drivers are required for some MCA memory adapters. If you're suddenly
229short a few megs of RAM, this might be the reason. The (I think) Enhanced
230Memory Adapter commonly found on the model 70 is one. There's a very
231alpha driver floating around, but it's pretty ugly (disassembled from
232the DOS driver, actually). See the MCA Linux web page (URL below)
233for more current memory info.
234
235The Thinkpad 700 and 720 will work, but various components are either
236non-functional, flaky, or we don't know anything about them. The
237graphics controller is supposed to be some WD, but we can't get things
238working properly. The PCMCIA slots don't seem to work. Ditto for APM.
239The serial ports work, but detection seems to be flaky.
240
241Credits
242=======
243A whole pile of people have contributed to the MCA code. I'd include
244their names here, but I don't have a list handy. Check the MCA Linux
245home page (URL below) for a perpetually out-of-date list.
246
247=====================================================================
248MCA Linux Home Page: http://www.dgmicro.com/mca/
249
250Christophe Beauregard
251chrisb@truespectra.com
252cpbeaure@calum.csclub.uwaterloo.ca
253
254=====================================================================
255Appendix A: Sample /proc/mca
256
257This is from my model 8595. Slot 1 contains the standard IBM SCSI
258adapter, slot 3 is an Adaptec AHA-1640, slot 5 is a XGA-1 video adapter,
259and slot 7 is the 3c523 Etherlink/MC.
260
261/proc/mca/machine:
262Model Id: 0xf8
263Submodel Id: 0x14
264BIOS Revision: 0x5
265
266/proc/mca/pos:
267Slot 1: ff 8e f1 fc a0 ff ff ff IBM SCSI Adapter w/Cache
268Slot 2: ff ff ff ff ff ff ff ff
269Slot 3: 1f 0f 81 3b bf b6 ff ff
270Slot 4: ff ff ff ff ff ff ff ff
271Slot 5: db 8f 1d 5e fd c0 00 00
272Slot 6: ff ff ff ff ff ff ff ff
273Slot 7: 42 60 ff 08 ff ff ff ff 3Com 3c523 Etherlink/MC
274Slot 8: ff ff ff ff ff ff ff ff
275Video : ff ff ff ff ff ff ff ff
276SCSI : ff ff ff ff ff ff ff ff
277
278/proc/mca/slot1:
279Slot: 1
280Adapter Name: IBM SCSI Adapter w/Cache
281Id: 8eff
282Enabled: Yes
283POS: ff 8e f1 fc a0 ff ff ff
284Subsystem PUN: 7
285Detected at boot: Yes
286
287/proc/mca/slot3:
288Slot: 3
289Adapter Name: Unknown
290Id: 0f1f
291Enabled: Yes
292POS: 1f 0f 81 3b bf b6 ff ff
293
294/proc/mca/slot5:
295Slot: 5
296Adapter Name: Unknown
297Id: 8fdb
298Enabled: Yes
299POS: db 8f 1d 5e fd c0 00 00
300
301/proc/mca/slot7:
302Slot: 7
303Adapter Name: 3Com 3c523 Etherlink/MC
304Id: 6042
305Enabled: Yes
306POS: 42 60 ff 08 ff ff ff ff
307Revision: 0xe
308IRQ: 9
309IO Address: 0x3300-0x3308
310Memory: 0xd8000-0xdbfff
311Transceiver: External
312Device: eth0
313Hardware Address: 02 60 8c 45 c4 2a
314

Archive Download this file



interactive