diff options
38 files changed, 15 insertions, 2526 deletions
diff --git a/Documentation/00-INDEX b/Documentation/00-INDEX index 2214f123a976..49c051380daf 100644 --- a/Documentation/00-INDEX +++ b/Documentation/00-INDEX | |||
| @@ -218,8 +218,6 @@ m68k/ | |||
| 218 | - directory with info about Linux on Motorola 68k architecture. | 218 | - directory with info about Linux on Motorola 68k architecture. |
| 219 | magic-number.txt | 219 | magic-number.txt |
| 220 | - list of magic numbers used to mark/protect kernel data structures. | 220 | - list of magic numbers used to mark/protect kernel data structures. |
| 221 | mca.txt | ||
| 222 | - info on supporting Micro Channel Architecture (e.g. PS/2) systems. | ||
| 223 | md.txt | 221 | md.txt |
| 224 | - info on boot arguments for the multiple devices driver. | 222 | - info on boot arguments for the multiple devices driver. |
| 225 | memory-barriers.txt | 223 | memory-barriers.txt |
diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile index 66725a3d30dc..bc3d9f8c0a90 100644 --- a/Documentation/DocBook/Makefile +++ b/Documentation/DocBook/Makefile | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | # To add a new book the only step required is to add the book to the | 6 | # To add a new book the only step required is to add the book to the |
| 7 | # list of DOCBOOKS. | 7 | # list of DOCBOOKS. |
| 8 | 8 | ||
| 9 | DOCBOOKS := z8530book.xml mcabook.xml device-drivers.xml \ | 9 | DOCBOOKS := z8530book.xml device-drivers.xml \ |
| 10 | kernel-hacking.xml kernel-locking.xml deviceiobook.xml \ | 10 | kernel-hacking.xml kernel-locking.xml deviceiobook.xml \ |
| 11 | writing_usb_driver.xml networking.xml \ | 11 | writing_usb_driver.xml networking.xml \ |
| 12 | kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \ | 12 | kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \ |
diff --git a/Documentation/DocBook/kernel-api.tmpl b/Documentation/DocBook/kernel-api.tmpl index 7160652a8736..00687ee9d363 100644 --- a/Documentation/DocBook/kernel-api.tmpl +++ b/Documentation/DocBook/kernel-api.tmpl | |||
| @@ -212,19 +212,6 @@ X!Edrivers/pci/hotplug.c | |||
| 212 | <sect1><title>PCI Hotplug Support Library</title> | 212 | <sect1><title>PCI Hotplug Support Library</title> |
| 213 | !Edrivers/pci/hotplug/pci_hotplug_core.c | 213 | !Edrivers/pci/hotplug/pci_hotplug_core.c |
| 214 | </sect1> | 214 | </sect1> |
| 215 | <sect1><title>MCA Architecture</title> | ||
| 216 | <sect2><title>MCA Device Functions</title> | ||
| 217 | <para> | ||
| 218 | Refer to the file arch/x86/kernel/mca_32.c for more information. | ||
| 219 | </para> | ||
| 220 | <!-- FIXME: Removed for now since no structured comments in source | ||
| 221 | X!Earch/x86/kernel/mca_32.c | ||
| 222 | --> | ||
| 223 | </sect2> | ||
| 224 | <sect2><title>MCA Bus DMA</title> | ||
| 225 | !Iarch/x86/include/asm/mca_dma.h | ||
| 226 | </sect2> | ||
| 227 | </sect1> | ||
| 228 | </chapter> | 215 | </chapter> |
| 229 | 216 | ||
| 230 | <chapter id="firmware"> | 217 | <chapter id="firmware"> |
diff --git a/Documentation/DocBook/mcabook.tmpl b/Documentation/DocBook/mcabook.tmpl deleted file mode 100644 index 467ccac6ec50..000000000000 --- a/Documentation/DocBook/mcabook.tmpl +++ /dev/null | |||
| @@ -1,107 +0,0 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" | ||
| 3 | "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []> | ||
| 4 | |||
| 5 | <book id="MCAGuide"> | ||
| 6 | <bookinfo> | ||
| 7 | <title>MCA Driver Programming Interface</title> | ||
| 8 | |||
| 9 | <authorgroup> | ||
| 10 | <author> | ||
| 11 | <firstname>Alan</firstname> | ||
| 12 | <surname>Cox</surname> | ||
| 13 | <affiliation> | ||
| 14 | <address> | ||
| 15 | <email>alan@lxorguk.ukuu.org.uk</email> | ||
| 16 | </address> | ||
| 17 | </affiliation> | ||
| 18 | </author> | ||
| 19 | <author> | ||
| 20 | <firstname>David</firstname> | ||
| 21 | <surname>Weinehall</surname> | ||
| 22 | </author> | ||
| 23 | <author> | ||
| 24 | <firstname>Chris</firstname> | ||
| 25 | <surname>Beauregard</surname> | ||
| 26 | </author> | ||
| 27 | </authorgroup> | ||
| 28 | |||
| 29 | <copyright> | ||
| 30 | <year>2000</year> | ||
| 31 | <holder>Alan Cox</holder> | ||
| 32 | <holder>David Weinehall</holder> | ||
| 33 | <holder>Chris Beauregard</holder> | ||
| 34 | </copyright> | ||
| 35 | |||
| 36 | <legalnotice> | ||
| 37 | <para> | ||
| 38 | This documentation is free software; you can redistribute | ||
| 39 | it and/or modify it under the terms of the GNU General Public | ||
| 40 | License as published by the Free Software Foundation; either | ||
| 41 | version 2 of the License, or (at your option) any later | ||
| 42 | version. | ||
| 43 | </para> | ||
| 44 | |||
| 45 | <para> | ||
| 46 | This program is distributed in the hope that it will be | ||
| 47 | useful, but WITHOUT ANY WARRANTY; without even the implied | ||
| 48 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
| 49 | See the GNU General Public License for more details. | ||
| 50 | </para> | ||
| 51 | |||
| 52 | <para> | ||
| 53 | You should have received a copy of the GNU General Public | ||
| 54 | License along with this program; if not, write to the Free | ||
| 55 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
| 56 | MA 02111-1307 USA | ||
| 57 | </para> | ||
| 58 | |||
| 59 | <para> | ||
| 60 | For more details see the file COPYING in the source | ||
| 61 | distribution of Linux. | ||
| 62 | </para> | ||
| 63 | </legalnotice> | ||
| 64 | </bookinfo> | ||
| 65 | |||
| 66 | <toc></toc> | ||
| 67 | |||
| 68 | <chapter id="intro"> | ||
| 69 | <title>Introduction</title> | ||
| 70 | <para> | ||
| 71 | The MCA bus functions provide a generalised interface to find MCA | ||
| 72 | bus cards, to claim them for a driver, and to read and manipulate POS | ||
| 73 | registers without being aware of the motherboard internals or | ||
| 74 | certain deep magic specific to onboard devices. | ||
| 75 | </para> | ||
| 76 | <para> | ||
| 77 | The basic interface to the MCA bus devices is the slot. Each slot | ||
| 78 | is numbered and virtual slot numbers are assigned to the internal | ||
| 79 | devices. Using a pci_dev as other busses do does not really make | ||
| 80 | sense in the MCA context as the MCA bus resources require card | ||
| 81 | specific interpretation. | ||
| 82 | </para> | ||
| 83 | <para> | ||
| 84 | Finally the MCA bus functions provide a parallel set of DMA | ||
| 85 | functions mimicing the ISA bus DMA functions as closely as possible, | ||
| 86 | although also supporting the additional DMA functionality on the | ||
| 87 | MCA bus controllers. | ||
| 88 | </para> | ||
| 89 | </chapter> | ||
| 90 | <chapter id="bugs"> | ||
| 91 | <title>Known Bugs And Assumptions</title> | ||
| 92 | <para> | ||
| 93 | None. | ||
| 94 | </para> | ||
| 95 | </chapter> | ||
| 96 | |||
| 97 | <chapter id="pubfunctions"> | ||
| 98 | <title>Public Functions Provided</title> | ||
| 99 | !Edrivers/mca/mca-legacy.c | ||
| 100 | </chapter> | ||
| 101 | |||
| 102 | <chapter id="dmafunctions"> | ||
| 103 | <title>DMA Functions Provided</title> | ||
| 104 | !Iarch/x86/include/asm/mca_dma.h | ||
| 105 | </chapter> | ||
| 106 | |||
| 107 | </book> | ||
diff --git a/Documentation/devices.txt b/Documentation/devices.txt index 00383186d8fb..c162be1c3234 100644 --- a/Documentation/devices.txt +++ b/Documentation/devices.txt | |||
| @@ -846,13 +846,7 @@ Your cooperation is appreciated. | |||
| 846 | ... | 846 | ... |
| 847 | 31 = /dev/tap15 16th Ethertap device | 847 | 31 = /dev/tap15 16th Ethertap device |
| 848 | 848 | ||
| 849 | 36 block MCA ESDI hard disk | 849 | 36 block OBSOLETE (was MCA ESDI hard disk) |
| 850 | 0 = /dev/eda First ESDI disk whole disk | ||
| 851 | 64 = /dev/edb Second ESDI disk whole disk | ||
| 852 | ... | ||
| 853 | |||
| 854 | Partitions are handled in the same way as IDE disks | ||
| 855 | (see major number 3). | ||
| 856 | 850 | ||
| 857 | 37 char IDE tape | 851 | 37 char IDE tape |
| 858 | 0 = /dev/ht0 First IDE tape | 852 | 0 = /dev/ht0 First IDE tape |
diff --git a/Documentation/eisa.txt b/Documentation/eisa.txt index 38cf0c7b559f..a55e4910924e 100644 --- a/Documentation/eisa.txt +++ b/Documentation/eisa.txt | |||
| @@ -179,7 +179,7 @@ CONFIG_ALPHA_JENSEN or CONFIG_EISA_VLB_PRIMING are set. | |||
| 179 | 179 | ||
| 180 | Converting an EISA driver to the new API mostly involves *deleting* | 180 | Converting an EISA driver to the new API mostly involves *deleting* |
| 181 | code (since probing is now in the core EISA code). Unfortunately, most | 181 | code (since probing is now in the core EISA code). Unfortunately, most |
| 182 | drivers share their probing routine between ISA, MCA and EISA. Special | 182 | drivers share their probing routine between ISA, and EISA. Special |
| 183 | care must be taken when ripping out the EISA code, so other busses | 183 | care must be taken when ripping out the EISA code, so other busses |
| 184 | won't suffer from these surgical strikes... | 184 | won't suffer from these surgical strikes... |
| 185 | 185 | ||
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index c1601e5a8b71..38cad53620cc 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
| @@ -70,7 +70,6 @@ parameter is applicable: | |||
| 70 | M68k M68k architecture is enabled. | 70 | M68k M68k architecture is enabled. |
| 71 | These options have more detailed description inside of | 71 | These options have more detailed description inside of |
| 72 | Documentation/m68k/kernel-options.txt. | 72 | Documentation/m68k/kernel-options.txt. |
| 73 | MCA MCA bus support is enabled. | ||
| 74 | MDA MDA console support is enabled. | 73 | MDA MDA console support is enabled. |
| 75 | MIPS MIPS architecture is enabled. | 74 | MIPS MIPS architecture is enabled. |
| 76 | MOUSE Appropriate mouse support is enabled. | 75 | MOUSE Appropriate mouse support is enabled. |
diff --git a/Documentation/mca.txt b/Documentation/mca.txt deleted file mode 100644 index dfd130c2207d..000000000000 --- a/Documentation/mca.txt +++ /dev/null | |||
| @@ -1,313 +0,0 @@ | |||
| 1 | i386 Micro Channel Architecture Support | ||
| 2 | ======================================= | ||
| 3 | |||
| 4 | MCA support is enabled using the CONFIG_MCA define. A machine with a MCA | ||
| 5 | bus will have the kernel variable MCA_bus set, assuming the BIOS feature | ||
| 6 | bits are set properly (see arch/i386/boot/setup.S for information on | ||
| 7 | how this detection is done). | ||
| 8 | |||
| 9 | Adapter Detection | ||
| 10 | ================= | ||
| 11 | |||
| 12 | The ideal MCA adapter detection is done through the use of the | ||
| 13 | Programmable Option Select registers. Generic functions for doing | ||
| 14 | this have been added in include/linux/mca.h and arch/x86/kernel/mca_32.c. | ||
| 15 | Everything needed to detect adapters and read (and write) configuration | ||
| 16 | information is there. A number of MCA-specific drivers already use | ||
| 17 | this. 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 | |||
| 45 | Loadable modules should modify this to test that the specified IRQ and | ||
| 46 | IO ports (plus whatever other stuff) match. See 3c523.c for example | ||
| 47 | code (actually, smc-mca.c has a slightly more complex example that can | ||
| 48 | handle a list of adapter ids). | ||
| 49 | |||
| 50 | Keep 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 | ||
| 52 | potential for blowing up hardware when it's done at the wrong time. | ||
| 53 | Furthermore, accessing a POS register disables a device temporarily. | ||
| 54 | This is usually okay during startup, but do _you_ want to rely on it? | ||
| 55 | During initial configuration, mca_init() reads all the POS registers | ||
| 56 | into memory. mca_read_stored_pos() accesses that data. mca_read_pos() | ||
| 57 | and mca_write_pos() are also available for (safer) direct POS access, | ||
| 58 | but their use is _highly_ discouraged. mca_write_pos() is particularly | ||
| 59 | dangerous, as it is possible for adapters to be put in inconsistent | ||
| 60 | states (i.e. sharing IO address, etc) and may result in crashes, toasted | ||
| 61 | hardware, and blindness. | ||
| 62 | |||
| 63 | User level drivers (such as the AGX X server) can use /proc/mca/pos to | ||
| 64 | find adapters (see below). | ||
| 65 | |||
| 66 | Some MCA adapters can also be detected via the usual ISA-style device | ||
| 67 | probing (many SCSI adapters, for example). This sort of thing is highly | ||
| 68 | discouraged. Perfectly good information is available telling you what's | ||
| 69 | there, so there's no excuse for messing with random IO ports. However, | ||
| 70 | we MCA people still appreciate any ISA-style driver that will work with | ||
| 71 | our hardware. You take what you can get... | ||
| 72 | |||
| 73 | Level-Triggered Interrupts | ||
| 74 | ========================== | ||
| 75 | |||
| 76 | Because MCA uses level-triggered interrupts, a few problems arise with | ||
| 77 | what might best be described as the ISA mindset and its effects on | ||
| 78 | drivers. These sorts of problems are expected to become less common as | ||
| 79 | more people use shared IRQs on PCI machines. | ||
| 80 | |||
| 81 | In general, an interrupt must be acknowledged not only at the ICU (which | ||
| 82 | is done automagically by the kernel), but at the device level. In | ||
| 83 | particular, IRQ 0 must be reset after a timer interrupt (now done in | ||
| 84 | arch/x86/kernel/time.c) or the first timer interrupt hangs the system. | ||
| 85 | There were also problems with the 1.3.x floppy drivers, but that seems | ||
| 86 | to have been fixed. | ||
| 87 | |||
| 88 | IRQs are also shareable, and most MCA-specific devices should be coded | ||
| 89 | with shared IRQs in mind. | ||
| 90 | |||
| 91 | /proc/mca | ||
| 92 | ========= | ||
| 93 | |||
| 94 | /proc/mca is a directory containing various files for adapters and | ||
| 95 | other 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 | |||
| 103 | See Appendix A for a sample. | ||
| 104 | |||
| 105 | Device drivers can easily add their own information function for | ||
| 106 | specific slots (including integrated ones) via the | ||
| 107 | mca_set_adapter_procfn() call. Drivers that support this are ESDI, IBM | ||
| 108 | SCSI, and 3c523. If a device is also a module, make sure that the proc | ||
| 109 | function is removed in the module cleanup. This will require storing | ||
| 110 | the slot information in a private structure somewhere. See the 3c523 | ||
| 111 | driver for details. | ||
| 112 | |||
| 113 | Your 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 | |||
| 128 | Some of the standard MCA information will already be printed, so don't | ||
| 129 | bother repeating it. Don't try putting in more than 3K of information. | ||
| 130 | |||
| 131 | Enable this function with: | ||
| 132 | mca_set_adapter_procfn( slot, dev_getinfo, dev ); | ||
| 133 | |||
| 134 | Disable it with: | ||
| 135 | mca_set_adapter_procfn( slot, NULL, NULL ); | ||
| 136 | |||
| 137 | It is also recommended that, even if you don't write a proc function, to | ||
| 138 | set the name of the adapter (i.e. "PS/2 ESDI Controller") via | ||
| 139 | mca_set_adapter_name( int slot, char* name ). | ||
| 140 | |||
| 141 | MCA Device Drivers | ||
| 142 | ================== | ||
| 143 | |||
| 144 | Currently, there are a number of MCA-specific device drivers. | ||
| 145 | |||
| 146 | 1) 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 | |||
| 155 | 2) 3c523 | ||
| 156 | drivers/net/3c523.c | ||
| 157 | drivers/net/3c523.h | ||
| 158 | 3Com 3c523 Etherlink/MC ethernet driver. | ||
| 159 | |||
| 160 | 3) 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 | |||
| 166 | 4) 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 | |||
| 173 | 5) 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 | |||
| 178 | Also added boot time option of scsi-probe, which can do reordering of | ||
| 179 | SCSI host adapters. This will direct the kernel on the order which | ||
| 180 | SCSI adapter should be detected. Example: | ||
| 181 | scsi-probe=ibmmca,fd_mcs,adaptec1542,buslogic | ||
| 182 | |||
| 183 | The serial drivers were modified to support the extended IO port range | ||
| 184 | of the typical MCA system (also #ifdef CONFIG_MCA). | ||
| 185 | |||
| 186 | The following devices work with existing drivers: | ||
| 187 | 1) Token-ring | ||
| 188 | 2) Future Domain SCSI (MCS-600, MCS-700, not MCS-350, OEM'ed IBM SCSI) | ||
| 189 | 3) Adaptec 1640 SCSI (using the aha1542 driver) | ||
| 190 | 4) Bustek/Buslogic SCSI (various) | ||
| 191 | 5) Probably all Arcnet cards. | ||
| 192 | 6) Some, possibly all, MCA IDE controllers. | ||
| 193 | 7) 3Com 3c529 (MCA version of 3c509) (patched) | ||
| 194 | |||
| 195 | 8) Intel EtherExpressMC (patched version) | ||
| 196 | You need to have CONFIG_MCA defined to have EtherExpressMC support. | ||
| 197 | 9) Reply Sound Blaster/SCSI (SB part) (patched version) | ||
| 198 | |||
| 199 | Bugs & Other Weirdness | ||
| 200 | ====================== | ||
| 201 | |||
| 202 | NMIs tend to occur with MCA machines because of various hardware | ||
| 203 | weirdness, bus timeouts, and many other non-critical things. Some basic | ||
| 204 | code to handle them (inspired by the NetBSD MCA code) has been added to | ||
| 205 | detect the guilty device, but it's pretty incomplete. If NMIs are a | ||
| 206 | persistent problem (on some model 70 or 80s, they occur every couple | ||
| 207 | shell commands), the CONFIG_IGNORE_NMI flag will take care of that. | ||
| 208 | |||
| 209 | Various Pentium machines have had serious problems with the FPU test in | ||
| 210 | bugs.h. Basically, the machine hangs after the HLT test. This occurs, | ||
| 211 | as far as we know, on the Pentium-equipped 85s, 95s, and some PC Servers. | ||
| 212 | The PCI/MCA PC 750s are fine as far as I can tell. The ``mca-pentium'' | ||
| 213 | boot-prompt flag will disable the FPU bug check if this is a problem | ||
| 214 | with your machine. | ||
| 215 | |||
| 216 | The model 80 has a raft of problems that are just too weird and unique | ||
| 217 | to get into here. Some people have no trouble while others have nothing | ||
| 218 | but problems. I'd suspect some problems are related to the age of the | ||
| 219 | average 80 and accompanying hardware deterioration, although others | ||
| 220 | are definitely design problems with the hardware. Among the problems | ||
| 221 | include SCSI controller problems, ESDI controller problems, and serious | ||
| 222 | screw-ups in the floppy controller. Oh, and the parallel port is also | ||
| 223 | pretty flaky. There were about 5 or 6 different model 80 motherboards | ||
| 224 | produced to fix various obscure problems. As far as I know, it's pretty | ||
| 225 | much impossible to tell which bugs a particular model 80 has (other than | ||
| 226 | triggering them, that is). | ||
| 227 | |||
| 228 | Drivers are required for some MCA memory adapters. If you're suddenly | ||
| 229 | short a few megs of RAM, this might be the reason. The (I think) Enhanced | ||
| 230 | Memory Adapter commonly found on the model 70 is one. There's a very | ||
| 231 | alpha driver floating around, but it's pretty ugly (disassembled from | ||
| 232 | the DOS driver, actually). See the MCA Linux web page (URL below) | ||
| 233 | for more current memory info. | ||
| 234 | |||
| 235 | The Thinkpad 700 and 720 will work, but various components are either | ||
| 236 | non-functional, flaky, or we don't know anything about them. The | ||
| 237 | graphics controller is supposed to be some WD, but we can't get things | ||
| 238 | working properly. The PCMCIA slots don't seem to work. Ditto for APM. | ||
| 239 | The serial ports work, but detection seems to be flaky. | ||
| 240 | |||
| 241 | Credits | ||
| 242 | ======= | ||
| 243 | A whole pile of people have contributed to the MCA code. I'd include | ||
| 244 | their names here, but I don't have a list handy. Check the MCA Linux | ||
| 245 | home page (URL below) for a perpetually out-of-date list. | ||
| 246 | |||
| 247 | ===================================================================== | ||
| 248 | MCA Linux Home Page: http://www.dgmicro.com/mca/ | ||
| 249 | |||
| 250 | Christophe Beauregard | ||
| 251 | chrisb@truespectra.com | ||
| 252 | cpbeaure@calum.csclub.uwaterloo.ca | ||
| 253 | |||
| 254 | ===================================================================== | ||
| 255 | Appendix A: Sample /proc/mca | ||
| 256 | |||
| 257 | This is from my model 8595. Slot 1 contains the standard IBM SCSI | ||
| 258 | adapter, slot 3 is an Adaptec AHA-1640, slot 5 is a XGA-1 video adapter, | ||
| 259 | and slot 7 is the 3c523 Etherlink/MC. | ||
| 260 | |||
| 261 | /proc/mca/machine: | ||
| 262 | Model Id: 0xf8 | ||
| 263 | Submodel Id: 0x14 | ||
| 264 | BIOS Revision: 0x5 | ||
| 265 | |||
| 266 | /proc/mca/pos: | ||
| 267 | Slot 1: ff 8e f1 fc a0 ff ff ff IBM SCSI Adapter w/Cache | ||
| 268 | Slot 2: ff ff ff ff ff ff ff ff | ||
| 269 | Slot 3: 1f 0f 81 3b bf b6 ff ff | ||
| 270 | Slot 4: ff ff ff ff ff ff ff ff | ||
| 271 | Slot 5: db 8f 1d 5e fd c0 00 00 | ||
| 272 | Slot 6: ff ff ff ff ff ff ff ff | ||
| 273 | Slot 7: 42 60 ff 08 ff ff ff ff 3Com 3c523 Etherlink/MC | ||
| 274 | Slot 8: ff ff ff ff ff ff ff ff | ||
| 275 | Video : ff ff ff ff ff ff ff ff | ||
| 276 | SCSI : ff ff ff ff ff ff ff ff | ||
| 277 | |||
| 278 | /proc/mca/slot1: | ||
| 279 | Slot: 1 | ||
| 280 | Adapter Name: IBM SCSI Adapter w/Cache | ||
| 281 | Id: 8eff | ||
| 282 | Enabled: Yes | ||
| 283 | POS: ff 8e f1 fc a0 ff ff ff | ||
| 284 | Subsystem PUN: 7 | ||
| 285 | Detected at boot: Yes | ||
| 286 | |||
| 287 | /proc/mca/slot3: | ||
| 288 | Slot: 3 | ||
| 289 | Adapter Name: Unknown | ||
| 290 | Id: 0f1f | ||
| 291 | Enabled: Yes | ||
| 292 | POS: 1f 0f 81 3b bf b6 ff ff | ||
| 293 | |||
| 294 | /proc/mca/slot5: | ||
| 295 | Slot: 5 | ||
| 296 | Adapter Name: Unknown | ||
| 297 | Id: 8fdb | ||
| 298 | Enabled: Yes | ||
| 299 | POS: db 8f 1d 5e fd c0 00 00 | ||
| 300 | |||
| 301 | /proc/mca/slot7: | ||
| 302 | Slot: 7 | ||
| 303 | Adapter Name: 3Com 3c523 Etherlink/MC | ||
| 304 | Id: 6042 | ||
| 305 | Enabled: Yes | ||
| 306 | POS: 42 60 ff 08 ff ff ff ff | ||
| 307 | Revision: 0xe | ||
| 308 | IRQ: 9 | ||
| 309 | IO Address: 0x3300-0x3308 | ||
| 310 | Memory: 0xd8000-0xdbfff | ||
| 311 | Transceiver: External | ||
| 312 | Device: eth0 | ||
| 313 | Hardware Address: 02 60 8c 45 c4 2a | ||
diff --git a/MAINTAINERS b/MAINTAINERS index 490dd6e640ac..9fa728b53d4e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -3316,12 +3316,6 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux.git | |||
| 3316 | S: Maintained | 3316 | S: Maintained |
| 3317 | F: arch/ia64/ | 3317 | F: arch/ia64/ |
| 3318 | 3318 | ||
| 3319 | IBM MCA SCSI SUBSYSTEM DRIVER | ||
| 3320 | M: Michael Lang <langa2@kph.uni-mainz.de> | ||
| 3321 | W: http://www.uni-mainz.de/~langm000/linux.html | ||
| 3322 | S: Maintained | ||
| 3323 | F: drivers/scsi/ibmmca.c | ||
| 3324 | |||
| 3325 | IBM Power Linux RAID adapter | 3319 | IBM Power Linux RAID adapter |
| 3326 | M: Brian King <brking@us.ibm.com> | 3320 | M: Brian King <brking@us.ibm.com> |
| 3327 | S: Supported | 3321 | S: Supported |
| @@ -4418,13 +4412,6 @@ T: git git://git.monstr.eu/linux-2.6-microblaze.git | |||
| 4418 | S: Supported | 4412 | S: Supported |
| 4419 | F: arch/microblaze/ | 4413 | F: arch/microblaze/ |
| 4420 | 4414 | ||
| 4421 | MICROCHANNEL ARCHITECTURE (MCA) | ||
| 4422 | M: James Bottomley <James.Bottomley@HansenPartnership.com> | ||
| 4423 | S: Maintained | ||
| 4424 | F: Documentation/mca.txt | ||
| 4425 | F: drivers/mca/ | ||
| 4426 | F: include/linux/mca* | ||
| 4427 | |||
| 4428 | MICROTEK X6 SCANNER | 4415 | MICROTEK X6 SCANNER |
| 4429 | M: Oliver Neukum <oliver@neukum.name> | 4416 | M: Oliver Neukum <oliver@neukum.name> |
| 4430 | S: Maintained | 4417 | S: Maintained |
diff --git a/arch/frv/include/asm/processor.h b/arch/frv/include/asm/processor.h index 81c2e271d620..4a53811cd4cd 100644 --- a/arch/frv/include/asm/processor.h +++ b/arch/frv/include/asm/processor.h | |||
| @@ -54,7 +54,6 @@ extern struct cpuinfo_frv __nongprelbss boot_cpu_data; | |||
| 54 | * Bus types | 54 | * Bus types |
| 55 | */ | 55 | */ |
| 56 | #define EISA_bus 0 | 56 | #define EISA_bus 0 |
| 57 | #define MCA_bus 0 | ||
| 58 | 57 | ||
| 59 | struct thread_struct { | 58 | struct thread_struct { |
| 60 | struct pt_regs *frame; /* [GR28] exception frame ptr for this thread */ | 59 | struct pt_regs *frame; /* [GR28] exception frame ptr for this thread */ |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index c9866b0b77d8..9137057152c3 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
| @@ -2023,16 +2023,6 @@ config EISA | |||
| 2023 | 2023 | ||
| 2024 | source "drivers/eisa/Kconfig" | 2024 | source "drivers/eisa/Kconfig" |
| 2025 | 2025 | ||
| 2026 | config MCA | ||
| 2027 | bool "MCA support" | ||
| 2028 | ---help--- | ||
| 2029 | MicroChannel Architecture is found in some IBM PS/2 machines and | ||
| 2030 | laptops. It is a bus system similar to PCI or ISA. See | ||
| 2031 | <file:Documentation/mca.txt> (and especially the web page given | ||
| 2032 | there) before attempting to build an MCA bus kernel. | ||
| 2033 | |||
| 2034 | source "drivers/mca/Kconfig" | ||
| 2035 | |||
| 2036 | config SCx200 | 2026 | config SCx200 |
| 2037 | tristate "NatSemi SCx200 support" | 2027 | tristate "NatSemi SCx200 support" |
| 2038 | ---help--- | 2028 | ---help--- |
diff --git a/arch/x86/include/asm/mca.h b/arch/x86/include/asm/mca.h deleted file mode 100644 index eedbb6cc1efb..000000000000 --- a/arch/x86/include/asm/mca.h +++ /dev/null | |||
| @@ -1,43 +0,0 @@ | |||
| 1 | /* -*- mode: c; c-basic-offset: 8 -*- */ | ||
| 2 | |||
| 3 | /* Platform specific MCA defines */ | ||
| 4 | #ifndef _ASM_X86_MCA_H | ||
| 5 | #define _ASM_X86_MCA_H | ||
| 6 | |||
| 7 | /* Maximal number of MCA slots - actually, some machines have less, but | ||
| 8 | * they all have sufficient number of POS registers to cover 8. | ||
| 9 | */ | ||
| 10 | #define MCA_MAX_SLOT_NR 8 | ||
| 11 | |||
| 12 | /* Most machines have only one MCA bus. The only multiple bus machines | ||
| 13 | * I know have at most two */ | ||
| 14 | #define MAX_MCA_BUSSES 2 | ||
| 15 | |||
| 16 | #define MCA_PRIMARY_BUS 0 | ||
| 17 | #define MCA_SECONDARY_BUS 1 | ||
| 18 | |||
| 19 | /* Dummy slot numbers on primary MCA for integrated functions */ | ||
| 20 | #define MCA_INTEGSCSI (MCA_MAX_SLOT_NR) | ||
| 21 | #define MCA_INTEGVIDEO (MCA_MAX_SLOT_NR+1) | ||
| 22 | #define MCA_MOTHERBOARD (MCA_MAX_SLOT_NR+2) | ||
| 23 | |||
| 24 | /* Dummy POS values for integrated functions */ | ||
| 25 | #define MCA_DUMMY_POS_START 0x10000 | ||
| 26 | #define MCA_INTEGSCSI_POS (MCA_DUMMY_POS_START+1) | ||
| 27 | #define MCA_INTEGVIDEO_POS (MCA_DUMMY_POS_START+2) | ||
| 28 | #define MCA_MOTHERBOARD_POS (MCA_DUMMY_POS_START+3) | ||
| 29 | |||
| 30 | /* MCA registers */ | ||
| 31 | |||
| 32 | #define MCA_MOTHERBOARD_SETUP_REG 0x94 | ||
| 33 | #define MCA_ADAPTER_SETUP_REG 0x96 | ||
| 34 | #define MCA_POS_REG(n) (0x100+(n)) | ||
| 35 | |||
| 36 | #define MCA_ENABLED 0x01 /* POS 2, set if adapter enabled */ | ||
| 37 | |||
| 38 | /* Max number of adapters, including both slots and various integrated | ||
| 39 | * things. | ||
| 40 | */ | ||
| 41 | #define MCA_NUMADAPTERS (MCA_MAX_SLOT_NR+3) | ||
| 42 | |||
| 43 | #endif /* _ASM_X86_MCA_H */ | ||
diff --git a/arch/x86/include/asm/mca_dma.h b/arch/x86/include/asm/mca_dma.h deleted file mode 100644 index 45271aef82dd..000000000000 --- a/arch/x86/include/asm/mca_dma.h +++ /dev/null | |||
| @@ -1,201 +0,0 @@ | |||
| 1 | #ifndef _ASM_X86_MCA_DMA_H | ||
| 2 | #define _ASM_X86_MCA_DMA_H | ||
| 3 | |||
| 4 | #include <asm/io.h> | ||
| 5 | #include <linux/ioport.h> | ||
| 6 | |||
| 7 | /* | ||
| 8 | * Microchannel specific DMA stuff. DMA on an MCA machine is fairly similar to | ||
| 9 | * standard PC dma, but it certainly has its quirks. DMA register addresses | ||
| 10 | * are in a different place and there are some added functions. Most of this | ||
| 11 | * should be pretty obvious on inspection. Note that the user must divide | ||
| 12 | * count by 2 when using 16-bit dma; that is not handled by these functions. | ||
| 13 | * | ||
| 14 | * Ramen Noodles are yummy. | ||
| 15 | * | ||
| 16 | * 1998 Tymm Twillman <tymm@computer.org> | ||
| 17 | */ | ||
| 18 | |||
| 19 | /* | ||
| 20 | * Registers that are used by the DMA controller; FN is the function register | ||
| 21 | * (tell the controller what to do) and EXE is the execution register (how | ||
| 22 | * to do it) | ||
| 23 | */ | ||
| 24 | |||
| 25 | #define MCA_DMA_REG_FN 0x18 | ||
| 26 | #define MCA_DMA_REG_EXE 0x1A | ||
| 27 | |||
| 28 | /* | ||
| 29 | * Functions that the DMA controller can do | ||
| 30 | */ | ||
| 31 | |||
| 32 | #define MCA_DMA_FN_SET_IO 0x00 | ||
| 33 | #define MCA_DMA_FN_SET_ADDR 0x20 | ||
| 34 | #define MCA_DMA_FN_GET_ADDR 0x30 | ||
| 35 | #define MCA_DMA_FN_SET_COUNT 0x40 | ||
| 36 | #define MCA_DMA_FN_GET_COUNT 0x50 | ||
| 37 | #define MCA_DMA_FN_GET_STATUS 0x60 | ||
| 38 | #define MCA_DMA_FN_SET_MODE 0x70 | ||
| 39 | #define MCA_DMA_FN_SET_ARBUS 0x80 | ||
| 40 | #define MCA_DMA_FN_MASK 0x90 | ||
| 41 | #define MCA_DMA_FN_RESET_MASK 0xA0 | ||
| 42 | #define MCA_DMA_FN_MASTER_CLEAR 0xD0 | ||
| 43 | |||
| 44 | /* | ||
| 45 | * Modes (used by setting MCA_DMA_FN_MODE in the function register) | ||
| 46 | * | ||
| 47 | * Note that the MODE_READ is read from memory (write to device), and | ||
| 48 | * MODE_WRITE is vice-versa. | ||
| 49 | */ | ||
| 50 | |||
| 51 | #define MCA_DMA_MODE_XFER 0x04 /* read by default */ | ||
| 52 | #define MCA_DMA_MODE_READ 0x04 /* same as XFER */ | ||
| 53 | #define MCA_DMA_MODE_WRITE 0x08 /* OR with MODE_XFER to use */ | ||
| 54 | #define MCA_DMA_MODE_IO 0x01 /* DMA from IO register */ | ||
| 55 | #define MCA_DMA_MODE_16 0x40 /* 16 bit xfers */ | ||
| 56 | |||
| 57 | |||
| 58 | /** | ||
| 59 | * mca_enable_dma - channel to enable DMA on | ||
| 60 | * @dmanr: DMA channel | ||
| 61 | * | ||
| 62 | * Enable the MCA bus DMA on a channel. This can be called from | ||
| 63 | * IRQ context. | ||
| 64 | */ | ||
| 65 | |||
| 66 | static inline void mca_enable_dma(unsigned int dmanr) | ||
| 67 | { | ||
| 68 | outb(MCA_DMA_FN_RESET_MASK | dmanr, MCA_DMA_REG_FN); | ||
| 69 | } | ||
| 70 | |||
| 71 | /** | ||
| 72 | * mca_disble_dma - channel to disable DMA on | ||
| 73 | * @dmanr: DMA channel | ||
| 74 | * | ||
| 75 | * Enable the MCA bus DMA on a channel. This can be called from | ||
| 76 | * IRQ context. | ||
| 77 | */ | ||
| 78 | |||
| 79 | static inline void mca_disable_dma(unsigned int dmanr) | ||
| 80 | { | ||
| 81 | outb(MCA_DMA_FN_MASK | dmanr, MCA_DMA_REG_FN); | ||
| 82 | } | ||
| 83 | |||
| 84 | /** | ||
| 85 | * mca_set_dma_addr - load a 24bit DMA address | ||
| 86 | * @dmanr: DMA channel | ||
| 87 | * @a: 24bit bus address | ||
| 88 | * | ||
| 89 | * Load the address register in the DMA controller. This has a 24bit | ||
| 90 | * limitation (16Mb). | ||
| 91 | */ | ||
| 92 | |||
| 93 | static inline void mca_set_dma_addr(unsigned int dmanr, unsigned int a) | ||
| 94 | { | ||
| 95 | outb(MCA_DMA_FN_SET_ADDR | dmanr, MCA_DMA_REG_FN); | ||
| 96 | outb(a & 0xff, MCA_DMA_REG_EXE); | ||
| 97 | outb((a >> 8) & 0xff, MCA_DMA_REG_EXE); | ||
| 98 | outb((a >> 16) & 0xff, MCA_DMA_REG_EXE); | ||
| 99 | } | ||
| 100 | |||
| 101 | /** | ||
| 102 | * mca_get_dma_addr - load a 24bit DMA address | ||
| 103 | * @dmanr: DMA channel | ||
| 104 | * | ||
| 105 | * Read the address register in the DMA controller. This has a 24bit | ||
| 106 | * limitation (16Mb). The return is a bus address. | ||
| 107 | */ | ||
| 108 | |||
| 109 | static inline unsigned int mca_get_dma_addr(unsigned int dmanr) | ||
| 110 | { | ||
| 111 | unsigned int addr; | ||
| 112 | |||
| 113 | outb(MCA_DMA_FN_GET_ADDR | dmanr, MCA_DMA_REG_FN); | ||
| 114 | addr = inb(MCA_DMA_REG_EXE); | ||
| 115 | addr |= inb(MCA_DMA_REG_EXE) << 8; | ||
| 116 | addr |= inb(MCA_DMA_REG_EXE) << 16; | ||
| 117 | |||
| 118 | return addr; | ||
| 119 | } | ||
| 120 | |||
| 121 | /** | ||
| 122 | * mca_set_dma_count - load a 16bit transfer count | ||
| 123 | * @dmanr: DMA channel | ||
| 124 | * @count: count | ||
| 125 | * | ||
| 126 | * Set the DMA count for this channel. This can be up to 64Kbytes. | ||
| 127 | * Setting a count of zero will not do what you expect. | ||
| 128 | */ | ||
| 129 | |||
| 130 | static inline void mca_set_dma_count(unsigned int dmanr, unsigned int count) | ||
| 131 | { | ||
| 132 | count--; /* transfers one more than count -- correct for this */ | ||
| 133 | |||
| 134 | outb(MCA_DMA_FN_SET_COUNT | dmanr, MCA_DMA_REG_FN); | ||
| 135 | outb(count & 0xff, MCA_DMA_REG_EXE); | ||
| 136 | outb((count >> 8) & 0xff, MCA_DMA_REG_EXE); | ||
| 137 | } | ||
| 138 | |||
| 139 | /** | ||
| 140 | * mca_get_dma_residue - get the remaining bytes to transfer | ||
| 141 | * @dmanr: DMA channel | ||
| 142 | * | ||
| 143 | * This function returns the number of bytes left to transfer | ||
| 144 | * on this DMA channel. | ||
| 145 | */ | ||
| 146 | |||
| 147 | static inline unsigned int mca_get_dma_residue(unsigned int dmanr) | ||
| 148 | { | ||
| 149 | unsigned short count; | ||
| 150 | |||
| 151 | outb(MCA_DMA_FN_GET_COUNT | dmanr, MCA_DMA_REG_FN); | ||
| 152 | count = 1 + inb(MCA_DMA_REG_EXE); | ||
| 153 | count += inb(MCA_DMA_REG_EXE) << 8; | ||
| 154 | |||
| 155 | return count; | ||
| 156 | } | ||
| 157 | |||
| 158 | /** | ||
| 159 | * mca_set_dma_io - set the port for an I/O transfer | ||
| 160 | * @dmanr: DMA channel | ||
| 161 | * @io_addr: an I/O port number | ||
| 162 | * | ||
| 163 | * Unlike the ISA bus DMA controllers the DMA on MCA bus can transfer | ||
| 164 | * with an I/O port target. | ||
| 165 | */ | ||
| 166 | |||
| 167 | static inline void mca_set_dma_io(unsigned int dmanr, unsigned int io_addr) | ||
| 168 | { | ||
| 169 | /* | ||
| 170 | * DMA from a port address -- set the io address | ||
| 171 | */ | ||
| 172 | |||
| 173 | outb(MCA_DMA_FN_SET_IO | dmanr, MCA_DMA_REG_FN); | ||
| 174 | outb(io_addr & 0xff, MCA_DMA_REG_EXE); | ||
| 175 | outb((io_addr >> 8) & 0xff, MCA_DMA_REG_EXE); | ||
| 176 | } | ||
| 177 | |||
| 178 | /** | ||
| 179 | * mca_set_dma_mode - set the DMA mode | ||
| 180 | * @dmanr: DMA channel | ||
| 181 | * @mode: mode to set | ||
| 182 | * | ||
| 183 | * The DMA controller supports several modes. The mode values you can | ||
| 184 | * set are- | ||
| 185 | * | ||
| 186 | * %MCA_DMA_MODE_READ when reading from the DMA device. | ||
| 187 | * | ||
| 188 | * %MCA_DMA_MODE_WRITE to writing to the DMA device. | ||
| 189 | * | ||
| 190 | * %MCA_DMA_MODE_IO to do DMA to or from an I/O port. | ||
| 191 | * | ||
| 192 | * %MCA_DMA_MODE_16 to do 16bit transfers. | ||
| 193 | */ | ||
| 194 | |||
| 195 | static inline void mca_set_dma_mode(unsigned int dmanr, unsigned int mode) | ||
| 196 | { | ||
| 197 | outb(MCA_DMA_FN_SET_MODE | dmanr, MCA_DMA_REG_FN); | ||
| 198 | outb(mode, MCA_DMA_REG_EXE); | ||
| 199 | } | ||
| 200 | |||
| 201 | #endif /* _ASM_X86_MCA_DMA_H */ | ||
diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h index 9c7d95f6174b..3e2f42a4b872 100644 --- a/arch/x86/include/asm/mpspec.h +++ b/arch/x86/include/asm/mpspec.h | |||
| @@ -40,7 +40,7 @@ extern int quad_local_to_mp_bus_id [NR_CPUS/4][4]; | |||
| 40 | 40 | ||
| 41 | #endif /* CONFIG_X86_64 */ | 41 | #endif /* CONFIG_X86_64 */ |
| 42 | 42 | ||
| 43 | #if defined(CONFIG_MCA) || defined(CONFIG_EISA) | 43 | #ifdef CONFIG_EISA |
| 44 | extern int mp_bus_id_to_type[MAX_MP_BUSSES]; | 44 | extern int mp_bus_id_to_type[MAX_MP_BUSSES]; |
| 45 | #endif | 45 | #endif |
| 46 | 46 | ||
diff --git a/arch/x86/include/asm/mpspec_def.h b/arch/x86/include/asm/mpspec_def.h index c0a955a9a087..b31f8c098271 100644 --- a/arch/x86/include/asm/mpspec_def.h +++ b/arch/x86/include/asm/mpspec_def.h | |||
| @@ -84,7 +84,7 @@ struct mpc_bus { | |||
| 84 | #define BUSTYPE_EISA "EISA" | 84 | #define BUSTYPE_EISA "EISA" |
| 85 | #define BUSTYPE_ISA "ISA" | 85 | #define BUSTYPE_ISA "ISA" |
| 86 | #define BUSTYPE_INTERN "INTERN" /* Internal BUS */ | 86 | #define BUSTYPE_INTERN "INTERN" /* Internal BUS */ |
| 87 | #define BUSTYPE_MCA "MCA" | 87 | #define BUSTYPE_MCA "MCA" /* Obsolete */ |
| 88 | #define BUSTYPE_VL "VL" /* Local bus */ | 88 | #define BUSTYPE_VL "VL" /* Local bus */ |
| 89 | #define BUSTYPE_PCI "PCI" | 89 | #define BUSTYPE_PCI "PCI" |
| 90 | #define BUSTYPE_PCMCIA "PCMCIA" | 90 | #define BUSTYPE_PCMCIA "PCMCIA" |
| @@ -169,6 +169,5 @@ enum mp_bustype { | |||
| 169 | MP_BUS_ISA = 1, | 169 | MP_BUS_ISA = 1, |
| 170 | MP_BUS_EISA, | 170 | MP_BUS_EISA, |
| 171 | MP_BUS_PCI, | 171 | MP_BUS_PCI, |
| 172 | MP_BUS_MCA, | ||
| 173 | }; | 172 | }; |
| 174 | #endif /* _ASM_X86_MPSPEC_DEF_H */ | 173 | #endif /* _ASM_X86_MPSPEC_DEF_H */ |
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index 532d2e090e6f..7d1569947204 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile | |||
| @@ -49,7 +49,6 @@ obj-y += cpu/ | |||
| 49 | obj-y += acpi/ | 49 | obj-y += acpi/ |
| 50 | obj-y += reboot.o | 50 | obj-y += reboot.o |
| 51 | obj-$(CONFIG_X86_32) += reboot_32.o | 51 | obj-$(CONFIG_X86_32) += reboot_32.o |
| 52 | obj-$(CONFIG_MCA) += mca_32.o | ||
| 53 | obj-$(CONFIG_X86_MSR) += msr.o | 52 | obj-$(CONFIG_X86_MSR) += msr.o |
| 54 | obj-$(CONFIG_X86_CPUID) += cpuid.o | 53 | obj-$(CONFIG_X86_CPUID) += cpuid.o |
| 55 | obj-$(CONFIG_PCI) += early-quirks.o | 54 | obj-$(CONFIG_PCI) += early-quirks.o |
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index a415b1f44365..f564b189de1a 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
| @@ -990,7 +990,7 @@ void __init mp_config_acpi_legacy_irqs(void) | |||
| 990 | int i; | 990 | int i; |
| 991 | struct mpc_intsrc mp_irq; | 991 | struct mpc_intsrc mp_irq; |
| 992 | 992 | ||
| 993 | #if defined (CONFIG_MCA) || defined (CONFIG_EISA) | 993 | #ifdef CONFIG_EISA |
| 994 | /* | 994 | /* |
| 995 | * Fabricate the legacy ISA bus (bus #31). | 995 | * Fabricate the legacy ISA bus (bus #31). |
| 996 | */ | 996 | */ |
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index e88300d8e80a..675e9045a3c5 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
| @@ -142,7 +142,7 @@ int mp_irq_entries; | |||
| 142 | /* GSI interrupts */ | 142 | /* GSI interrupts */ |
| 143 | static int nr_irqs_gsi = NR_IRQS_LEGACY; | 143 | static int nr_irqs_gsi = NR_IRQS_LEGACY; |
| 144 | 144 | ||
| 145 | #if defined (CONFIG_MCA) || defined (CONFIG_EISA) | 145 | #ifdef CONFIG_EISA |
| 146 | int mp_bus_id_to_type[MAX_MP_BUSSES]; | 146 | int mp_bus_id_to_type[MAX_MP_BUSSES]; |
| 147 | #endif | 147 | #endif |
| 148 | 148 | ||
| @@ -875,7 +875,7 @@ static int __init find_isa_irq_apic(int irq, int type) | |||
| 875 | return -1; | 875 | return -1; |
| 876 | } | 876 | } |
| 877 | 877 | ||
| 878 | #if defined(CONFIG_EISA) || defined(CONFIG_MCA) | 878 | #ifdef CONFIG_EISA |
| 879 | /* | 879 | /* |
| 880 | * EISA Edge/Level control register, ELCR | 880 | * EISA Edge/Level control register, ELCR |
| 881 | */ | 881 | */ |
| @@ -912,12 +912,6 @@ static int EISA_ELCR(unsigned int irq) | |||
| 912 | #define default_PCI_trigger(idx) (1) | 912 | #define default_PCI_trigger(idx) (1) |
| 913 | #define default_PCI_polarity(idx) (1) | 913 | #define default_PCI_polarity(idx) (1) |
| 914 | 914 | ||
| 915 | /* MCA interrupts are always polarity zero level triggered, | ||
| 916 | * when listed as conforming in the MP table. */ | ||
| 917 | |||
| 918 | #define default_MCA_trigger(idx) (1) | ||
| 919 | #define default_MCA_polarity(idx) default_ISA_polarity(idx) | ||
| 920 | |||
| 921 | static int irq_polarity(int idx) | 915 | static int irq_polarity(int idx) |
| 922 | { | 916 | { |
| 923 | int bus = mp_irqs[idx].srcbus; | 917 | int bus = mp_irqs[idx].srcbus; |
| @@ -975,7 +969,7 @@ static int irq_trigger(int idx) | |||
| 975 | trigger = default_ISA_trigger(idx); | 969 | trigger = default_ISA_trigger(idx); |
| 976 | else | 970 | else |
| 977 | trigger = default_PCI_trigger(idx); | 971 | trigger = default_PCI_trigger(idx); |
| 978 | #if defined(CONFIG_EISA) || defined(CONFIG_MCA) | 972 | #ifdef CONFIG_EISA |
| 979 | switch (mp_bus_id_to_type[bus]) { | 973 | switch (mp_bus_id_to_type[bus]) { |
| 980 | case MP_BUS_ISA: /* ISA pin */ | 974 | case MP_BUS_ISA: /* ISA pin */ |
| 981 | { | 975 | { |
| @@ -992,11 +986,6 @@ static int irq_trigger(int idx) | |||
| 992 | /* set before the switch */ | 986 | /* set before the switch */ |
| 993 | break; | 987 | break; |
| 994 | } | 988 | } |
| 995 | case MP_BUS_MCA: /* MCA pin */ | ||
| 996 | { | ||
| 997 | trigger = default_MCA_trigger(idx); | ||
| 998 | break; | ||
| 999 | } | ||
| 1000 | default: | 989 | default: |
| 1001 | { | 990 | { |
| 1002 | printk(KERN_WARNING "broken BIOS!!\n"); | 991 | printk(KERN_WARNING "broken BIOS!!\n"); |
diff --git a/arch/x86/kernel/mca_32.c b/arch/x86/kernel/mca_32.c deleted file mode 100644 index 7eb1e2b97827..000000000000 --- a/arch/x86/kernel/mca_32.c +++ /dev/null | |||
| @@ -1,476 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Written by Martin Kolinek, February 1996 | ||
| 3 | * | ||
| 4 | * Changes: | ||
| 5 | * | ||
| 6 | * Chris Beauregard July 28th, 1996 | ||
| 7 | * - Fixed up integrated SCSI detection | ||
| 8 | * | ||
| 9 | * Chris Beauregard August 3rd, 1996 | ||
| 10 | * - Made mca_info local | ||
| 11 | * - Made integrated registers accessible through standard function calls | ||
| 12 | * - Added name field | ||
| 13 | * - More sanity checking | ||
| 14 | * | ||
| 15 | * Chris Beauregard August 9th, 1996 | ||
| 16 | * - Rewrote /proc/mca | ||
| 17 | * | ||
| 18 | * Chris Beauregard January 7th, 1997 | ||
| 19 | * - Added basic NMI-processing | ||
| 20 | * - Added more information to mca_info structure | ||
| 21 | * | ||
| 22 | * David Weinehall October 12th, 1998 | ||
| 23 | * - Made a lot of cleaning up in the source | ||
| 24 | * - Added use of save_flags / restore_flags | ||
| 25 | * - Added the 'driver_loaded' flag in MCA_adapter | ||
| 26 | * - Added an alternative implemention of ZP Gu's mca_find_unused_adapter | ||
| 27 | * | ||
| 28 | * David Weinehall March 24th, 1999 | ||
| 29 | * - Fixed the output of 'Driver Installed' in /proc/mca/pos | ||
| 30 | * - Made the Integrated Video & SCSI show up even if they have id 0000 | ||
| 31 | * | ||
| 32 | * Alexander Viro November 9th, 1999 | ||
| 33 | * - Switched to regular procfs methods | ||
| 34 | * | ||
| 35 | * Alfred Arnold & David Weinehall August 23rd, 2000 | ||
| 36 | * - Added support for Planar POS-registers | ||
| 37 | */ | ||
| 38 | |||
| 39 | #include <linux/module.h> | ||
| 40 | #include <linux/types.h> | ||
| 41 | #include <linux/errno.h> | ||
| 42 | #include <linux/kernel.h> | ||
| 43 | #include <linux/mca.h> | ||
| 44 | #include <linux/kprobes.h> | ||
| 45 | #include <linux/slab.h> | ||
| 46 | #include <asm/io.h> | ||
| 47 | #include <linux/proc_fs.h> | ||
| 48 | #include <linux/mman.h> | ||
| 49 | #include <linux/mm.h> | ||
| 50 | #include <linux/pagemap.h> | ||
| 51 | #include <linux/ioport.h> | ||
| 52 | #include <asm/uaccess.h> | ||
| 53 | #include <linux/init.h> | ||
| 54 | |||
| 55 | static unsigned char which_scsi; | ||
| 56 | |||
| 57 | int MCA_bus; | ||
| 58 | EXPORT_SYMBOL(MCA_bus); | ||
| 59 | |||
| 60 | /* | ||
| 61 | * Motherboard register spinlock. Untested on SMP at the moment, but | ||
| 62 | * are there any MCA SMP boxes? | ||
| 63 | * | ||
| 64 | * Yes - Alan | ||
| 65 | */ | ||
| 66 | static DEFINE_SPINLOCK(mca_lock); | ||
| 67 | |||
| 68 | /* Build the status info for the adapter */ | ||
| 69 | |||
| 70 | static void mca_configure_adapter_status(struct mca_device *mca_dev) | ||
| 71 | { | ||
| 72 | mca_dev->status = MCA_ADAPTER_NONE; | ||
| 73 | |||
| 74 | mca_dev->pos_id = mca_dev->pos[0] | ||
| 75 | + (mca_dev->pos[1] << 8); | ||
| 76 | |||
| 77 | if (!mca_dev->pos_id && mca_dev->slot < MCA_MAX_SLOT_NR) { | ||
| 78 | |||
| 79 | /* | ||
| 80 | * id = 0x0000 usually indicates hardware failure, | ||
| 81 | * however, ZP Gu (zpg@castle.net> reports that his 9556 | ||
| 82 | * has 0x0000 as id and everything still works. There | ||
| 83 | * also seem to be an adapter with id = 0x0000; the | ||
| 84 | * NCR Parallel Bus Memory Card. Until this is confirmed, | ||
| 85 | * however, this code will stay. | ||
| 86 | */ | ||
| 87 | |||
| 88 | mca_dev->status = MCA_ADAPTER_ERROR; | ||
| 89 | |||
| 90 | return; | ||
| 91 | } else if (mca_dev->pos_id != 0xffff) { | ||
| 92 | |||
| 93 | /* | ||
| 94 | * 0xffff usually indicates that there's no adapter, | ||
| 95 | * however, some integrated adapters may have 0xffff as | ||
| 96 | * their id and still be valid. Examples are on-board | ||
| 97 | * VGA of the 55sx, the integrated SCSI of the 56 & 57, | ||
| 98 | * and possibly also the 95 ULTIMEDIA. | ||
| 99 | */ | ||
| 100 | |||
| 101 | mca_dev->status = MCA_ADAPTER_NORMAL; | ||
| 102 | } | ||
| 103 | |||
| 104 | if ((mca_dev->pos_id == 0xffff || | ||
| 105 | mca_dev->pos_id == 0x0000) && mca_dev->slot >= MCA_MAX_SLOT_NR) { | ||
| 106 | int j; | ||
| 107 | |||
| 108 | for (j = 2; j < 8; j++) { | ||
| 109 | if (mca_dev->pos[j] != 0xff) { | ||
| 110 | mca_dev->status = MCA_ADAPTER_NORMAL; | ||
| 111 | break; | ||
| 112 | } | ||
| 113 | } | ||
| 114 | } | ||
| 115 | |||
| 116 | if (!(mca_dev->pos[2] & MCA_ENABLED)) { | ||
| 117 | |||
| 118 | /* enabled bit is in POS 2 */ | ||
| 119 | |||
| 120 | mca_dev->status = MCA_ADAPTER_DISABLED; | ||
| 121 | } | ||
| 122 | } /* mca_configure_adapter_status */ | ||
| 123 | |||
| 124 | /*--------------------------------------------------------------------*/ | ||
| 125 | |||
| 126 | static struct resource mca_standard_resources[] = { | ||
| 127 | { .start = 0x60, .end = 0x60, .name = "system control port B (MCA)" }, | ||
| 128 | { .start = 0x90, .end = 0x90, .name = "arbitration (MCA)" }, | ||
| 129 | { .start = 0x91, .end = 0x91, .name = "card Select Feedback (MCA)" }, | ||
| 130 | { .start = 0x92, .end = 0x92, .name = "system Control port A (MCA)" }, | ||
| 131 | { .start = 0x94, .end = 0x94, .name = "system board setup (MCA)" }, | ||
| 132 | { .start = 0x96, .end = 0x97, .name = "POS (MCA)" }, | ||
| 133 | { .start = 0x100, .end = 0x107, .name = "POS (MCA)" } | ||
| 134 | }; | ||
| 135 | |||
| 136 | #define MCA_STANDARD_RESOURCES ARRAY_SIZE(mca_standard_resources) | ||
| 137 | |||
| 138 | /* | ||
| 139 | * mca_read_and_store_pos - read the POS registers into a memory buffer | ||
| 140 | * @pos: a char pointer to 8 bytes, contains the POS register value on | ||
| 141 | * successful return | ||
| 142 | * | ||
| 143 | * Returns 1 if a card actually exists (i.e. the pos isn't | ||
| 144 | * all 0xff) or 0 otherwise | ||
| 145 | */ | ||
| 146 | static int mca_read_and_store_pos(unsigned char *pos) | ||
| 147 | { | ||
| 148 | int j; | ||
| 149 | int found = 0; | ||
| 150 | |||
| 151 | for (j = 0; j < 8; j++) { | ||
| 152 | pos[j] = inb_p(MCA_POS_REG(j)); | ||
| 153 | if (pos[j] != 0xff) { | ||
| 154 | /* 0xff all across means no device. 0x00 means | ||
| 155 | * something's broken, but a device is | ||
| 156 | * probably there. However, if you get 0x00 | ||
| 157 | * from a motherboard register it won't matter | ||
| 158 | * what we find. For the record, on the | ||
| 159 | * 57SLC, the integrated SCSI adapter has | ||
| 160 | * 0xffff for the adapter ID, but nonzero for | ||
| 161 | * other registers. */ | ||
| 162 | |||
| 163 | found = 1; | ||
| 164 | } | ||
| 165 | } | ||
| 166 | return found; | ||
| 167 | } | ||
| 168 | |||
| 169 | static unsigned char mca_pc_read_pos(struct mca_device *mca_dev, int reg) | ||
| 170 | { | ||
| 171 | unsigned char byte; | ||
| 172 | unsigned long flags; | ||
| 173 | |||
| 174 | if (reg < 0 || reg >= 8) | ||
| 175 | return 0; | ||
| 176 | |||
| 177 | spin_lock_irqsave(&mca_lock, flags); | ||
| 178 | if (mca_dev->pos_register) { | ||
| 179 | /* Disable adapter setup, enable motherboard setup */ | ||
| 180 | |||
| 181 | outb_p(0, MCA_ADAPTER_SETUP_REG); | ||
| 182 | outb_p(mca_dev->pos_register, MCA_MOTHERBOARD_SETUP_REG); | ||
| 183 | |||
| 184 | byte = inb_p(MCA_POS_REG(reg)); | ||
| 185 | outb_p(0xff, MCA_MOTHERBOARD_SETUP_REG); | ||
| 186 | } else { | ||
| 187 | |||
| 188 | /* Make sure motherboard setup is off */ | ||
| 189 | |||
| 190 | outb_p(0xff, MCA_MOTHERBOARD_SETUP_REG); | ||
| 191 | |||
| 192 | /* Read the appropriate register */ | ||
| 193 | |||
| 194 | outb_p(0x8|(mca_dev->slot & 0xf), MCA_ADAPTER_SETUP_REG); | ||
| 195 | byte = inb_p(MCA_POS_REG(reg)); | ||
| 196 | outb_p(0, MCA_ADAPTER_SETUP_REG); | ||
| 197 | } | ||
| 198 | spin_unlock_irqrestore(&mca_lock, flags); | ||
| 199 | |||
| 200 | mca_dev->pos[reg] = byte; | ||
| 201 | |||
| 202 | return byte; | ||
| 203 | } | ||
| 204 | |||
| 205 | static void mca_pc_write_pos(struct mca_device *mca_dev, int reg, | ||
| 206 | unsigned char byte) | ||
| 207 | { | ||
| 208 | unsigned long flags; | ||
| 209 | |||
| 210 | if (reg < 0 || reg >= 8) | ||
| 211 | return; | ||
| 212 | |||
| 213 | spin_lock_irqsave(&mca_lock, flags); | ||
| 214 | |||
| 215 | /* Make sure motherboard setup is off */ | ||
| 216 | |||
| 217 | outb_p(0xff, MCA_MOTHERBOARD_SETUP_REG); | ||
| 218 | |||
| 219 | /* Read in the appropriate register */ | ||
| 220 | |||
| 221 | outb_p(0x8|(mca_dev->slot&0xf), MCA_ADAPTER_SETUP_REG); | ||
| 222 | outb_p(byte, MCA_POS_REG(reg)); | ||
| 223 | outb_p(0, MCA_ADAPTER_SETUP_REG); | ||
| 224 | |||
| 225 | spin_unlock_irqrestore(&mca_lock, flags); | ||
| 226 | |||
| 227 | /* Update the global register list, while we have the byte */ | ||
| 228 | |||
| 229 | mca_dev->pos[reg] = byte; | ||
| 230 | |||
| 231 | } | ||
| 232 | |||
| 233 | /* for the primary MCA bus, we have identity transforms */ | ||
| 234 | static int mca_dummy_transform_irq(struct mca_device *mca_dev, int irq) | ||
| 235 | { | ||
| 236 | return irq; | ||
| 237 | } | ||
| 238 | |||
| 239 | static int mca_dummy_transform_ioport(struct mca_device *mca_dev, int port) | ||
| 240 | { | ||
| 241 | return port; | ||
| 242 | } | ||
| 243 | |||
| 244 | static void *mca_dummy_transform_memory(struct mca_device *mca_dev, void *mem) | ||
| 245 | { | ||
| 246 | return mem; | ||
| 247 | } | ||
| 248 | |||
| 249 | |||
| 250 | static int __init mca_init(void) | ||
| 251 | { | ||
| 252 | unsigned int i, j; | ||
| 253 | struct mca_device *mca_dev; | ||
| 254 | unsigned char pos[8]; | ||
| 255 | short mca_builtin_scsi_ports[] = {0xf7, 0xfd, 0x00}; | ||
| 256 | struct mca_bus *bus; | ||
| 257 | |||
| 258 | /* | ||
| 259 | * WARNING: Be careful when making changes here. Putting an adapter | ||
| 260 | * and the motherboard simultaneously into setup mode may result in | ||
| 261 | * damage to chips (according to The Indispensable PC Hardware Book | ||
| 262 | * by Hans-Peter Messmer). Also, we disable system interrupts (so | ||
| 263 | * that we are not disturbed in the middle of this). | ||
| 264 | */ | ||
| 265 | |||
| 266 | /* Make sure the MCA bus is present */ | ||
| 267 | |||
| 268 | if (mca_system_init()) { | ||
| 269 | printk(KERN_ERR "MCA bus system initialisation failed\n"); | ||
| 270 | return -ENODEV; | ||
| 271 | } | ||
| 272 | |||
| 273 | if (!MCA_bus) | ||
| 274 | return -ENODEV; | ||
| 275 | |||
| 276 | printk(KERN_INFO "Micro Channel bus detected.\n"); | ||
| 277 | |||
| 278 | /* All MCA systems have at least a primary bus */ | ||
| 279 | bus = mca_attach_bus(MCA_PRIMARY_BUS); | ||
| 280 | if (!bus) | ||
| 281 | goto out_nomem; | ||
| 282 | bus->default_dma_mask = 0xffffffffLL; | ||
| 283 | bus->f.mca_write_pos = mca_pc_write_pos; | ||
| 284 | bus->f.mca_read_pos = mca_pc_read_pos; | ||
| 285 | bus->f.mca_transform_irq = mca_dummy_transform_irq; | ||
| 286 | bus->f.mca_transform_ioport = mca_dummy_transform_ioport; | ||
| 287 | bus->f.mca_transform_memory = mca_dummy_transform_memory; | ||
| 288 | |||
| 289 | /* get the motherboard device */ | ||
| 290 | mca_dev = kzalloc(sizeof(struct mca_device), GFP_KERNEL); | ||
| 291 | if (unlikely(!mca_dev)) | ||
| 292 | goto out_nomem; | ||
| 293 | |||
| 294 | /* | ||
| 295 | * We do not expect many MCA interrupts during initialization, | ||
| 296 | * but let us be safe: | ||
| 297 | */ | ||
| 298 | spin_lock_irq(&mca_lock); | ||
| 299 | |||
| 300 | /* Make sure adapter setup is off */ | ||
| 301 | |||
| 302 | outb_p(0, MCA_ADAPTER_SETUP_REG); | ||
| 303 | |||
| 304 | /* Read motherboard POS registers */ | ||
| 305 | |||
| 306 | mca_dev->pos_register = 0x7f; | ||
| 307 | outb_p(mca_dev->pos_register, MCA_MOTHERBOARD_SETUP_REG); | ||
| 308 | mca_dev->name[0] = 0; | ||
| 309 | mca_read_and_store_pos(mca_dev->pos); | ||
| 310 | mca_configure_adapter_status(mca_dev); | ||
| 311 | /* fake POS and slot for a motherboard */ | ||
| 312 | mca_dev->pos_id = MCA_MOTHERBOARD_POS; | ||
| 313 | mca_dev->slot = MCA_MOTHERBOARD; | ||
| 314 | mca_register_device(MCA_PRIMARY_BUS, mca_dev); | ||
| 315 | |||
| 316 | mca_dev = kzalloc(sizeof(struct mca_device), GFP_ATOMIC); | ||
| 317 | if (unlikely(!mca_dev)) | ||
| 318 | goto out_unlock_nomem; | ||
| 319 | |||
| 320 | /* Put motherboard into video setup mode, read integrated video | ||
| 321 | * POS registers, and turn motherboard setup off. | ||
| 322 | */ | ||
| 323 | |||
| 324 | mca_dev->pos_register = 0xdf; | ||
| 325 | outb_p(mca_dev->pos_register, MCA_MOTHERBOARD_SETUP_REG); | ||
| 326 | mca_dev->name[0] = 0; | ||
| 327 | mca_read_and_store_pos(mca_dev->pos); | ||
| 328 | mca_configure_adapter_status(mca_dev); | ||
| 329 | /* fake POS and slot for the integrated video */ | ||
| 330 | mca_dev->pos_id = MCA_INTEGVIDEO_POS; | ||
| 331 | mca_dev->slot = MCA_INTEGVIDEO; | ||
| 332 | mca_register_device(MCA_PRIMARY_BUS, mca_dev); | ||
| 333 | |||
| 334 | /* | ||
| 335 | * Put motherboard into scsi setup mode, read integrated scsi | ||
| 336 | * POS registers, and turn motherboard setup off. | ||
| 337 | * | ||
| 338 | * It seems there are two possible SCSI registers. Martin says that | ||
| 339 | * for the 56,57, 0xf7 is the one, but fails on the 76. | ||
| 340 | * Alfredo (apena@vnet.ibm.com) says | ||
| 341 | * 0xfd works on his machine. We'll try both of them. I figure it's | ||
| 342 | * a good bet that only one could be valid at a time. This could | ||
| 343 | * screw up though if one is used for something else on the other | ||
| 344 | * machine. | ||
| 345 | */ | ||
| 346 | |||
| 347 | for (i = 0; (which_scsi = mca_builtin_scsi_ports[i]) != 0; i++) { | ||
| 348 | outb_p(which_scsi, MCA_MOTHERBOARD_SETUP_REG); | ||
| 349 | if (mca_read_and_store_pos(pos)) | ||
| 350 | break; | ||
| 351 | } | ||
| 352 | if (which_scsi) { | ||
| 353 | /* found a scsi card */ | ||
| 354 | mca_dev = kzalloc(sizeof(struct mca_device), GFP_ATOMIC); | ||
| 355 | if (unlikely(!mca_dev)) | ||
| 356 | goto out_unlock_nomem; | ||
| 357 | |||
| 358 | for (j = 0; j < 8; j++) | ||
| 359 | mca_dev->pos[j] = pos[j]; | ||
| 360 | |||
| 361 | mca_configure_adapter_status(mca_dev); | ||
| 362 | /* fake POS and slot for integrated SCSI controller */ | ||
| 363 | mca_dev->pos_id = MCA_INTEGSCSI_POS; | ||
| 364 | mca_dev->slot = MCA_INTEGSCSI; | ||
| 365 | mca_dev->pos_register = which_scsi; | ||
| 366 | mca_register_device(MCA_PRIMARY_BUS, mca_dev); | ||
| 367 | } | ||
| 368 | |||
| 369 | /* Turn off motherboard setup */ | ||
| 370 | |||
| 371 | outb_p(0xff, MCA_MOTHERBOARD_SETUP_REG); | ||
| 372 | |||
| 373 | /* | ||
| 374 | * Now loop over MCA slots: put each adapter into setup mode, and | ||
| 375 | * read its POS registers. Then put adapter setup off. | ||
| 376 | */ | ||
| 377 | |||
| 378 | for (i = 0; i < MCA_MAX_SLOT_NR; i++) { | ||
| 379 | outb_p(0x8|(i&0xf), MCA_ADAPTER_SETUP_REG); | ||
| 380 | if (!mca_read_and_store_pos(pos)) | ||
| 381 | continue; | ||
| 382 | |||
| 383 | mca_dev = kzalloc(sizeof(struct mca_device), GFP_ATOMIC); | ||
| 384 | if (unlikely(!mca_dev)) | ||
| 385 | goto out_unlock_nomem; | ||
| 386 | |||
| 387 | for (j = 0; j < 8; j++) | ||
| 388 | mca_dev->pos[j] = pos[j]; | ||
| 389 | |||
| 390 | mca_dev->driver_loaded = 0; | ||
| 391 | mca_dev->slot = i; | ||
| 392 | mca_dev->pos_register = 0; | ||
| 393 | mca_configure_adapter_status(mca_dev); | ||
| 394 | mca_register_device(MCA_PRIMARY_BUS, mca_dev); | ||
| 395 | } | ||
| 396 | outb_p(0, MCA_ADAPTER_SETUP_REG); | ||
| 397 | |||
| 398 | /* Enable interrupts and return memory start */ | ||
| 399 | spin_unlock_irq(&mca_lock); | ||
| 400 | |||
| 401 | for (i = 0; i < MCA_STANDARD_RESOURCES; i++) | ||
| 402 | request_resource(&ioport_resource, mca_standard_resources + i); | ||
| 403 | |||
| 404 | mca_do_proc_init(); | ||
| 405 | |||
| 406 | return 0; | ||
| 407 | |||
| 408 | out_unlock_nomem: | ||
| 409 | spin_unlock_irq(&mca_lock); | ||
| 410 | out_nomem: | ||
| 411 | printk(KERN_EMERG "Failed memory allocation in MCA setup!\n"); | ||
| 412 | return -ENOMEM; | ||
| 413 | } | ||
| 414 | |||
| 415 | subsys_initcall(mca_init); | ||
| 416 | |||
| 417 | /*--------------------------------------------------------------------*/ | ||
| 418 | |||
| 419 | static __kprobes void | ||
| 420 | mca_handle_nmi_device(struct mca_device *mca_dev, int check_flag) | ||
| 421 | { | ||
| 422 | int slot = mca_dev->slot; | ||
| 423 | |||
| 424 | if (slot == MCA_INTEGSCSI) { | ||
| 425 | printk(KERN_CRIT "NMI: caused by MCA integrated SCSI adapter (%s)\n", | ||
| 426 | mca_dev->name); | ||
| 427 | } else if (slot == MCA_INTEGVIDEO) { | ||
| 428 | printk(KERN_CRIT "NMI: caused by MCA integrated video adapter (%s)\n", | ||
| 429 | mca_dev->name); | ||
| 430 | } else if (slot == MCA_MOTHERBOARD) { | ||
| 431 | printk(KERN_CRIT "NMI: caused by motherboard (%s)\n", | ||
| 432 | mca_dev->name); | ||
| 433 | } | ||
| 434 | |||
| 435 | /* More info available in POS 6 and 7? */ | ||
| 436 | |||
| 437 | if (check_flag) { | ||
| 438 | unsigned char pos6, pos7; | ||
| 439 | |||
| 440 | pos6 = mca_device_read_pos(mca_dev, 6); | ||
| 441 | pos7 = mca_device_read_pos(mca_dev, 7); | ||
| 442 | |||
| 443 | printk(KERN_CRIT "NMI: POS 6 = 0x%x, POS 7 = 0x%x\n", pos6, pos7); | ||
| 444 | } | ||
| 445 | |||
| 446 | } /* mca_handle_nmi_slot */ | ||
| 447 | |||
| 448 | /*--------------------------------------------------------------------*/ | ||
| 449 | |||
| 450 | static int __kprobes mca_handle_nmi_callback(struct device *dev, void *data) | ||
| 451 | { | ||
| 452 | struct mca_device *mca_dev = to_mca_device(dev); | ||
| 453 | unsigned char pos5; | ||
| 454 | |||
| 455 | pos5 = mca_device_read_pos(mca_dev, 5); | ||
| 456 | |||
| 457 | if (!(pos5 & 0x80)) { | ||
| 458 | /* | ||
| 459 | * Bit 7 of POS 5 is reset when this adapter has a hardware | ||
| 460 | * error. Bit 7 it reset if there's error information | ||
| 461 | * available in POS 6 and 7. | ||
| 462 | */ | ||
| 463 | mca_handle_nmi_device(mca_dev, !(pos5 & 0x40)); | ||
| 464 | return 1; | ||
| 465 | } | ||
| 466 | return 0; | ||
| 467 | } | ||
| 468 | |||
| 469 | void __kprobes mca_handle_nmi(void) | ||
| 470 | { | ||
| 471 | /* | ||
| 472 | * First try - scan the various adapters and see if a specific | ||
| 473 | * adapter was responsible for the error. | ||
| 474 | */ | ||
| 475 | bus_for_each_dev(&mca_bus_type, NULL, NULL, mca_handle_nmi_callback); | ||
| 476 | } | ||
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c index ca470e4c92dc..b02d4dd6b8a3 100644 --- a/arch/x86/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse.c | |||
| @@ -97,7 +97,7 @@ static void __init MP_bus_info(struct mpc_bus *m) | |||
| 97 | 97 | ||
| 98 | set_bit(m->busid, mp_bus_not_pci); | 98 | set_bit(m->busid, mp_bus_not_pci); |
| 99 | if (strncmp(str, BUSTYPE_ISA, sizeof(BUSTYPE_ISA) - 1) == 0) { | 99 | if (strncmp(str, BUSTYPE_ISA, sizeof(BUSTYPE_ISA) - 1) == 0) { |
| 100 | #if defined(CONFIG_EISA) || defined(CONFIG_MCA) | 100 | #ifdef CONFIG_EISA |
| 101 | mp_bus_id_to_type[m->busid] = MP_BUS_ISA; | 101 | mp_bus_id_to_type[m->busid] = MP_BUS_ISA; |
| 102 | #endif | 102 | #endif |
| 103 | } else if (strncmp(str, BUSTYPE_PCI, sizeof(BUSTYPE_PCI) - 1) == 0) { | 103 | } else if (strncmp(str, BUSTYPE_PCI, sizeof(BUSTYPE_PCI) - 1) == 0) { |
| @@ -105,12 +105,10 @@ static void __init MP_bus_info(struct mpc_bus *m) | |||
| 105 | x86_init.mpparse.mpc_oem_pci_bus(m); | 105 | x86_init.mpparse.mpc_oem_pci_bus(m); |
| 106 | 106 | ||
| 107 | clear_bit(m->busid, mp_bus_not_pci); | 107 | clear_bit(m->busid, mp_bus_not_pci); |
| 108 | #if defined(CONFIG_EISA) || defined(CONFIG_MCA) | 108 | #ifdef CONFIG_EISA |
| 109 | mp_bus_id_to_type[m->busid] = MP_BUS_PCI; | 109 | mp_bus_id_to_type[m->busid] = MP_BUS_PCI; |
| 110 | } else if (strncmp(str, BUSTYPE_EISA, sizeof(BUSTYPE_EISA) - 1) == 0) { | 110 | } else if (strncmp(str, BUSTYPE_EISA, sizeof(BUSTYPE_EISA) - 1) == 0) { |
| 111 | mp_bus_id_to_type[m->busid] = MP_BUS_EISA; | 111 | mp_bus_id_to_type[m->busid] = MP_BUS_EISA; |
| 112 | } else if (strncmp(str, BUSTYPE_MCA, sizeof(BUSTYPE_MCA) - 1) == 0) { | ||
| 113 | mp_bus_id_to_type[m->busid] = MP_BUS_MCA; | ||
| 114 | #endif | 112 | #endif |
| 115 | } else | 113 | } else |
| 116 | printk(KERN_WARNING "Unknown bustype %s - ignoring\n", str); | 114 | printk(KERN_WARNING "Unknown bustype %s - ignoring\n", str); |
| @@ -368,9 +366,6 @@ static void __init construct_ioapic_table(int mpc_default_type) | |||
| 368 | case 3: | 366 | case 3: |
| 369 | memcpy(bus.bustype, "EISA ", 6); | 367 | memcpy(bus.bustype, "EISA ", 6); |
| 370 | break; | 368 | break; |
| 371 | case 4: | ||
| 372 | case 7: | ||
| 373 | memcpy(bus.bustype, "MCA ", 6); | ||
| 374 | } | 369 | } |
| 375 | MP_bus_info(&bus); | 370 | MP_bus_info(&bus); |
| 376 | if (mpc_default_type > 4) { | 371 | if (mpc_default_type > 4) { |
| @@ -623,7 +618,7 @@ void __init default_find_smp_config(void) | |||
| 623 | return; | 618 | return; |
| 624 | /* | 619 | /* |
| 625 | * If it is an SMP machine we should know now, unless the | 620 | * If it is an SMP machine we should know now, unless the |
| 626 | * configuration is in an EISA/MCA bus machine with an | 621 | * configuration is in an EISA bus machine with an |
| 627 | * extended bios data area. | 622 | * extended bios data area. |
| 628 | * | 623 | * |
| 629 | * there is a real-mode segmented pointer pointing to the | 624 | * there is a real-mode segmented pointer pointing to the |
diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c index 47acaf319165..7b3fdfdabf94 100644 --- a/arch/x86/kernel/nmi.c +++ b/arch/x86/kernel/nmi.c | |||
| @@ -19,8 +19,6 @@ | |||
| 19 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
| 20 | #include <linux/export.h> | 20 | #include <linux/export.h> |
| 21 | 21 | ||
| 22 | #include <linux/mca.h> | ||
| 23 | |||
| 24 | #if defined(CONFIG_EDAC) | 22 | #if defined(CONFIG_EDAC) |
| 25 | #include <linux/edac.h> | 23 | #include <linux/edac.h> |
| 26 | #endif | 24 | #endif |
| @@ -282,16 +280,6 @@ unknown_nmi_error(unsigned char reason, struct pt_regs *regs) | |||
| 282 | 280 | ||
| 283 | __this_cpu_add(nmi_stats.unknown, 1); | 281 | __this_cpu_add(nmi_stats.unknown, 1); |
| 284 | 282 | ||
| 285 | #ifdef CONFIG_MCA | ||
| 286 | /* | ||
| 287 | * Might actually be able to figure out what the guilty party | ||
| 288 | * is: | ||
| 289 | */ | ||
| 290 | if (MCA_bus) { | ||
| 291 | mca_handle_nmi(); | ||
| 292 | return; | ||
| 293 | } | ||
| 294 | #endif | ||
| 295 | pr_emerg("Uhhuh. NMI received for unknown reason %02x on CPU %d.\n", | 283 | pr_emerg("Uhhuh. NMI received for unknown reason %02x on CPU %d.\n", |
| 296 | reason, smp_processor_id()); | 284 | reason, smp_processor_id()); |
| 297 | 285 | ||
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 1a2901562059..879166402bf9 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
| @@ -34,7 +34,6 @@ | |||
| 34 | #include <linux/memblock.h> | 34 | #include <linux/memblock.h> |
| 35 | #include <linux/seq_file.h> | 35 | #include <linux/seq_file.h> |
| 36 | #include <linux/console.h> | 36 | #include <linux/console.h> |
| 37 | #include <linux/mca.h> | ||
| 38 | #include <linux/root_dev.h> | 37 | #include <linux/root_dev.h> |
| 39 | #include <linux/highmem.h> | 38 | #include <linux/highmem.h> |
| 40 | #include <linux/module.h> | 39 | #include <linux/module.h> |
| @@ -179,12 +178,6 @@ struct cpuinfo_x86 new_cpu_data __cpuinitdata = {0, 0, 0, 0, -1, 1, 0, 0, -1}; | |||
| 179 | /* common cpu data for all cpus */ | 178 | /* common cpu data for all cpus */ |
| 180 | struct cpuinfo_x86 boot_cpu_data __read_mostly = {0, 0, 0, 0, -1, 1, 0, 0, -1}; | 179 | struct cpuinfo_x86 boot_cpu_data __read_mostly = {0, 0, 0, 0, -1, 1, 0, 0, -1}; |
| 181 | EXPORT_SYMBOL(boot_cpu_data); | 180 | EXPORT_SYMBOL(boot_cpu_data); |
| 182 | static void set_mca_bus(int x) | ||
| 183 | { | ||
| 184 | #ifdef CONFIG_MCA | ||
| 185 | MCA_bus = x; | ||
| 186 | #endif | ||
| 187 | } | ||
| 188 | 181 | ||
| 189 | unsigned int def_to_bigsmp; | 182 | unsigned int def_to_bigsmp; |
| 190 | 183 | ||
| @@ -717,7 +710,6 @@ void __init setup_arch(char **cmdline_p) | |||
| 717 | apm_info.bios = boot_params.apm_bios_info; | 710 | apm_info.bios = boot_params.apm_bios_info; |
| 718 | ist_info = boot_params.ist_info; | 711 | ist_info = boot_params.ist_info; |
| 719 | if (boot_params.sys_desc_table.length != 0) { | 712 | if (boot_params.sys_desc_table.length != 0) { |
| 720 | set_mca_bus(boot_params.sys_desc_table.table[3] & 0x2); | ||
| 721 | machine_id = boot_params.sys_desc_table.table[0]; | 713 | machine_id = boot_params.sys_desc_table.table[0]; |
| 722 | machine_submodel_id = boot_params.sys_desc_table.table[1]; | 714 | machine_submodel_id = boot_params.sys_desc_table.table[1]; |
| 723 | BIOS_revision = boot_params.sys_desc_table.table[2]; | 715 | BIOS_revision = boot_params.sys_desc_table.table[2]; |
diff --git a/arch/x86/kernel/time.c b/arch/x86/kernel/time.c index c6eba2b42673..24d3c91e9812 100644 --- a/arch/x86/kernel/time.c +++ b/arch/x86/kernel/time.c | |||
| @@ -14,7 +14,6 @@ | |||
| 14 | #include <linux/i8253.h> | 14 | #include <linux/i8253.h> |
| 15 | #include <linux/time.h> | 15 | #include <linux/time.h> |
| 16 | #include <linux/export.h> | 16 | #include <linux/export.h> |
| 17 | #include <linux/mca.h> | ||
| 18 | 17 | ||
| 19 | #include <asm/vsyscall.h> | 18 | #include <asm/vsyscall.h> |
| 20 | #include <asm/x86_init.h> | 19 | #include <asm/x86_init.h> |
| @@ -58,11 +57,6 @@ EXPORT_SYMBOL(profile_pc); | |||
| 58 | static irqreturn_t timer_interrupt(int irq, void *dev_id) | 57 | static irqreturn_t timer_interrupt(int irq, void *dev_id) |
| 59 | { | 58 | { |
| 60 | global_clock_event->event_handler(global_clock_event); | 59 | global_clock_event->event_handler(global_clock_event); |
| 61 | |||
| 62 | /* MCA bus quirk: Acknowledge irq0 by setting bit 7 in port 0x61 */ | ||
| 63 | if (MCA_bus) | ||
| 64 | outb_p(inb_p(0x61)| 0x80, 0x61); | ||
| 65 | |||
| 66 | return IRQ_HANDLED; | 60 | return IRQ_HANDLED; |
| 67 | } | 61 | } |
| 68 | 62 | ||
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c index ff9281f16029..4754f510b360 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c | |||
| @@ -37,10 +37,6 @@ | |||
| 37 | #include <linux/eisa.h> | 37 | #include <linux/eisa.h> |
| 38 | #endif | 38 | #endif |
| 39 | 39 | ||
| 40 | #ifdef CONFIG_MCA | ||
| 41 | #include <linux/mca.h> | ||
| 42 | #endif | ||
| 43 | |||
| 44 | #if defined(CONFIG_EDAC) | 40 | #if defined(CONFIG_EDAC) |
| 45 | #include <linux/edac.h> | 41 | #include <linux/edac.h> |
| 46 | #endif | 42 | #endif |
diff --git a/drivers/Makefile b/drivers/Makefile index 95952c82bf16..f9b82f2c7c47 100644 --- a/drivers/Makefile +++ b/drivers/Makefile | |||
| @@ -92,7 +92,6 @@ obj-$(CONFIG_BT) += bluetooth/ | |||
| 92 | obj-$(CONFIG_ACCESSIBILITY) += accessibility/ | 92 | obj-$(CONFIG_ACCESSIBILITY) += accessibility/ |
| 93 | obj-$(CONFIG_ISDN) += isdn/ | 93 | obj-$(CONFIG_ISDN) += isdn/ |
| 94 | obj-$(CONFIG_EDAC) += edac/ | 94 | obj-$(CONFIG_EDAC) += edac/ |
| 95 | obj-$(CONFIG_MCA) += mca/ | ||
| 96 | obj-$(CONFIG_EISA) += eisa/ | 95 | obj-$(CONFIG_EISA) += eisa/ |
| 97 | obj-y += lguest/ | 96 | obj-y += lguest/ |
| 98 | obj-$(CONFIG_CPU_FREQ) += cpufreq/ | 97 | obj-$(CONFIG_CPU_FREQ) += cpufreq/ |
diff --git a/drivers/mca/Kconfig b/drivers/mca/Kconfig deleted file mode 100644 index a7a0220ab4bd..000000000000 --- a/drivers/mca/Kconfig +++ /dev/null | |||
| @@ -1,14 +0,0 @@ | |||
| 1 | config MCA_LEGACY | ||
| 2 | bool "Legacy MCA API Support" | ||
| 3 | depends on MCA | ||
| 4 | help | ||
| 5 | This compiles in support for the old slot based MCA API. If you | ||
| 6 | have an unconverted MCA driver, you will need to say Y here. It | ||
| 7 | is safe to say Y anyway. | ||
| 8 | |||
| 9 | config MCA_PROC_FS | ||
| 10 | bool "Support for the mca entry in /proc" | ||
| 11 | depends on MCA_LEGACY && PROC_FS | ||
| 12 | help | ||
| 13 | If you want the old style /proc/mca directory in addition to the | ||
| 14 | new style sysfs say Y here. | ||
diff --git a/drivers/mca/Makefile b/drivers/mca/Makefile deleted file mode 100644 index 0794b122520e..000000000000 --- a/drivers/mca/Makefile +++ /dev/null | |||
| @@ -1,7 +0,0 @@ | |||
| 1 | # Makefile for the Linux MCA bus support | ||
| 2 | |||
| 3 | obj-y := mca-bus.o mca-device.o mca-driver.o | ||
| 4 | |||
| 5 | obj-$(CONFIG_MCA_PROC_FS) += mca-proc.o | ||
| 6 | obj-$(CONFIG_MCA_LEGACY) += mca-legacy.o | ||
| 7 | |||
diff --git a/drivers/mca/mca-bus.c b/drivers/mca/mca-bus.c deleted file mode 100644 index ada5ebbaa255..000000000000 --- a/drivers/mca/mca-bus.c +++ /dev/null | |||
| @@ -1,169 +0,0 @@ | |||
| 1 | /* -*- mode: c; c-basic-offset: 8 -*- */ | ||
| 2 | |||
| 3 | /* | ||
| 4 | * MCA bus support functions for sysfs. | ||
| 5 | * | ||
| 6 | * (C) 2002 James Bottomley <James.Bottomley@HansenPartnership.com> | ||
| 7 | * | ||
| 8 | **----------------------------------------------------------------------------- | ||
| 9 | ** | ||
| 10 | ** This program is free software; you can redistribute it and/or modify | ||
| 11 | ** it under the terms of the GNU General Public License as published by | ||
| 12 | ** the Free Software Foundation; either version 2 of the License, or | ||
| 13 | ** (at your option) any later version. | ||
| 14 | ** | ||
| 15 | ** This program is distributed in the hope that it will be useful, | ||
| 16 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 17 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 18 | ** GNU General Public License for more details. | ||
| 19 | ** | ||
| 20 | ** You should have received a copy of the GNU General Public License | ||
| 21 | ** along with this program; if not, write to the Free Software | ||
| 22 | ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 23 | ** | ||
| 24 | **----------------------------------------------------------------------------- | ||
| 25 | */ | ||
| 26 | |||
| 27 | #include <linux/kernel.h> | ||
| 28 | #include <linux/device.h> | ||
| 29 | #include <linux/mca.h> | ||
| 30 | #include <linux/module.h> | ||
| 31 | #include <linux/init.h> | ||
| 32 | #include <linux/slab.h> | ||
| 33 | |||
| 34 | /* Very few machines have more than one MCA bus. However, there are | ||
| 35 | * those that do (Voyager 35xx/5xxx), so we do it this way for future | ||
| 36 | * expansion. None that I know have more than 2 */ | ||
| 37 | static struct mca_bus *mca_root_busses[MAX_MCA_BUSSES]; | ||
| 38 | |||
| 39 | #define MCA_DEVINFO(i,s) { .pos = i, .name = s } | ||
| 40 | |||
| 41 | struct mca_device_info { | ||
| 42 | short pos_id; /* the 2 byte pos id for this card */ | ||
| 43 | char name[50]; | ||
| 44 | }; | ||
| 45 | |||
| 46 | static int mca_bus_match (struct device *dev, struct device_driver *drv) | ||
| 47 | { | ||
| 48 | struct mca_device *mca_dev = to_mca_device (dev); | ||
| 49 | struct mca_driver *mca_drv = to_mca_driver (drv); | ||
| 50 | const unsigned short *mca_ids = mca_drv->id_table; | ||
| 51 | int i = 0; | ||
| 52 | |||
| 53 | if (mca_ids) { | ||
| 54 | for(i = 0; mca_ids[i]; i++) { | ||
| 55 | if (mca_ids[i] == mca_dev->pos_id) { | ||
| 56 | mca_dev->index = i; | ||
| 57 | return 1; | ||
| 58 | } | ||
| 59 | } | ||
| 60 | } | ||
| 61 | /* If the integrated id is present, treat it as though it were an | ||
| 62 | * additional id in the id_table (it can't be because by definition, | ||
| 63 | * integrated id's overflow a short */ | ||
| 64 | if (mca_drv->integrated_id && mca_dev->pos_id == | ||
| 65 | mca_drv->integrated_id) { | ||
| 66 | mca_dev->index = i; | ||
| 67 | return 1; | ||
| 68 | } | ||
| 69 | return 0; | ||
| 70 | } | ||
| 71 | |||
| 72 | struct bus_type mca_bus_type = { | ||
| 73 | .name = "MCA", | ||
| 74 | .match = mca_bus_match, | ||
| 75 | }; | ||
| 76 | EXPORT_SYMBOL (mca_bus_type); | ||
| 77 | |||
| 78 | static ssize_t mca_show_pos_id(struct device *dev, struct device_attribute *attr, char *buf) | ||
| 79 | { | ||
| 80 | /* four digits, \n and trailing \0 */ | ||
| 81 | struct mca_device *mca_dev = to_mca_device(dev); | ||
| 82 | int len; | ||
| 83 | |||
| 84 | if(mca_dev->pos_id < MCA_DUMMY_POS_START) | ||
| 85 | len = sprintf(buf, "%04x\n", mca_dev->pos_id); | ||
| 86 | else | ||
| 87 | len = sprintf(buf, "none\n"); | ||
| 88 | return len; | ||
| 89 | } | ||
| 90 | static ssize_t mca_show_pos(struct device *dev, struct device_attribute *attr, char *buf) | ||
| 91 | { | ||
| 92 | /* enough for 8 two byte hex chars plus space and new line */ | ||
| 93 | int j, len=0; | ||
| 94 | struct mca_device *mca_dev = to_mca_device(dev); | ||
| 95 | |||
| 96 | for(j=0; j<8; j++) | ||
| 97 | len += sprintf(buf+len, "%02x ", mca_dev->pos[j]); | ||
| 98 | /* change last trailing space to new line */ | ||
| 99 | buf[len-1] = '\n'; | ||
| 100 | return len; | ||
| 101 | } | ||
| 102 | |||
| 103 | static DEVICE_ATTR(id, S_IRUGO, mca_show_pos_id, NULL); | ||
| 104 | static DEVICE_ATTR(pos, S_IRUGO, mca_show_pos, NULL); | ||
| 105 | |||
| 106 | int __init mca_register_device(int bus, struct mca_device *mca_dev) | ||
| 107 | { | ||
| 108 | struct mca_bus *mca_bus = mca_root_busses[bus]; | ||
| 109 | int rc; | ||
| 110 | |||
| 111 | mca_dev->dev.parent = &mca_bus->dev; | ||
| 112 | mca_dev->dev.bus = &mca_bus_type; | ||
| 113 | dev_set_name(&mca_dev->dev, "%02d:%02X", bus, mca_dev->slot); | ||
| 114 | mca_dev->dma_mask = mca_bus->default_dma_mask; | ||
| 115 | mca_dev->dev.dma_mask = &mca_dev->dma_mask; | ||
| 116 | mca_dev->dev.coherent_dma_mask = mca_dev->dma_mask; | ||
| 117 | |||
| 118 | rc = device_register(&mca_dev->dev); | ||
| 119 | if (rc) | ||
| 120 | goto err_out; | ||
| 121 | |||
| 122 | rc = device_create_file(&mca_dev->dev, &dev_attr_id); | ||
| 123 | if (rc) goto err_out_devreg; | ||
| 124 | rc = device_create_file(&mca_dev->dev, &dev_attr_pos); | ||
| 125 | if (rc) goto err_out_id; | ||
| 126 | |||
| 127 | return 1; | ||
| 128 | |||
| 129 | err_out_id: | ||
| 130 | device_remove_file(&mca_dev->dev, &dev_attr_id); | ||
| 131 | err_out_devreg: | ||
| 132 | device_unregister(&mca_dev->dev); | ||
| 133 | err_out: | ||
| 134 | return 0; | ||
| 135 | } | ||
| 136 | |||
| 137 | /* */ | ||
| 138 | struct mca_bus * __devinit mca_attach_bus(int bus) | ||
| 139 | { | ||
| 140 | struct mca_bus *mca_bus; | ||
| 141 | |||
| 142 | if (unlikely(mca_root_busses[bus] != NULL)) { | ||
| 143 | /* This should never happen, but just in case */ | ||
| 144 | printk(KERN_EMERG "MCA tried to add already existing bus %d\n", | ||
| 145 | bus); | ||
| 146 | dump_stack(); | ||
| 147 | return NULL; | ||
| 148 | } | ||
| 149 | |||
| 150 | mca_bus = kzalloc(sizeof(struct mca_bus), GFP_KERNEL); | ||
| 151 | if (!mca_bus) | ||
| 152 | return NULL; | ||
| 153 | |||
| 154 | dev_set_name(&mca_bus->dev, "mca%d", bus); | ||
| 155 | sprintf(mca_bus->name,"Host %s MCA Bridge", bus ? "Secondary" : "Primary"); | ||
| 156 | if (device_register(&mca_bus->dev)) { | ||
| 157 | kfree(mca_bus); | ||
| 158 | return NULL; | ||
| 159 | } | ||
| 160 | |||
| 161 | mca_root_busses[bus] = mca_bus; | ||
| 162 | |||
| 163 | return mca_bus; | ||
| 164 | } | ||
| 165 | |||
| 166 | int __init mca_system_init (void) | ||
| 167 | { | ||
| 168 | return bus_register(&mca_bus_type); | ||
| 169 | } | ||
diff --git a/drivers/mca/mca-device.c b/drivers/mca/mca-device.c deleted file mode 100644 index e7adf89fae41..000000000000 --- a/drivers/mca/mca-device.c +++ /dev/null | |||
| @@ -1,218 +0,0 @@ | |||
| 1 | /* -*- mode: c; c-basic-offset: 8 -*- */ | ||
| 2 | |||
| 3 | /* | ||
| 4 | * MCA device support functions | ||
| 5 | * | ||
| 6 | * These functions support the ongoing device access API. | ||
| 7 | * | ||
| 8 | * (C) 2002 James Bottomley <James.Bottomley@HansenPartnership.com> | ||
| 9 | * | ||
| 10 | **----------------------------------------------------------------------------- | ||
| 11 | ** | ||
| 12 | ** This program is free software; you can redistribute it and/or modify | ||
| 13 | ** it under the terms of the GNU General Public License as published by | ||
| 14 | ** the Free Software Foundation; either version 2 of the License, or | ||
| 15 | ** (at your option) any later version. | ||
| 16 | ** | ||
| 17 | ** This program is distributed in the hope that it will be useful, | ||
| 18 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 19 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 20 | ** GNU General Public License for more details. | ||
| 21 | ** | ||
| 22 | ** You should have received a copy of the GNU General Public License | ||
| 23 | ** along with this program; if not, write to the Free Software | ||
| 24 | ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 25 | ** | ||
| 26 | **----------------------------------------------------------------------------- | ||
| 27 | */ | ||
| 28 | |||
| 29 | #include <linux/module.h> | ||
| 30 | #include <linux/device.h> | ||
| 31 | #include <linux/mca.h> | ||
| 32 | #include <linux/string.h> | ||
| 33 | |||
| 34 | /** | ||
| 35 | * mca_device_read_stored_pos - read POS register from stored data | ||
| 36 | * @mca_dev: device to read from | ||
| 37 | * @reg: register to read from | ||
| 38 | * | ||
| 39 | * Fetch a POS value that was stored at boot time by the kernel | ||
| 40 | * when it scanned the MCA space. The register value is returned. | ||
| 41 | * Missing or invalid registers report 0. | ||
| 42 | */ | ||
| 43 | unsigned char mca_device_read_stored_pos(struct mca_device *mca_dev, int reg) | ||
| 44 | { | ||
| 45 | if(reg < 0 || reg >= 8) | ||
| 46 | return 0; | ||
| 47 | |||
| 48 | return mca_dev->pos[reg]; | ||
| 49 | } | ||
| 50 | EXPORT_SYMBOL(mca_device_read_stored_pos); | ||
| 51 | |||
| 52 | /** | ||
| 53 | * mca_device_read_pos - read POS register from card | ||
| 54 | * @mca_dev: device to read from | ||
| 55 | * @reg: register to read from | ||
| 56 | * | ||
| 57 | * Fetch a POS value directly from the hardware to obtain the | ||
| 58 | * current value. This is much slower than | ||
| 59 | * mca_device_read_stored_pos and may not be invoked from | ||
| 60 | * interrupt context. It handles the deep magic required for | ||
| 61 | * onboard devices transparently. | ||
| 62 | */ | ||
| 63 | unsigned char mca_device_read_pos(struct mca_device *mca_dev, int reg) | ||
| 64 | { | ||
| 65 | struct mca_bus *mca_bus = to_mca_bus(mca_dev->dev.parent); | ||
| 66 | |||
| 67 | return mca_bus->f.mca_read_pos(mca_dev, reg); | ||
| 68 | |||
| 69 | return mca_dev->pos[reg]; | ||
| 70 | } | ||
| 71 | EXPORT_SYMBOL(mca_device_read_pos); | ||
| 72 | |||
| 73 | |||
| 74 | /** | ||
| 75 | * mca_device_write_pos - read POS register from card | ||
| 76 | * @mca_dev: device to write pos register to | ||
| 77 | * @reg: register to write to | ||
| 78 | * @byte: byte to write to the POS registers | ||
| 79 | * | ||
| 80 | * Store a POS value directly to the hardware. You should not | ||
| 81 | * normally need to use this function and should have a very good | ||
| 82 | * knowledge of MCA bus before you do so. Doing this wrongly can | ||
| 83 | * damage the hardware. | ||
| 84 | * | ||
| 85 | * This function may not be used from interrupt context. | ||
| 86 | * | ||
| 87 | */ | ||
| 88 | void mca_device_write_pos(struct mca_device *mca_dev, int reg, | ||
| 89 | unsigned char byte) | ||
| 90 | { | ||
| 91 | struct mca_bus *mca_bus = to_mca_bus(mca_dev->dev.parent); | ||
| 92 | |||
| 93 | mca_bus->f.mca_write_pos(mca_dev, reg, byte); | ||
| 94 | } | ||
| 95 | EXPORT_SYMBOL(mca_device_write_pos); | ||
| 96 | |||
| 97 | /** | ||
| 98 | * mca_device_transform_irq - transform the ADF obtained IRQ | ||
| 99 | * @mca_device: device whose irq needs transforming | ||
| 100 | * @irq: input irq from ADF | ||
| 101 | * | ||
| 102 | * MCA Adapter Definition Files (ADF) contain irq, ioport, memory | ||
| 103 | * etc. definitions. In systems with more than one bus, these need | ||
| 104 | * to be transformed through bus mapping functions to get the real | ||
| 105 | * system global quantities. | ||
| 106 | * | ||
| 107 | * This function transforms the interrupt number and returns the | ||
| 108 | * transformed system global interrupt | ||
| 109 | */ | ||
| 110 | int mca_device_transform_irq(struct mca_device *mca_dev, int irq) | ||
| 111 | { | ||
| 112 | struct mca_bus *mca_bus = to_mca_bus(mca_dev->dev.parent); | ||
| 113 | |||
| 114 | return mca_bus->f.mca_transform_irq(mca_dev, irq); | ||
| 115 | } | ||
| 116 | EXPORT_SYMBOL(mca_device_transform_irq); | ||
| 117 | |||
| 118 | /** | ||
| 119 | * mca_device_transform_ioport - transform the ADF obtained I/O port | ||
| 120 | * @mca_device: device whose port needs transforming | ||
| 121 | * @ioport: input I/O port from ADF | ||
| 122 | * | ||
| 123 | * MCA Adapter Definition Files (ADF) contain irq, ioport, memory | ||
| 124 | * etc. definitions. In systems with more than one bus, these need | ||
| 125 | * to be transformed through bus mapping functions to get the real | ||
| 126 | * system global quantities. | ||
| 127 | * | ||
| 128 | * This function transforms the I/O port number and returns the | ||
| 129 | * transformed system global port number. | ||
| 130 | * | ||
| 131 | * This transformation can be assumed to be linear for port ranges. | ||
| 132 | */ | ||
| 133 | int mca_device_transform_ioport(struct mca_device *mca_dev, int port) | ||
| 134 | { | ||
| 135 | struct mca_bus *mca_bus = to_mca_bus(mca_dev->dev.parent); | ||
| 136 | |||
| 137 | return mca_bus->f.mca_transform_ioport(mca_dev, port); | ||
| 138 | } | ||
| 139 | EXPORT_SYMBOL(mca_device_transform_ioport); | ||
| 140 | |||
| 141 | /** | ||
| 142 | * mca_device_transform_memory - transform the ADF obtained memory | ||
| 143 | * @mca_device: device whose memory region needs transforming | ||
| 144 | * @mem: memory region start from ADF | ||
| 145 | * | ||
| 146 | * MCA Adapter Definition Files (ADF) contain irq, ioport, memory | ||
| 147 | * etc. definitions. In systems with more than one bus, these need | ||
| 148 | * to be transformed through bus mapping functions to get the real | ||
| 149 | * system global quantities. | ||
| 150 | * | ||
| 151 | * This function transforms the memory region start and returns the | ||
| 152 | * transformed system global memory region (physical). | ||
| 153 | * | ||
| 154 | * This transformation can be assumed to be linear for region ranges. | ||
| 155 | */ | ||
| 156 | void *mca_device_transform_memory(struct mca_device *mca_dev, void *mem) | ||
| 157 | { | ||
| 158 | struct mca_bus *mca_bus = to_mca_bus(mca_dev->dev.parent); | ||
| 159 | |||
| 160 | return mca_bus->f.mca_transform_memory(mca_dev, mem); | ||
| 161 | } | ||
| 162 | EXPORT_SYMBOL(mca_device_transform_memory); | ||
| 163 | |||
| 164 | |||
| 165 | /** | ||
| 166 | * mca_device_claimed - check if claimed by driver | ||
| 167 | * @mca_dev: device to check | ||
| 168 | * | ||
| 169 | * Returns 1 if the slot has been claimed by a driver | ||
| 170 | */ | ||
| 171 | |||
| 172 | int mca_device_claimed(struct mca_device *mca_dev) | ||
| 173 | { | ||
| 174 | return mca_dev->driver_loaded; | ||
| 175 | } | ||
| 176 | EXPORT_SYMBOL(mca_device_claimed); | ||
| 177 | |||
| 178 | /** | ||
| 179 | * mca_device_set_claim - set the claim value of the driver | ||
| 180 | * @mca_dev: device to set value for | ||
| 181 | * @val: claim value to set (1 claimed, 0 unclaimed) | ||
| 182 | */ | ||
| 183 | void mca_device_set_claim(struct mca_device *mca_dev, int val) | ||
| 184 | { | ||
| 185 | mca_dev->driver_loaded = val; | ||
| 186 | } | ||
| 187 | EXPORT_SYMBOL(mca_device_set_claim); | ||
| 188 | |||
| 189 | /** | ||
| 190 | * mca_device_status - get the status of the device | ||
| 191 | * @mca_device: device to get | ||
| 192 | * | ||
| 193 | * returns an enumeration of the device status: | ||
| 194 | * | ||
| 195 | * MCA_ADAPTER_NORMAL adapter is OK. | ||
| 196 | * MCA_ADAPTER_NONE no adapter at device (should never happen). | ||
| 197 | * MCA_ADAPTER_DISABLED adapter is disabled. | ||
| 198 | * MCA_ADAPTER_ERROR adapter cannot be initialised. | ||
| 199 | */ | ||
| 200 | enum MCA_AdapterStatus mca_device_status(struct mca_device *mca_dev) | ||
| 201 | { | ||
| 202 | return mca_dev->status; | ||
| 203 | } | ||
| 204 | EXPORT_SYMBOL(mca_device_status); | ||
| 205 | |||
| 206 | /** | ||
| 207 | * mca_device_set_name - set the name of the device | ||
| 208 | * @mca_device: device to set the name of | ||
| 209 | * @name: name to set | ||
| 210 | */ | ||
| 211 | void mca_device_set_name(struct mca_device *mca_dev, const char *name) | ||
| 212 | { | ||
| 213 | if(!mca_dev) | ||
| 214 | return; | ||
| 215 | |||
| 216 | strlcpy(mca_dev->name, name, sizeof(mca_dev->name)); | ||
| 217 | } | ||
| 218 | EXPORT_SYMBOL(mca_device_set_name); | ||
diff --git a/drivers/mca/mca-driver.c b/drivers/mca/mca-driver.c deleted file mode 100644 index 32cd39bcc715..000000000000 --- a/drivers/mca/mca-driver.c +++ /dev/null | |||
| @@ -1,63 +0,0 @@ | |||
| 1 | /* -*- mode: c; c-basic-offset: 8 -*- */ | ||
| 2 | |||
| 3 | /* | ||
| 4 | * MCA driver support functions for sysfs. | ||
| 5 | * | ||
| 6 | * (C) 2002 James Bottomley <James.Bottomley@HansenPartnership.com> | ||
| 7 | * | ||
| 8 | **----------------------------------------------------------------------------- | ||
| 9 | ** | ||
| 10 | ** This program is free software; you can redistribute it and/or modify | ||
| 11 | ** it under the terms of the GNU General Public License as published by | ||
| 12 | ** the Free Software Foundation; either version 2 of the License, or | ||
| 13 | ** (at your option) any later version. | ||
| 14 | ** | ||
| 15 | ** This program is distributed in the hope that it will be useful, | ||
| 16 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 17 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 18 | ** GNU General Public License for more details. | ||
| 19 | ** | ||
| 20 | ** You should have received a copy of the GNU General Public License | ||
| 21 | ** along with this program; if not, write to the Free Software | ||
| 22 | ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 23 | ** | ||
| 24 | **----------------------------------------------------------------------------- | ||
| 25 | */ | ||
| 26 | |||
| 27 | #include <linux/device.h> | ||
| 28 | #include <linux/mca.h> | ||
| 29 | #include <linux/module.h> | ||
| 30 | |||
| 31 | int mca_register_driver(struct mca_driver *mca_drv) | ||
| 32 | { | ||
| 33 | int r; | ||
| 34 | |||
| 35 | if (MCA_bus) { | ||
| 36 | mca_drv->driver.bus = &mca_bus_type; | ||
| 37 | if ((r = driver_register(&mca_drv->driver)) < 0) | ||
| 38 | return r; | ||
| 39 | mca_drv->integrated_id = 0; | ||
| 40 | } | ||
| 41 | |||
| 42 | return 0; | ||
| 43 | } | ||
| 44 | EXPORT_SYMBOL(mca_register_driver); | ||
| 45 | |||
| 46 | int mca_register_driver_integrated(struct mca_driver *mca_driver, | ||
| 47 | int integrated_id) | ||
| 48 | { | ||
| 49 | int r = mca_register_driver(mca_driver); | ||
| 50 | |||
| 51 | if (!r) | ||
| 52 | mca_driver->integrated_id = integrated_id; | ||
| 53 | |||
| 54 | return r; | ||
| 55 | } | ||
| 56 | EXPORT_SYMBOL(mca_register_driver_integrated); | ||
| 57 | |||
| 58 | void mca_unregister_driver(struct mca_driver *mca_drv) | ||
| 59 | { | ||
| 60 | if (MCA_bus) | ||
| 61 | driver_unregister(&mca_drv->driver); | ||
| 62 | } | ||
| 63 | EXPORT_SYMBOL(mca_unregister_driver); | ||
diff --git a/drivers/mca/mca-legacy.c b/drivers/mca/mca-legacy.c deleted file mode 100644 index 494f0c2001f5..000000000000 --- a/drivers/mca/mca-legacy.c +++ /dev/null | |||
| @@ -1,329 +0,0 @@ | |||
| 1 | /* -*- mode: c; c-basic-offset: 8 -*- */ | ||
| 2 | |||
| 3 | /* | ||
| 4 | * MCA bus support functions for legacy (2.4) API. | ||
| 5 | * | ||
| 6 | * Legacy API means the API that operates in terms of MCA slot number | ||
| 7 | * | ||
| 8 | * (C) 2002 James Bottomley <James.Bottomley@HansenPartnership.com> | ||
| 9 | * | ||
| 10 | **----------------------------------------------------------------------------- | ||
| 11 | ** | ||
| 12 | ** This program is free software; you can redistribute it and/or modify | ||
| 13 | ** it under the terms of the GNU General Public License as published by | ||
| 14 | ** the Free Software Foundation; either version 2 of the License, or | ||
| 15 | ** (at your option) any later version. | ||
| 16 | ** | ||
| 17 | ** This program is distributed in the hope that it will be useful, | ||
| 18 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 19 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 20 | ** GNU General Public License for more details. | ||
| 21 | ** | ||
| 22 | ** You should have received a copy of the GNU General Public License | ||
| 23 | ** along with this program; if not, write to the Free Software | ||
| 24 | ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 25 | ** | ||
| 26 | **----------------------------------------------------------------------------- | ||
| 27 | */ | ||
| 28 | |||
| 29 | #include <linux/module.h> | ||
| 30 | #include <linux/device.h> | ||
| 31 | #include <linux/mca-legacy.h> | ||
| 32 | #include <asm/io.h> | ||
| 33 | |||
| 34 | /* NOTE: This structure is stack allocated */ | ||
| 35 | struct mca_find_adapter_info { | ||
| 36 | int id; | ||
| 37 | int slot; | ||
| 38 | struct mca_device *mca_dev; | ||
| 39 | }; | ||
| 40 | |||
| 41 | /* The purpose of this iterator is to loop over all the devices and | ||
| 42 | * find the one with the smallest slot number that's just greater than | ||
| 43 | * or equal to the required slot with a matching id */ | ||
| 44 | static int mca_find_adapter_callback(struct device *dev, void *data) | ||
| 45 | { | ||
| 46 | struct mca_find_adapter_info *info = data; | ||
| 47 | struct mca_device *mca_dev = to_mca_device(dev); | ||
| 48 | |||
| 49 | if(mca_dev->pos_id != info->id) | ||
| 50 | return 0; | ||
| 51 | |||
| 52 | if(mca_dev->slot < info->slot) | ||
| 53 | return 0; | ||
| 54 | |||
| 55 | if(!info->mca_dev || info->mca_dev->slot >= mca_dev->slot) | ||
| 56 | info->mca_dev = mca_dev; | ||
| 57 | |||
| 58 | return 0; | ||
| 59 | } | ||
| 60 | |||
| 61 | /** | ||
| 62 | * mca_find_adapter - scan for adapters | ||
| 63 | * @id: MCA identification to search for | ||
| 64 | * @start: starting slot | ||
| 65 | * | ||
| 66 | * Search the MCA configuration for adapters matching the 16bit | ||
| 67 | * ID given. The first time it should be called with start as zero | ||
| 68 | * and then further calls made passing the return value of the | ||
| 69 | * previous call until %MCA_NOTFOUND is returned. | ||
| 70 | * | ||
| 71 | * Disabled adapters are not reported. | ||
| 72 | */ | ||
| 73 | |||
| 74 | int mca_find_adapter(int id, int start) | ||
| 75 | { | ||
| 76 | struct mca_find_adapter_info info; | ||
| 77 | |||
| 78 | if(id == 0xffff) | ||
| 79 | return MCA_NOTFOUND; | ||
| 80 | |||
| 81 | info.slot = start; | ||
| 82 | info.id = id; | ||
| 83 | info.mca_dev = NULL; | ||
| 84 | |||
| 85 | for(;;) { | ||
| 86 | bus_for_each_dev(&mca_bus_type, NULL, &info, mca_find_adapter_callback); | ||
| 87 | |||
| 88 | if(info.mca_dev == NULL) | ||
| 89 | return MCA_NOTFOUND; | ||
| 90 | |||
| 91 | if(info.mca_dev->status != MCA_ADAPTER_DISABLED) | ||
| 92 | break; | ||
| 93 | |||
| 94 | /* OK, found adapter but it was disabled. Go around | ||
| 95 | * again, excluding the slot we just found */ | ||
| 96 | |||
| 97 | info.slot = info.mca_dev->slot + 1; | ||
| 98 | info.mca_dev = NULL; | ||
| 99 | } | ||
| 100 | |||
| 101 | return info.mca_dev->slot; | ||
| 102 | } | ||
| 103 | EXPORT_SYMBOL(mca_find_adapter); | ||
| 104 | |||
| 105 | /*--------------------------------------------------------------------*/ | ||
| 106 | |||
| 107 | /** | ||
| 108 | * mca_find_unused_adapter - scan for unused adapters | ||
| 109 | * @id: MCA identification to search for | ||
| 110 | * @start: starting slot | ||
| 111 | * | ||
| 112 | * Search the MCA configuration for adapters matching the 16bit | ||
| 113 | * ID given. The first time it should be called with start as zero | ||
| 114 | * and then further calls made passing the return value of the | ||
| 115 | * previous call until %MCA_NOTFOUND is returned. | ||
| 116 | * | ||
| 117 | * Adapters that have been claimed by drivers and those that | ||
| 118 | * are disabled are not reported. This function thus allows a driver | ||
| 119 | * to scan for further cards when some may already be driven. | ||
| 120 | */ | ||
| 121 | |||
| 122 | int mca_find_unused_adapter(int id, int start) | ||
| 123 | { | ||
| 124 | struct mca_find_adapter_info info = { 0 }; | ||
| 125 | |||
| 126 | if (!MCA_bus || id == 0xffff) | ||
| 127 | return MCA_NOTFOUND; | ||
| 128 | |||
| 129 | info.slot = start; | ||
| 130 | info.id = id; | ||
| 131 | info.mca_dev = NULL; | ||
| 132 | |||
| 133 | for(;;) { | ||
| 134 | bus_for_each_dev(&mca_bus_type, NULL, &info, mca_find_adapter_callback); | ||
| 135 | |||
| 136 | if(info.mca_dev == NULL) | ||
| 137 | return MCA_NOTFOUND; | ||
| 138 | |||
| 139 | if(info.mca_dev->status != MCA_ADAPTER_DISABLED | ||
| 140 | && !info.mca_dev->driver_loaded) | ||
| 141 | break; | ||
| 142 | |||
| 143 | /* OK, found adapter but it was disabled or already in | ||
| 144 | * use. Go around again, excluding the slot we just | ||
| 145 | * found */ | ||
| 146 | |||
| 147 | info.slot = info.mca_dev->slot + 1; | ||
| 148 | info.mca_dev = NULL; | ||
| 149 | } | ||
| 150 | |||
| 151 | return info.mca_dev->slot; | ||
| 152 | } | ||
| 153 | EXPORT_SYMBOL(mca_find_unused_adapter); | ||
| 154 | |||
| 155 | /* NOTE: stack allocated structure */ | ||
| 156 | struct mca_find_device_by_slot_info { | ||
| 157 | int slot; | ||
| 158 | struct mca_device *mca_dev; | ||
| 159 | }; | ||
| 160 | |||
| 161 | static int mca_find_device_by_slot_callback(struct device *dev, void *data) | ||
| 162 | { | ||
| 163 | struct mca_find_device_by_slot_info *info = data; | ||
| 164 | struct mca_device *mca_dev = to_mca_device(dev); | ||
| 165 | |||
| 166 | if(mca_dev->slot == info->slot) | ||
| 167 | info->mca_dev = mca_dev; | ||
| 168 | |||
| 169 | return 0; | ||
| 170 | } | ||
| 171 | |||
| 172 | struct mca_device *mca_find_device_by_slot(int slot) | ||
| 173 | { | ||
| 174 | struct mca_find_device_by_slot_info info; | ||
| 175 | |||
| 176 | info.slot = slot; | ||
| 177 | info.mca_dev = NULL; | ||
| 178 | |||
| 179 | bus_for_each_dev(&mca_bus_type, NULL, &info, mca_find_device_by_slot_callback); | ||
| 180 | |||
| 181 | return info.mca_dev; | ||
| 182 | } | ||
| 183 | |||
| 184 | /** | ||
| 185 | * mca_read_stored_pos - read POS register from boot data | ||
| 186 | * @slot: slot number to read from | ||
| 187 | * @reg: register to read from | ||
| 188 | * | ||
| 189 | * Fetch a POS value that was stored at boot time by the kernel | ||
| 190 | * when it scanned the MCA space. The register value is returned. | ||
| 191 | * Missing or invalid registers report 0. | ||
| 192 | */ | ||
| 193 | unsigned char mca_read_stored_pos(int slot, int reg) | ||
| 194 | { | ||
| 195 | struct mca_device *mca_dev = mca_find_device_by_slot(slot); | ||
| 196 | |||
| 197 | if(!mca_dev) | ||
| 198 | return 0; | ||
| 199 | |||
| 200 | return mca_device_read_stored_pos(mca_dev, reg); | ||
| 201 | } | ||
| 202 | EXPORT_SYMBOL(mca_read_stored_pos); | ||
| 203 | |||
| 204 | |||
| 205 | /** | ||
| 206 | * mca_read_pos - read POS register from card | ||
| 207 | * @slot: slot number to read from | ||
| 208 | * @reg: register to read from | ||
| 209 | * | ||
| 210 | * Fetch a POS value directly from the hardware to obtain the | ||
| 211 | * current value. This is much slower than mca_read_stored_pos and | ||
| 212 | * may not be invoked from interrupt context. It handles the | ||
| 213 | * deep magic required for onboard devices transparently. | ||
| 214 | */ | ||
| 215 | |||
| 216 | unsigned char mca_read_pos(int slot, int reg) | ||
| 217 | { | ||
| 218 | struct mca_device *mca_dev = mca_find_device_by_slot(slot); | ||
| 219 | |||
| 220 | if(!mca_dev) | ||
| 221 | return 0; | ||
| 222 | |||
| 223 | return mca_device_read_pos(mca_dev, reg); | ||
| 224 | } | ||
| 225 | EXPORT_SYMBOL(mca_read_pos); | ||
| 226 | |||
| 227 | |||
| 228 | /** | ||
| 229 | * mca_write_pos - read POS register from card | ||
| 230 | * @slot: slot number to read from | ||
| 231 | * @reg: register to read from | ||
| 232 | * @byte: byte to write to the POS registers | ||
| 233 | * | ||
| 234 | * Store a POS value directly from the hardware. You should not | ||
| 235 | * normally need to use this function and should have a very good | ||
| 236 | * knowledge of MCA bus before you do so. Doing this wrongly can | ||
| 237 | * damage the hardware. | ||
| 238 | * | ||
| 239 | * This function may not be used from interrupt context. | ||
| 240 | * | ||
| 241 | * Note that this a technically a Bad Thing, as IBM tech stuff says | ||
| 242 | * you should only set POS values through their utilities. | ||
| 243 | * However, some devices such as the 3c523 recommend that you write | ||
| 244 | * back some data to make sure the configuration is consistent. | ||
| 245 | * I'd say that IBM is right, but I like my drivers to work. | ||
| 246 | * | ||
| 247 | * This function can't do checks to see if multiple devices end up | ||
| 248 | * with the same resources, so you might see magic smoke if someone | ||
| 249 | * screws up. | ||
| 250 | */ | ||
| 251 | |||
| 252 | void mca_write_pos(int slot, int reg, unsigned char byte) | ||
| 253 | { | ||
| 254 | struct mca_device *mca_dev = mca_find_device_by_slot(slot); | ||
| 255 | |||
| 256 | if(!mca_dev) | ||
| 257 | return; | ||
| 258 | |||
| 259 | mca_device_write_pos(mca_dev, reg, byte); | ||
| 260 | } | ||
| 261 | EXPORT_SYMBOL(mca_write_pos); | ||
| 262 | |||
| 263 | /** | ||
| 264 | * mca_set_adapter_name - Set the description of the card | ||
| 265 | * @slot: slot to name | ||
| 266 | * @name: text string for the namen | ||
| 267 | * | ||
| 268 | * This function sets the name reported via /proc for this | ||
| 269 | * adapter slot. This is for user information only. Setting a | ||
| 270 | * name deletes any previous name. | ||
| 271 | */ | ||
| 272 | |||
| 273 | void mca_set_adapter_name(int slot, char* name) | ||
| 274 | { | ||
| 275 | struct mca_device *mca_dev = mca_find_device_by_slot(slot); | ||
| 276 | |||
| 277 | if(!mca_dev) | ||
| 278 | return; | ||
| 279 | |||
| 280 | mca_device_set_name(mca_dev, name); | ||
| 281 | } | ||
| 282 | EXPORT_SYMBOL(mca_set_adapter_name); | ||
| 283 | |||
| 284 | /** | ||
| 285 | * mca_mark_as_used - claim an MCA device | ||
| 286 | * @slot: slot to claim | ||
| 287 | * FIXME: should we make this threadsafe | ||
| 288 | * | ||
| 289 | * Claim an MCA slot for a device driver. If the | ||
| 290 | * slot is already taken the function returns 1, | ||
| 291 | * if it is not taken it is claimed and 0 is | ||
| 292 | * returned. | ||
| 293 | */ | ||
| 294 | |||
| 295 | int mca_mark_as_used(int slot) | ||
| 296 | { | ||
| 297 | struct mca_device *mca_dev = mca_find_device_by_slot(slot); | ||
| 298 | |||
| 299 | if(!mca_dev) | ||
| 300 | /* FIXME: this is actually a severe error */ | ||
| 301 | return 1; | ||
| 302 | |||
| 303 | if(mca_device_claimed(mca_dev)) | ||
| 304 | return 1; | ||
| 305 | |||
| 306 | mca_device_set_claim(mca_dev, 1); | ||
| 307 | |||
| 308 | return 0; | ||
| 309 | } | ||
| 310 | EXPORT_SYMBOL(mca_mark_as_used); | ||
| 311 | |||
| 312 | /** | ||
| 313 | * mca_mark_as_unused - release an MCA device | ||
| 314 | * @slot: slot to claim | ||
| 315 | * | ||
| 316 | * Release the slot for other drives to use. | ||
| 317 | */ | ||
| 318 | |||
| 319 | void mca_mark_as_unused(int slot) | ||
| 320 | { | ||
| 321 | struct mca_device *mca_dev = mca_find_device_by_slot(slot); | ||
| 322 | |||
| 323 | if(!mca_dev) | ||
| 324 | return; | ||
| 325 | |||
| 326 | mca_device_set_claim(mca_dev, 0); | ||
| 327 | } | ||
| 328 | EXPORT_SYMBOL(mca_mark_as_unused); | ||
| 329 | |||
diff --git a/drivers/mca/mca-proc.c b/drivers/mca/mca-proc.c deleted file mode 100644 index 81ea0d377bf4..000000000000 --- a/drivers/mca/mca-proc.c +++ /dev/null | |||
| @@ -1,249 +0,0 @@ | |||
| 1 | /* -*- mode: c; c-basic-offset: 8 -*- */ | ||
| 2 | |||
| 3 | /* | ||
| 4 | * MCA bus support functions for the proc fs. | ||
| 5 | * | ||
| 6 | * NOTE: this code *requires* the legacy MCA api. | ||
| 7 | * | ||
| 8 | * Legacy API means the API that operates in terms of MCA slot number | ||
| 9 | * | ||
| 10 | * (C) 2002 James Bottomley <James.Bottomley@HansenPartnership.com> | ||
| 11 | * | ||
| 12 | **----------------------------------------------------------------------------- | ||
| 13 | ** | ||
| 14 | ** This program is free software; you can redistribute it and/or modify | ||
| 15 | ** it under the terms of the GNU General Public License as published by | ||
| 16 | ** the Free Software Foundation; either version 2 of the License, or | ||
| 17 | ** (at your option) any later version. | ||
| 18 | ** | ||
| 19 | ** This program is distributed in the hope that it will be useful, | ||
| 20 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 21 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 22 | ** GNU General Public License for more details. | ||
| 23 | ** | ||
| 24 | ** You should have received a copy of the GNU General Public License | ||
| 25 | ** along with this program; if not, write to the Free Software | ||
| 26 | ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 27 | ** | ||
| 28 | **----------------------------------------------------------------------------- | ||
| 29 | */ | ||
| 30 | #include <linux/module.h> | ||
| 31 | #include <linux/init.h> | ||
| 32 | #include <linux/proc_fs.h> | ||
| 33 | #include <linux/mca.h> | ||
| 34 | |||
| 35 | static int get_mca_info_helper(struct mca_device *mca_dev, char *page, int len) | ||
| 36 | { | ||
| 37 | int j; | ||
| 38 | |||
| 39 | for(j=0; j<8; j++) | ||
| 40 | len += sprintf(page+len, "%02x ", | ||
| 41 | mca_dev ? mca_dev->pos[j] : 0xff); | ||
| 42 | len += sprintf(page+len, " %s\n", mca_dev ? mca_dev->name : ""); | ||
| 43 | return len; | ||
| 44 | } | ||
| 45 | |||
| 46 | static int get_mca_info(char *page, char **start, off_t off, | ||
| 47 | int count, int *eof, void *data) | ||
| 48 | { | ||
| 49 | int i, len = 0; | ||
| 50 | |||
| 51 | if(MCA_bus) { | ||
| 52 | struct mca_device *mca_dev; | ||
| 53 | /* Format POS registers of eight MCA slots */ | ||
| 54 | |||
| 55 | for(i=0; i<MCA_MAX_SLOT_NR; i++) { | ||
| 56 | mca_dev = mca_find_device_by_slot(i); | ||
| 57 | |||
| 58 | len += sprintf(page+len, "Slot %d: ", i+1); | ||
| 59 | len = get_mca_info_helper(mca_dev, page, len); | ||
| 60 | } | ||
| 61 | |||
| 62 | /* Format POS registers of integrated video subsystem */ | ||
| 63 | |||
| 64 | mca_dev = mca_find_device_by_slot(MCA_INTEGVIDEO); | ||
| 65 | len += sprintf(page+len, "Video : "); | ||
| 66 | len = get_mca_info_helper(mca_dev, page, len); | ||
| 67 | |||
| 68 | /* Format POS registers of integrated SCSI subsystem */ | ||
| 69 | |||
| 70 | mca_dev = mca_find_device_by_slot(MCA_INTEGSCSI); | ||
| 71 | len += sprintf(page+len, "SCSI : "); | ||
| 72 | len = get_mca_info_helper(mca_dev, page, len); | ||
| 73 | |||
| 74 | /* Format POS registers of motherboard */ | ||
| 75 | |||
| 76 | mca_dev = mca_find_device_by_slot(MCA_MOTHERBOARD); | ||
| 77 | len += sprintf(page+len, "Planar: "); | ||
| 78 | len = get_mca_info_helper(mca_dev, page, len); | ||
| 79 | } else { | ||
| 80 | /* Leave it empty if MCA not detected - this should *never* | ||
| 81 | * happen! | ||
| 82 | */ | ||
| 83 | } | ||
| 84 | |||
| 85 | if (len <= off+count) *eof = 1; | ||
| 86 | *start = page + off; | ||
| 87 | len -= off; | ||
| 88 | if (len>count) len = count; | ||
| 89 | if (len<0) len = 0; | ||
| 90 | return len; | ||
| 91 | } | ||
| 92 | |||
| 93 | /*--------------------------------------------------------------------*/ | ||
| 94 | |||
| 95 | static int mca_default_procfn(char* buf, struct mca_device *mca_dev) | ||
| 96 | { | ||
| 97 | int len = 0, i; | ||
| 98 | int slot = mca_dev->slot; | ||
| 99 | |||
| 100 | /* Print out the basic information */ | ||
| 101 | |||
| 102 | if(slot < MCA_MAX_SLOT_NR) { | ||
| 103 | len += sprintf(buf+len, "Slot: %d\n", slot+1); | ||
| 104 | } else if(slot == MCA_INTEGSCSI) { | ||
| 105 | len += sprintf(buf+len, "Integrated SCSI Adapter\n"); | ||
| 106 | } else if(slot == MCA_INTEGVIDEO) { | ||
| 107 | len += sprintf(buf+len, "Integrated Video Adapter\n"); | ||
| 108 | } else if(slot == MCA_MOTHERBOARD) { | ||
| 109 | len += sprintf(buf+len, "Motherboard\n"); | ||
| 110 | } | ||
| 111 | if (mca_dev->name[0]) { | ||
| 112 | |||
| 113 | /* Drivers might register a name without /proc handler... */ | ||
| 114 | |||
| 115 | len += sprintf(buf+len, "Adapter Name: %s\n", | ||
| 116 | mca_dev->name); | ||
| 117 | } else { | ||
| 118 | len += sprintf(buf+len, "Adapter Name: Unknown\n"); | ||
| 119 | } | ||
| 120 | len += sprintf(buf+len, "Id: %02x%02x\n", | ||
| 121 | mca_dev->pos[1], mca_dev->pos[0]); | ||
| 122 | len += sprintf(buf+len, "Enabled: %s\nPOS: ", | ||
| 123 | mca_device_status(mca_dev) == MCA_ADAPTER_NORMAL ? | ||
| 124 | "Yes" : "No"); | ||
| 125 | for(i=0; i<8; i++) { | ||
| 126 | len += sprintf(buf+len, "%02x ", mca_dev->pos[i]); | ||
| 127 | } | ||
| 128 | len += sprintf(buf+len, "\nDriver Installed: %s", | ||
| 129 | mca_device_claimed(mca_dev) ? "Yes" : "No"); | ||
| 130 | buf[len++] = '\n'; | ||
| 131 | buf[len] = 0; | ||
| 132 | |||
| 133 | return len; | ||
| 134 | } /* mca_default_procfn() */ | ||
| 135 | |||
| 136 | static int get_mca_machine_info(char* page, char **start, off_t off, | ||
| 137 | int count, int *eof, void *data) | ||
| 138 | { | ||
| 139 | int len = 0; | ||
| 140 | |||
| 141 | len += sprintf(page+len, "Model Id: 0x%x\n", machine_id); | ||
| 142 | len += sprintf(page+len, "Submodel Id: 0x%x\n", machine_submodel_id); | ||
| 143 | len += sprintf(page+len, "BIOS Revision: 0x%x\n", BIOS_revision); | ||
| 144 | |||
| 145 | if (len <= off+count) *eof = 1; | ||
| 146 | *start = page + off; | ||
| 147 | len -= off; | ||
| 148 | if (len>count) len = count; | ||
| 149 | if (len<0) len = 0; | ||
| 150 | return len; | ||
| 151 | } | ||
| 152 | |||
| 153 | static int mca_read_proc(char *page, char **start, off_t off, | ||
| 154 | int count, int *eof, void *data) | ||
| 155 | { | ||
| 156 | struct mca_device *mca_dev = (struct mca_device *)data; | ||
| 157 | int len = 0; | ||
| 158 | |||
| 159 | /* Get the standard info */ | ||
| 160 | |||
| 161 | len = mca_default_procfn(page, mca_dev); | ||
| 162 | |||
| 163 | /* Do any device-specific processing, if there is any */ | ||
| 164 | |||
| 165 | if(mca_dev->procfn) { | ||
| 166 | len += mca_dev->procfn(page+len, mca_dev->slot, | ||
| 167 | mca_dev->proc_dev); | ||
| 168 | } | ||
| 169 | if (len <= off+count) *eof = 1; | ||
| 170 | *start = page + off; | ||
| 171 | len -= off; | ||
| 172 | if (len>count) len = count; | ||
| 173 | if (len<0) len = 0; | ||
| 174 | return len; | ||
| 175 | } /* mca_read_proc() */ | ||
| 176 | |||
| 177 | /*--------------------------------------------------------------------*/ | ||
| 178 | |||
| 179 | void __init mca_do_proc_init(void) | ||
| 180 | { | ||
| 181 | int i; | ||
| 182 | struct proc_dir_entry *proc_mca; | ||
| 183 | struct proc_dir_entry* node = NULL; | ||
| 184 | struct mca_device *mca_dev; | ||
| 185 | |||
| 186 | proc_mca = proc_mkdir("mca", NULL); | ||
| 187 | create_proc_read_entry("pos",0,proc_mca,get_mca_info,NULL); | ||
| 188 | create_proc_read_entry("machine",0,proc_mca,get_mca_machine_info,NULL); | ||
| 189 | |||
| 190 | /* Initialize /proc/mca entries for existing adapters */ | ||
| 191 | |||
| 192 | for(i = 0; i < MCA_NUMADAPTERS; i++) { | ||
| 193 | enum MCA_AdapterStatus status; | ||
| 194 | mca_dev = mca_find_device_by_slot(i); | ||
| 195 | if(!mca_dev) | ||
| 196 | continue; | ||
| 197 | |||
| 198 | mca_dev->procfn = NULL; | ||
| 199 | |||
| 200 | if(i < MCA_MAX_SLOT_NR) sprintf(mca_dev->procname,"slot%d", i+1); | ||
| 201 | else if(i == MCA_INTEGVIDEO) sprintf(mca_dev->procname,"video"); | ||
| 202 | else if(i == MCA_INTEGSCSI) sprintf(mca_dev->procname,"scsi"); | ||
| 203 | else if(i == MCA_MOTHERBOARD) sprintf(mca_dev->procname,"planar"); | ||
| 204 | |||
| 205 | status = mca_device_status(mca_dev); | ||
| 206 | if (status != MCA_ADAPTER_NORMAL && | ||
| 207 | status != MCA_ADAPTER_DISABLED) | ||
| 208 | continue; | ||
| 209 | |||
| 210 | node = create_proc_read_entry(mca_dev->procname, 0, proc_mca, | ||
| 211 | mca_read_proc, (void *)mca_dev); | ||
| 212 | |||
| 213 | if(node == NULL) { | ||
| 214 | printk("Failed to allocate memory for MCA proc-entries!"); | ||
| 215 | return; | ||
| 216 | } | ||
| 217 | } | ||
| 218 | |||
| 219 | } /* mca_do_proc_init() */ | ||
| 220 | |||
| 221 | /** | ||
| 222 | * mca_set_adapter_procfn - Set the /proc callback | ||
| 223 | * @slot: slot to configure | ||
| 224 | * @procfn: callback function to call for /proc | ||
| 225 | * @dev: device information passed to the callback | ||
| 226 | * | ||
| 227 | * This sets up an information callback for /proc/mca/slot?. The | ||
| 228 | * function is called with the buffer, slot, and device pointer (or | ||
| 229 | * some equally informative context information, or nothing, if you | ||
| 230 | * prefer), and is expected to put useful information into the | ||
| 231 | * buffer. The adapter name, ID, and POS registers get printed | ||
| 232 | * before this is called though, so don't do it again. | ||
| 233 | * | ||
| 234 | * This should be called with a %NULL @procfn when a module | ||
| 235 | * unregisters, thus preventing kernel crashes and other such | ||
| 236 | * nastiness. | ||
| 237 | */ | ||
| 238 | |||
| 239 | void mca_set_adapter_procfn(int slot, MCA_ProcFn procfn, void* proc_dev) | ||
| 240 | { | ||
| 241 | struct mca_device *mca_dev = mca_find_device_by_slot(slot); | ||
| 242 | |||
| 243 | if(!mca_dev) | ||
| 244 | return; | ||
| 245 | |||
| 246 | mca_dev->procfn = procfn; | ||
| 247 | mca_dev->proc_dev = proc_dev; | ||
| 248 | } | ||
| 249 | EXPORT_SYMBOL(mca_set_adapter_procfn); | ||
diff --git a/drivers/message/i2o/i2o_proc.c b/drivers/message/i2o/i2o_proc.c index 6d115c7208ab..506c36f6e1db 100644 --- a/drivers/message/i2o/i2o_proc.c +++ b/drivers/message/i2o/i2o_proc.c | |||
| @@ -283,7 +283,6 @@ static char *bus_strings[] = { | |||
| 283 | "Local Bus", | 283 | "Local Bus", |
| 284 | "ISA", | 284 | "ISA", |
| 285 | "EISA", | 285 | "EISA", |
| 286 | "MCA", | ||
| 287 | "PCI", | 286 | "PCI", |
| 288 | "PCMCIA", | 287 | "PCMCIA", |
| 289 | "NUBUS", | 288 | "NUBUS", |
| @@ -351,18 +350,6 @@ static int i2o_seq_show_hrt(struct seq_file *seq, void *v) | |||
| 351 | EisaSlotNumber); | 350 | EisaSlotNumber); |
| 352 | break; | 351 | break; |
| 353 | 352 | ||
| 354 | case I2O_BUS_MCA: | ||
| 355 | seq_printf(seq, " IOBase: %0#6x,", | ||
| 356 | hrt->hrt_entry[i].bus.mca_bus. | ||
| 357 | McaBaseIOPort); | ||
| 358 | seq_printf(seq, " MemoryBase: %0#10x,", | ||
| 359 | hrt->hrt_entry[i].bus.mca_bus. | ||
| 360 | McaBaseMemoryAddress); | ||
| 361 | seq_printf(seq, " Slot: %0#4x,", | ||
| 362 | hrt->hrt_entry[i].bus.mca_bus. | ||
| 363 | McaSlotNumber); | ||
| 364 | break; | ||
| 365 | |||
| 366 | case I2O_BUS_PCI: | 353 | case I2O_BUS_PCI: |
| 367 | seq_printf(seq, " Bus: %0#4x", | 354 | seq_printf(seq, " Bus: %0#4x", |
| 368 | hrt->hrt_entry[i].bus.pci_bus. | 355 | hrt->hrt_entry[i].bus.pci_bus. |
diff --git a/include/linux/i2o-dev.h b/include/linux/i2o-dev.h index a0b23dd45239..a8093bfec3a6 100644 --- a/include/linux/i2o-dev.h +++ b/include/linux/i2o-dev.h | |||
| @@ -124,7 +124,7 @@ typedef struct i2o_sg_io_hdr { | |||
| 124 | #define I2O_BUS_LOCAL 0 | 124 | #define I2O_BUS_LOCAL 0 |
| 125 | #define I2O_BUS_ISA 1 | 125 | #define I2O_BUS_ISA 1 |
| 126 | #define I2O_BUS_EISA 2 | 126 | #define I2O_BUS_EISA 2 |
| 127 | #define I2O_BUS_MCA 3 | 127 | /* was I2O_BUS_MCA 3 */ |
| 128 | #define I2O_BUS_PCI 4 | 128 | #define I2O_BUS_PCI 4 |
| 129 | #define I2O_BUS_PCMCIA 5 | 129 | #define I2O_BUS_PCMCIA 5 |
| 130 | #define I2O_BUS_NUBUS 6 | 130 | #define I2O_BUS_NUBUS 6 |
diff --git a/include/linux/mca-legacy.h b/include/linux/mca-legacy.h deleted file mode 100644 index 7a3aea845902..000000000000 --- a/include/linux/mca-legacy.h +++ /dev/null | |||
| @@ -1,66 +0,0 @@ | |||
| 1 | /* -*- mode: c; c-basic-offset: 8 -*- */ | ||
| 2 | |||
| 3 | /* This is the function prototypes for the old legacy MCA interface | ||
| 4 | * | ||
| 5 | * Please move your driver to the new sysfs based one instead */ | ||
| 6 | |||
| 7 | #ifndef _LINUX_MCA_LEGACY_H | ||
| 8 | #define _LINUX_MCA_LEGACY_H | ||
| 9 | |||
| 10 | #include <linux/mca.h> | ||
| 11 | |||
| 12 | #warning "MCA legacy - please move your driver to the new sysfs api" | ||
| 13 | |||
| 14 | /* MCA_NOTFOUND is an error condition. The other two indicate | ||
| 15 | * motherboard POS registers contain the adapter. They might be | ||
| 16 | * returned by the mca_find_adapter() function, and can be used as | ||
| 17 | * arguments to mca_read_stored_pos(). I'm not going to allow direct | ||
| 18 | * access to the motherboard registers until we run across an adapter | ||
| 19 | * that requires it. We don't know enough about them to know if it's | ||
| 20 | * safe. | ||
| 21 | * | ||
| 22 | * See Documentation/mca.txt or one of the existing drivers for | ||
| 23 | * more information. | ||
| 24 | */ | ||
| 25 | #define MCA_NOTFOUND (-1) | ||
| 26 | |||
| 27 | |||
| 28 | |||
| 29 | /* Returns the slot of the first enabled adapter matching id. User can | ||
| 30 | * specify a starting slot beyond zero, to deal with detecting multiple | ||
| 31 | * devices. Returns MCA_NOTFOUND if id not found. Also checks the | ||
| 32 | * integrated adapters. | ||
| 33 | */ | ||
| 34 | extern int mca_find_adapter(int id, int start); | ||
| 35 | extern int mca_find_unused_adapter(int id, int start); | ||
| 36 | |||
| 37 | extern int mca_mark_as_used(int slot); | ||
| 38 | extern void mca_mark_as_unused(int slot); | ||
| 39 | |||
| 40 | /* gets a byte out of POS register (stored in memory) */ | ||
| 41 | extern unsigned char mca_read_stored_pos(int slot, int reg); | ||
| 42 | |||
| 43 | /* This can be expanded later. Right now, it gives us a way of | ||
| 44 | * getting meaningful information into the MCA_info structure, | ||
| 45 | * so we can have a more interesting /proc/mca. | ||
| 46 | */ | ||
| 47 | extern void mca_set_adapter_name(int slot, char* name); | ||
| 48 | |||
| 49 | /* These routines actually mess with the hardware POS registers. They | ||
| 50 | * temporarily disable the device (and interrupts), so make sure you know | ||
| 51 | * what you're doing if you use them. Furthermore, writing to a POS may | ||
| 52 | * result in two devices trying to share a resource, which in turn can | ||
| 53 | * result in multiple devices sharing memory spaces, IRQs, or even trashing | ||
| 54 | * hardware. YOU HAVE BEEN WARNED. | ||
| 55 | * | ||
| 56 | * You can only access slots with this. Motherboard registers are off | ||
| 57 | * limits. | ||
| 58 | */ | ||
| 59 | |||
| 60 | /* read a byte from the specified POS register. */ | ||
| 61 | extern unsigned char mca_read_pos(int slot, int reg); | ||
| 62 | |||
| 63 | /* write a byte to the specified POS register. */ | ||
| 64 | extern void mca_write_pos(int slot, int reg, unsigned char byte); | ||
| 65 | |||
| 66 | #endif | ||
diff --git a/include/linux/mca.h b/include/linux/mca.h deleted file mode 100644 index 37972704617f..000000000000 --- a/include/linux/mca.h +++ /dev/null | |||
| @@ -1,148 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Header for Microchannel Architecture Bus | ||
| 3 | * Written by Martin Kolinek, February 1996 | ||
| 4 | */ | ||
| 5 | |||
| 6 | #ifndef _LINUX_MCA_H | ||
| 7 | #define _LINUX_MCA_H | ||
| 8 | |||
| 9 | #include <linux/device.h> | ||
| 10 | |||
| 11 | #ifdef CONFIG_MCA | ||
| 12 | #include <asm/mca.h> | ||
| 13 | |||
| 14 | extern int MCA_bus; | ||
| 15 | #else | ||
| 16 | #define MCA_bus 0 | ||
| 17 | #endif | ||
| 18 | |||
| 19 | /* This sets up an information callback for /proc/mca/slot?. The | ||
| 20 | * function is called with the buffer, slot, and device pointer (or | ||
| 21 | * some equally informative context information, or nothing, if you | ||
| 22 | * prefer), and is expected to put useful information into the | ||
| 23 | * buffer. The adapter name, id, and POS registers get printed | ||
| 24 | * before this is called though, so don't do it again. | ||
| 25 | * | ||
| 26 | * This should be called with a NULL procfn when a module | ||
| 27 | * unregisters, thus preventing kernel crashes and other such | ||
| 28 | * nastiness. | ||
| 29 | */ | ||
| 30 | typedef int (*MCA_ProcFn)(char* buf, int slot, void* dev); | ||
| 31 | |||
| 32 | /* Should only be called by the NMI interrupt handler, this will do some | ||
| 33 | * fancy stuff to figure out what might have generated a NMI. | ||
| 34 | */ | ||
| 35 | extern void mca_handle_nmi(void); | ||
| 36 | |||
| 37 | enum MCA_AdapterStatus { | ||
| 38 | MCA_ADAPTER_NORMAL = 0, | ||
| 39 | MCA_ADAPTER_NONE = 1, | ||
| 40 | MCA_ADAPTER_DISABLED = 2, | ||
| 41 | MCA_ADAPTER_ERROR = 3 | ||
| 42 | }; | ||
| 43 | |||
| 44 | struct mca_device { | ||
| 45 | u64 dma_mask; | ||
| 46 | int pos_id; | ||
| 47 | int slot; | ||
| 48 | |||
| 49 | /* index into id_table, set by the bus match routine */ | ||
| 50 | int index; | ||
| 51 | |||
| 52 | /* is there a driver installed? 0 - No, 1 - Yes */ | ||
| 53 | int driver_loaded; | ||
| 54 | /* POS registers */ | ||
| 55 | unsigned char pos[8]; | ||
| 56 | /* if a pseudo adapter of the motherboard, this is the motherboard | ||
| 57 | * register value to use for setup cycles */ | ||
| 58 | short pos_register; | ||
| 59 | |||
| 60 | enum MCA_AdapterStatus status; | ||
| 61 | #ifdef CONFIG_MCA_PROC_FS | ||
| 62 | /* name of the proc/mca file */ | ||
| 63 | char procname[8]; | ||
| 64 | /* /proc info callback */ | ||
| 65 | MCA_ProcFn procfn; | ||
| 66 | /* device/context info for proc callback */ | ||
| 67 | void *proc_dev; | ||
| 68 | #endif | ||
| 69 | struct device dev; | ||
| 70 | char name[32]; | ||
| 71 | }; | ||
| 72 | #define to_mca_device(mdev) container_of(mdev, struct mca_device, dev) | ||
| 73 | |||
| 74 | struct mca_bus_accessor_functions { | ||
| 75 | unsigned char (*mca_read_pos)(struct mca_device *, int reg); | ||
| 76 | void (*mca_write_pos)(struct mca_device *, int reg, | ||
| 77 | unsigned char byte); | ||
| 78 | int (*mca_transform_irq)(struct mca_device *, int irq); | ||
| 79 | int (*mca_transform_ioport)(struct mca_device *, | ||
| 80 | int region); | ||
| 81 | void * (*mca_transform_memory)(struct mca_device *, | ||
| 82 | void *memory); | ||
| 83 | }; | ||
| 84 | |||
| 85 | struct mca_bus { | ||
| 86 | u64 default_dma_mask; | ||
| 87 | int number; | ||
| 88 | struct mca_bus_accessor_functions f; | ||
| 89 | struct device dev; | ||
| 90 | char name[32]; | ||
| 91 | }; | ||
| 92 | #define to_mca_bus(mdev) container_of(mdev, struct mca_bus, dev) | ||
| 93 | |||
| 94 | struct mca_driver { | ||
| 95 | const short *id_table; | ||
| 96 | void *driver_data; | ||
| 97 | int integrated_id; | ||
| 98 | struct device_driver driver; | ||
| 99 | }; | ||
| 100 | #define to_mca_driver(mdriver) container_of(mdriver, struct mca_driver, driver) | ||
| 101 | |||
| 102 | /* Ongoing supported API functions */ | ||
| 103 | extern struct mca_device *mca_find_device_by_slot(int slot); | ||
| 104 | extern int mca_system_init(void); | ||
| 105 | extern struct mca_bus *mca_attach_bus(int); | ||
| 106 | |||
| 107 | extern unsigned char mca_device_read_stored_pos(struct mca_device *mca_dev, | ||
| 108 | int reg); | ||
| 109 | extern unsigned char mca_device_read_pos(struct mca_device *mca_dev, int reg); | ||
| 110 | extern void mca_device_write_pos(struct mca_device *mca_dev, int reg, | ||
| 111 | unsigned char byte); | ||
| 112 | extern int mca_device_transform_irq(struct mca_device *mca_dev, int irq); | ||
| 113 | extern int mca_device_transform_ioport(struct mca_device *mca_dev, int port); | ||
| 114 | extern void *mca_device_transform_memory(struct mca_device *mca_dev, | ||
| 115 | void *mem); | ||
| 116 | extern int mca_device_claimed(struct mca_device *mca_dev); | ||
| 117 | extern void mca_device_set_claim(struct mca_device *mca_dev, int val); | ||
| 118 | extern void mca_device_set_name(struct mca_device *mca_dev, const char *name); | ||
| 119 | static inline char *mca_device_get_name(struct mca_device *mca_dev) | ||
| 120 | { | ||
| 121 | return mca_dev ? mca_dev->name : NULL; | ||
| 122 | } | ||
| 123 | |||
| 124 | extern enum MCA_AdapterStatus mca_device_status(struct mca_device *mca_dev); | ||
| 125 | |||
| 126 | extern struct bus_type mca_bus_type; | ||
| 127 | |||
| 128 | extern int mca_register_driver(struct mca_driver *drv); | ||
| 129 | extern int mca_register_driver_integrated(struct mca_driver *, int); | ||
| 130 | extern void mca_unregister_driver(struct mca_driver *drv); | ||
| 131 | |||
| 132 | /* WARNING: only called by the boot time device setup */ | ||
| 133 | extern int mca_register_device(int bus, struct mca_device *mca_dev); | ||
| 134 | |||
| 135 | #ifdef CONFIG_MCA_PROC_FS | ||
| 136 | extern void mca_do_proc_init(void); | ||
| 137 | extern void mca_set_adapter_procfn(int slot, MCA_ProcFn, void* dev); | ||
| 138 | #else | ||
| 139 | static inline void mca_do_proc_init(void) | ||
| 140 | { | ||
| 141 | } | ||
| 142 | |||
| 143 | static inline void mca_set_adapter_procfn(int slot, MCA_ProcFn fn, void* dev) | ||
| 144 | { | ||
| 145 | } | ||
| 146 | #endif | ||
| 147 | |||
| 148 | #endif /* _LINUX_MCA_H */ | ||
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index 2c6286c0bc1a..f606738d421d 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c | |||
| @@ -240,7 +240,7 @@ search_help[] = N_( | |||
| 240 | "Defined at drivers/pci/Kconfig:47\n" | 240 | "Defined at drivers/pci/Kconfig:47\n" |
| 241 | "Depends on: X86_LOCAL_APIC && X86_IO_APIC || IA64\n" | 241 | "Depends on: X86_LOCAL_APIC && X86_IO_APIC || IA64\n" |
| 242 | "Location:\n" | 242 | "Location:\n" |
| 243 | " -> Bus options (PCI, PCMCIA, EISA, MCA, ISA)\n" | 243 | " -> Bus options (PCI, PCMCIA, EISA, ISA)\n" |
| 244 | " -> PCI support (PCI [=y])\n" | 244 | " -> PCI support (PCI [=y])\n" |
| 245 | " -> PCI access mode (<choice> [=y])\n" | 245 | " -> PCI access mode (<choice> [=y])\n" |
| 246 | "Selects: LIBCRC32\n" | 246 | "Selects: LIBCRC32\n" |
diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c index 73070cb0b6de..8c0eb65978c9 100644 --- a/scripts/kconfig/nconf.c +++ b/scripts/kconfig/nconf.c | |||
| @@ -223,7 +223,7 @@ search_help[] = N_( | |||
| 223 | "Defined at drivers/pci/Kconfig:47\n" | 223 | "Defined at drivers/pci/Kconfig:47\n" |
| 224 | "Depends on: X86_LOCAL_APIC && X86_IO_APIC || IA64\n" | 224 | "Depends on: X86_LOCAL_APIC && X86_IO_APIC || IA64\n" |
| 225 | "Location:\n" | 225 | "Location:\n" |
| 226 | " -> Bus options (PCI, PCMCIA, EISA, MCA, ISA)\n" | 226 | " -> Bus options (PCI, PCMCIA, EISA, ISA)\n" |
| 227 | " -> PCI support (PCI [ = y])\n" | 227 | " -> PCI support (PCI [ = y])\n" |
| 228 | " -> PCI access mode (<choice> [ = y])\n" | 228 | " -> PCI access mode (<choice> [ = y])\n" |
| 229 | "Selects: LIBCRC32\n" | 229 | "Selects: LIBCRC32\n" |
