1*01869ca4Swiz.\" $NetBSD: mca.9,v 1.12 2017/07/03 21:28:48 wiz Exp $ 24d4c1038Sgmcgarry.\" 34d4c1038Sgmcgarry.\" Copyright (c) 2001 The NetBSD Foundation, Inc. 44d4c1038Sgmcgarry.\" All rights reserved. 54d4c1038Sgmcgarry.\" 64d4c1038Sgmcgarry.\" This code is derived from software contributed to The NetBSD Foundation 74d4c1038Sgmcgarry.\" by Gregory McGarry. 84d4c1038Sgmcgarry.\" 94d4c1038Sgmcgarry.\" Redistribution and use in source and binary forms, with or without 104d4c1038Sgmcgarry.\" modification, are permitted provided that the following conditions 114d4c1038Sgmcgarry.\" are met: 124d4c1038Sgmcgarry.\" 1. Redistributions of source code must retain the above copyright 134d4c1038Sgmcgarry.\" notice, this list of conditions and the following disclaimer. 144d4c1038Sgmcgarry.\" 2. Redistributions in binary form must reproduce the above copyright 154d4c1038Sgmcgarry.\" notice, this list of conditions and the following disclaimer in the 164d4c1038Sgmcgarry.\" documentation and/or other materials provided with the distribution. 174d4c1038Sgmcgarry.\" 184d4c1038Sgmcgarry.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 194d4c1038Sgmcgarry.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 204d4c1038Sgmcgarry.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 214d4c1038Sgmcgarry.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 224d4c1038Sgmcgarry.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 234d4c1038Sgmcgarry.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 244d4c1038Sgmcgarry.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 254d4c1038Sgmcgarry.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 264d4c1038Sgmcgarry.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 274d4c1038Sgmcgarry.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 284d4c1038Sgmcgarry.\" POSSIBILITY OF SUCH DAMAGE. 294d4c1038Sgmcgarry.\" 304d4c1038Sgmcgarry.Dd October 7, 2001 314d4c1038Sgmcgarry.Dt MCA 9 324d4c1038Sgmcgarry.Os 334d4c1038Sgmcgarry.Sh NAME 344d4c1038Sgmcgarry.Nm MCA , 354d4c1038Sgmcgarry.Nm mca_intr_establish , 364d4c1038Sgmcgarry.Nm mca_intr_disestablish , 374d4c1038Sgmcgarry.Nm mca_intr_evcnt , 384d4c1038Sgmcgarry.Nm mca_conf_read , 394d4c1038Sgmcgarry.Nm mca_conf_write 404d4c1038Sgmcgarry.Nd MicroChannel Architecture bus 414d4c1038Sgmcgarry.Sh SYNOPSIS 429a37c59cSdyoung.In sys/bus.h 43472351e1Swiz.In dev/mca/mcavar.h 44472351e1Swiz.In dev/mca/mcadevs.h 454d4c1038Sgmcgarry.Ft void * 464d4c1038Sgmcgarry.Fn mca_intr_establish "mca_chipset_tag_t mc" "mca_intr_handle_t hdl" \ 474d4c1038Sgmcgarry"int level" "int (*handler)(void *)" "void *arg" 484d4c1038Sgmcgarry.Ft void 494d4c1038Sgmcgarry.Fn mca_intr_disestablish "mca_chipset_tag_t mc" "mca_intr_handle_t hdl" 504d4c1038Sgmcgarry.Ft const struct evcnt * 514d4c1038Sgmcgarry.Fn mca_intr_evcnt "mca_chipset_tag_t mc" "mca_intr_handle_t hdl" 524d4c1038Sgmcgarry.Ft int 534d4c1038Sgmcgarry.Fn mca_conf_read "mca_chipset_tag_t mc" "int slot" "int reg" 544d4c1038Sgmcgarry.Ft void 554d4c1038Sgmcgarry.Fn mca_conf_write "mca_chipset_tag_t mc" "int slot" "int reg" \ 564d4c1038Sgmcgarry"int data" 574d4c1038Sgmcgarry.Sh DESCRIPTION 584d4c1038SgmcgarryThe 594d4c1038Sgmcgarry.Nm 604d4c1038Sgmcgarrydevice provides support for IBM's MicroChannel Architecture bus found 61770eef21Swizon IBM PS/2 systems and selected workstations. 62770eef21SwizIt was designed as a replacement bus for the ISA bus found on IBM's 63770eef21Swizolder machines. 644d4c1038SgmcgarryHowever, the bus specifications were only available under license, so 654d4c1038SgmcgarryMCA did not achieve widespread acceptance in the industry. 664d4c1038Sgmcgarry.Pp 674d4c1038SgmcgarryBeing a replacement for the ISA bus, the MCA bus does share some 68770eef21Swizsimilar aspects with the ISA bus. 69770eef21SwizSome MCA devices can be detected via the usual ISA-style probing. 70770eef21SwizHowever, most device detection is done through the Programmable Option 71770eef21SwizSelect (POS) registers. 72770eef21SwizThese registers provide a window into a device to determine device-specific 73770eef21Swizproperties and configuration. 74770eef21SwizThe configuration of devices and their POS registers is performed using 75770eef21SwizIBM's system configuration software. 764d4c1038Sgmcgarry.Pp 774d4c1038SgmcgarryThe MCA bus uses level-triggered interrupts while the ISA bus uses 78770eef21Swizedge-triggered interrupts. 79770eef21SwizLevel triggered interrupts have the advantage that they can be shared 80770eef21Swizamong multiple device. 81770eef21SwizTherefore, most MCA-specific devices should be coded with shared 82770eef21Swizinterrupts in mind. 834d4c1038Sgmcgarry.Sh DATA TYPES 844d4c1038SgmcgarryDrivers for devices attached to the MCA bus will make use of the 854d4c1038Sgmcgarryfollowing data types: 864d4c1038Sgmcgarry.Bl -tag -width compact 874d4c1038Sgmcgarry.It Fa mca_chipset_tag_t 884d4c1038SgmcgarryChipset tag for the MCA bus. 894d4c1038Sgmcgarry.It Fa mca_intr_handle_t 904d4c1038SgmcgarryThe opaque handle describing an established interrupt handler. 914d4c1038Sgmcgarry.It Fa struct mca_attach_args 924d4c1038SgmcgarryA structure use to inform the driver of MCA bus properties. 934d4c1038SgmcgarryIt contains the following members: 944d4c1038Sgmcgarry.Bd -literal 954d4c1038Sgmcgarry bus_space_tag_t ma_iot; /* MCA I/O space tag */ 964d4c1038Sgmcgarry bus_space_tag_t ma_memt; /* MCA mem space tag */ 974d4c1038Sgmcgarry bus_dma_tag_t ma_dmat; /* MCA DMA tag */ 984d4c1038Sgmcgarry int ma_slot; /* MCA slot number */ 994d4c1038Sgmcgarry int ma_pos[8]; /* MCA POS values */ 1004d4c1038Sgmcgarry int ma_id; /* MCA device */ 1014d4c1038Sgmcgarry.Ed 1024d4c1038Sgmcgarry.El 1034d4c1038Sgmcgarry.Sh FUNCTIONS 1044d4c1038Sgmcgarry.Bl -tag -width compact 1054d4c1038Sgmcgarry.It Fn mca_intr_establish "mc" "hdl" "level" "handler" "arg" 1064d4c1038SgmcgarryEstablish a MCA interrupt handler on the MCA bus specified by 1074d4c1038Sgmcgarry.Fa mc 1084d4c1038Sgmcgarryfor the interrupt described completely by 1094d4c1038Sgmcgarry.Fa hdl . 1104d4c1038SgmcgarryThe priority of the interrupt is specified by 1114d4c1038Sgmcgarry.Fa level . 1124d4c1038SgmcgarryWhen the interrupt occurs the function 1134d4c1038Sgmcgarry.Fa handler 1144d4c1038Sgmcgarryis called with argument 1154d4c1038Sgmcgarry.Fa arg . 1164d4c1038Sgmcgarry.It Fn mca_intr_disestablish "mc" "hdl" 1174d4c1038SgmcgarryDis-establish the interrupt handler on the MCA bus specified by 1184d4c1038Sgmcgarry.Fa mc 1194d4c1038Sgmcgarryfor the interrupt described completely 1204d4c1038Sgmcgarry.Fa hdl . 1214d4c1038Sgmcgarry.It Fn mca_intr_evcnt "mc" "hdl" 1224d4c1038SgmcgarryDo interrupt event counting on the MCA bus specified by 1234d4c1038Sgmcgarry.Fa mc 1244d4c1038Sgmcgarryfor the event described completely by 1254d4c1038Sgmcgarry.Fa hdl . 1264d4c1038Sgmcgarry.It Fn mca_conf_read "mc" "slot" "reg" 1274d4c1038SgmcgarryRead the POS register 1284d4c1038Sgmcgarry.Fa reg 1294d4c1038Sgmcgarryfor the device in slot 1304d4c1038Sgmcgarry.Fa slot 1314d4c1038Sgmcgarryon the MCA bus specified by 1324d4c1038Sgmcgarry.Fa mc . 1334d4c1038Sgmcgarry.It Fn mca_conf_write "mc" "slot" "reg" "data" 1344d4c1038SgmcgarryWrite data 1354d4c1038Sgmcgarry.Fa data 1364d4c1038Sgmcgarryto the POS register 1374d4c1038Sgmcgarry.Fa reg 1384d4c1038Sgmcgarryfor the device in slot 1394d4c1038Sgmcgarry.Fa slot 1404d4c1038Sgmcgarryon the MCA bus specified by 1414d4c1038Sgmcgarry.Fa mc . 1424d4c1038Sgmcgarry.El 1434d4c1038Sgmcgarry.Sh AUTOCONFIGURATION 144770eef21SwizThe MCA bus is a direct-connection bus. 145770eef21SwizDuring autoconfiguration, the parent specifies the MCA device ID for the 146770eef21Swizfound device in the 1474d4c1038Sgmcgarry.Fa ma_id 1484d4c1038Sgmcgarrymember of the 1494d4c1038Sgmcgarry.Em mca_attach_args 150770eef21Swizstructure. 151770eef21SwizDrivers should match on the device ID. 152770eef21SwizDevice capabilities and configuration information should be read from 153770eef21Swizdevice POS registers using 1544d4c1038Sgmcgarry.Fn mca_conf_read . 1554d4c1038SgmcgarrySome important configuration information found in the POS registers 1564d4c1038Sgmcgarryinclude the I/O base address, memory base address and interrupt 157770eef21Swiznumber. 158770eef21SwizThe location of these configurable options with the POS registers are 159770eef21Swizdevice specific. 1604d4c1038Sgmcgarry.Sh DMA SUPPORT 161770eef21SwizThe MCA bus supports 32-bit, bidirectional DMA transfers. 162770eef21SwizCurrently, no machine-independent support for MCA DMA is available. 1634d4c1038Sgmcgarry.Sh CODE REFERENCES 1644d4c1038SgmcgarryThe MCA subsystem itself is implemented within the file 1654d4c1038Sgmcgarry.Pa sys/dev/mca/mca_subr.c . 1664d4c1038SgmcgarryMachine-dependent portions can be found in 167*01869ca4Swiz.Pa sys/arch/<arch>/mca/mca_machdep.c . 1684d4c1038SgmcgarryThe database of known devices exists within the file 16939d81999Snjoly.Pa sys/dev/mca/mcadevs_data.h 1704d4c1038Sgmcgarryand is generated automatically from the file 1714d4c1038Sgmcgarry.Pa sys/dev/mca/mcadevs . 172770eef21SwizNew vendor and product identifiers should be added to this file. 173770eef21SwizThe database can be regenerated using the Makefile 1744d4c1038Sgmcgarry.Pa sys/dev/mca/Makefile.mcadevs . 1754d4c1038Sgmcgarry.Pp 1764d4c1038SgmcgarryA good source of information about MCA devices is IBM's system 177770eef21Swizconfiguration disk. 178770eef21SwizThe disk contains .adf files which describe the location of device 179770eef21Swizconfiguration options in the POS registers. 1804d4c1038Sgmcgarry.Sh SEE ALSO 1814d4c1038Sgmcgarry.Xr mca 4 , 1824d4c1038Sgmcgarry.Xr autoconf 9 , 1834d4c1038Sgmcgarry.Xr bus_dma 9 , 1844d4c1038Sgmcgarry.Xr bus_space 9 , 1854d4c1038Sgmcgarry.Xr driver 9 , 1864d4c1038Sgmcgarry.Xr isa 9 1874d4c1038Sgmcgarry.Sh BUGS 1884d4c1038SgmcgarryThe machine-independent 1894d4c1038Sgmcgarry.Nm 190770eef21Swizdriver does not currently support DMA. 191770eef21SwizMCA devices which require DMA operation currently access the DMA 192770eef21Swizcapabilities directly. 193