xref: /netbsd-src/share/man/man9/ioasic.9 (revision 01869ca4d24a86379a68731bf9706a9f0820fe4e)
1*01869ca4Swiz.\"     $NetBSD: ioasic.9,v 1.13 2017/07/03 21:28:48 wiz Exp $
28752c231Sgmcgarry.\"
38752c231Sgmcgarry.\" Copyright (c) 2000 The NetBSD Foundation, Inc.
48752c231Sgmcgarry.\" All rights reserved.
58752c231Sgmcgarry.\"
68752c231Sgmcgarry.\" This code is derived from software contributed to The NetBSD Foundation
78752c231Sgmcgarry.\" by Gregory McGarry.
88752c231Sgmcgarry.\"
98752c231Sgmcgarry.\" Redistribution and use in source and binary forms, with or without
108752c231Sgmcgarry.\" modification, are permitted provided that the following conditions
118752c231Sgmcgarry.\" are met:
128752c231Sgmcgarry.\" 1. Redistributions of source code must retain the above copyright
138752c231Sgmcgarry.\"    notice, this list of conditions and the following disclaimer.
148752c231Sgmcgarry.\" 2. Redistributions in binary form must reproduce the above copyright
158752c231Sgmcgarry.\"    notice, this list of conditions and the following disclaimer in the
168752c231Sgmcgarry.\"    documentation and/or other materials provided with the distribution.
178752c231Sgmcgarry.\"
188752c231Sgmcgarry.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
198752c231Sgmcgarry.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
208752c231Sgmcgarry.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
218752c231Sgmcgarry.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
228752c231Sgmcgarry.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
238752c231Sgmcgarry.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
248752c231Sgmcgarry.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
258752c231Sgmcgarry.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
268752c231Sgmcgarry.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
278752c231Sgmcgarry.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
288752c231Sgmcgarry.\" POSSIBILITY OF SUCH DAMAGE.
298752c231Sgmcgarry.\"
308752c231Sgmcgarry.Dd August 6, 2000
318752c231Sgmcgarry.Dt IOASIC 9
328752c231Sgmcgarry.Os
338752c231Sgmcgarry.Sh NAME
348752c231Sgmcgarry.Nm IOASIC ,
358752c231Sgmcgarry.Nm ioasic_intr_establish ,
368752c231Sgmcgarry.Nm ioasic_intr_disestablish ,
378752c231Sgmcgarry.Nm ioasic_intr_evcnt ,
388752c231Sgmcgarry.Nm ioasic_attach_devs ,
398752c231Sgmcgarry.Nm ioasic_submatch
408752c231Sgmcgarry.Nd baseboard I/O control ASIC for DEC TURBOchannel systems
418752c231Sgmcgarry.Sh SYNOPSIS
425c997b3eSdyoung.In sys/bus.h
43472351e1Swiz.In dev/tc/tcvar.h
44472351e1Swiz.In dev/tc/ioasicreg.h
45472351e1Swiz.In dev/tc/ioasicvar.h
468752c231Sgmcgarry.Ft void
478752c231Sgmcgarry.Fn ioasic_intr_establish "struct device *dev" "void *cookie" "int level" \
488752c231Sgmcgarry"int (*handler)(void *)" "void *arg"
498752c231Sgmcgarry.Ft void
508752c231Sgmcgarry.Fn ioasic_intr_disestablish "struct device *dev" "void *cookie"
518752c231Sgmcgarry.Ft const struct evcnt *
528752c231Sgmcgarry.Fn ioasic_intr_evcnt "struct device *dev" "void *cookie"
538752c231Sgmcgarry.Ft void
548752c231Sgmcgarry.Fn ioasic_attach_devs "struct ioasic_softc *sc" \
558752c231Sgmcgarry"struct ioasic_dev *ioasic_devs" "int ioasic_ndevs"
568752c231Sgmcgarry.Ft int
578752c231Sgmcgarry.Fn ioasic_submatch "struct cfdata *match" "struct ioasicdev_attach_args *ia"
588752c231Sgmcgarry.Sh DESCRIPTION
598752c231SgmcgarryThe
608752c231Sgmcgarry.Nm
61a4d0e4c9Sgmcgarrydevice provides support for the DEC proprietary IOCTL ASIC found on
628752c231Sgmcgarryall DEC TURBOchannel machines with MIPS (DECstation 5000 series,
63c4903310Swizexcluding the 5000/200) and Alpha (3000-series) systems.
64c4903310SwizThe
658752c231Sgmcgarry.Nm
668752c231Sgmcgarryis memory-mapped into the TURBOchannel system slot to interface up to
67c4903310Swizsixteen I/O devices.
68c4903310SwizIt connects the TURBOchannel to a 16-bit wide I/O bus and supplies
69c4903310Swizvarious control signals to the devices that share this bus.
708752c231Sgmcgarry.Pp
718752c231SgmcgarryThe
728752c231Sgmcgarry.Nm
73c4903310Swizprovides hardware DMA channels and interrupt support.
74c4903310SwizDMA transfers are between one and four 32-bit words (16 bytes) in
75c4903310Swizlength, depending on the device.
76c4903310SwizThe
778752c231Sgmcgarry.Nm
78c4903310Swizstores the data in internal data registers.
79c4903310SwizThe data is transferred to and from the registers in 16-bit words
80c4903310Swizto the device.
81c4903310SwizVarious interrupts are signalled on DMA pointer-related conditions.
828752c231Sgmcgarry.Sh DATA TYPES
838752c231SgmcgarryDrivers for devices attached to the
848752c231Sgmcgarry.Nm
858752c231Sgmcgarrywill make use of the following data types:
868752c231Sgmcgarry.Bl -tag -width compact
878752c231Sgmcgarry.It Fa struct ioasicdev_attach_args
888752c231SgmcgarryA structure used to inform the driver of the
898752c231Sgmcgarry.Nm
90c4903310Swizdevice properties.
91c4903310SwizIt contains the following members:
928752c231Sgmcgarry.Bd -literal
938752c231Sgmcgarry	char			iada_modname
948752c231Sgmcgarry	tc_offset_t		iada_offset
958752c231Sgmcgarry	tc_addr_t		iada_addr
968752c231Sgmcgarry	void			*iada_cookie;
978752c231Sgmcgarry.Ed
988752c231Sgmcgarry.It Fa struct ioasic_softc
998752c231SgmcgarryThe parent structure which contains at the following members which are
1008752c231Sgmcgarryuseful for drivers:
1018752c231Sgmcgarry.Bd -literal
1028752c231Sgmcgarry	bus_space_tag_t		sc_bst;
1038752c231Sgmcgarry	bus_space_handle_t	sc_bsh;
1048752c231Sgmcgarry	bus_dma_tag_t		sc_dmat;
1058752c231Sgmcgarry.Ed
1068752c231Sgmcgarry.It Fa struct ioasic_dev
1078752c231SgmcgarryA structure describing the machine-dependent devices attached to the
1088752c231Sgmcgarry.Nm
1098752c231Sgmcgarrycontaining the following members:
1108752c231Sgmcgarry.Bd -literal
1118752c231Sgmcgarry	char			*iad_modname;
1128752c231Sgmcgarry	tc_offset_t		iad_offset;
1138752c231Sgmcgarry	void			*iad_cookie;
114fd18408bSperry	uint32_t		iad_intrbits;
1158752c231Sgmcgarry.Ed
1168752c231Sgmcgarry.El
1178752c231Sgmcgarry.Sh FUNCTIONS
1188752c231Sgmcgarry.Bl -tag -width compact
1198752c231Sgmcgarry.It Fn ioasic_intr_establish "dev" "cookie" "level" "handler" "arg"
1208752c231SgmcgarryEstablish an interrupt handler with device
1218752c231Sgmcgarry.Fa dev
1228752c231Sgmcgarryfor the interrupt described completely by
1238752c231Sgmcgarry.Fa cookie .
1248752c231SgmcgarryThe priority of the interrupt is specified by
1258752c231Sgmcgarry.Fa level .
1268752c231SgmcgarryWhen the interrupt occurs the function
1278752c231Sgmcgarry.Fa handler
1288752c231Sgmcgarryis called with argument
1298752c231Sgmcgarry.Fa arg .
1308752c231Sgmcgarry.It Fn ioasic_intr_disestablish "dev" "cookie"
1318752c231SgmcgarryDis-establish the interrupt handler with device
1328752c231Sgmcgarry.Fa dev
1338752c231Sgmcgarryfor the interrupt described complete ly
1348752c231Sgmcgarry.Fa cookie .
1358752c231Sgmcgarry.It Fn ioasic_intr_evcnt "dev" "cookie"
1368752c231SgmcgarryDo interrupt event counting with device
1378752c231Sgmcgarry.Fa dev
1388752c231Sgmcgarryfor the event described completely by
1398752c231Sgmcgarry.Fa cookie .
1408752c231Sgmcgarry.It Fn ioasic_attach_devs "sc" "ioasic_devs" "ioasic_ndevs"
1418752c231SgmcgarryConfigure each of the
1428752c231Sgmcgarry.Fa ioasic_ndevs
1438752c231Sgmcgarrydevices in
1448752c231Sgmcgarry.Fa ioasic_devs .
1458752c231Sgmcgarry.It Fn ioasic_submatch "match" "ia"
1468752c231SgmcgarryCheck that the device offset is not OASIC_OFFSET_UNKNOWN.
1478752c231Sgmcgarry.El
1488752c231Sgmcgarry.Pp
1498752c231SgmcgarryThe
1508752c231Sgmcgarry.Fn ioasic_intr_establish ,
1518752c231Sgmcgarry.Fn ioasic_intr_disestablish ,
1528752c231Sgmcgarryand
1538752c231Sgmcgarry.Fn ioasic_intr_evcnt
1548752c231Sgmcgarryfunctions are likely to used by all
1558752c231Sgmcgarry.Nm
156c4903310Swizdevice drivers.
157c4903310SwizThe
1588752c231Sgmcgarry.Fn ioasic_attach_devs
1598752c231Sgmcgarryfunction is used by ioasic driver internally and is of interest to
1608752c231Sgmcgarrydriver writers because it must be aware of your device for it to be
1618752c231Sgmcgarryfound during autoconfiguration.
1628752c231Sgmcgarry.Sh AUTOCONFIGURATION
163c4903310SwizThe IOASIC is a direct-connection bus.
164c4903310SwizDuring autoconfiguration, machine-dependent code will provide an array of
1658752c231Sgmcgarry.Fa struct ioasic_devs
1668752c231Sgmcgarrydescribing devices attached to the
1678752c231Sgmcgarry.Nm
168c4903310Swizto be used by the ioasic driver.
169c4903310SwizThe ioasic driver will pass this array to
1708752c231Sgmcgarry.Fn ioasic_attach_devs
1718752c231Sgmcgarryto attach the drivers with the devices.
1728752c231Sgmcgarry.Pp
1738752c231SgmcgarryDrivers match the device using
1748752c231Sgmcgarry.Fa iada_modname .
1758752c231Sgmcgarry.Pp
1768752c231SgmcgarryDuring attach, all drivers should use the parent's bus_space and
1778752c231Sgmcgarrybus_dma resources, and map the appropriate bus_space region using
1788752c231Sgmcgarry.Fn bus_space_subregion
1798752c231Sgmcgarrywith
1808752c231Sgmcgarry.Fa iada_offset .
1818752c231Sgmcgarry.Sh DMA SUPPORT
1828752c231SgmcgarryNo additional support is provided for
1838752c231Sgmcgarry.Nm
1848752c231SgmcgarryDMA beyond the facilities provided by the
1858752c231Sgmcgarry.Xr bus_dma 9
1868752c231Sgmcgarryinterface.
1878752c231Sgmcgarry.Pp
1888752c231SgmcgarryThe
1898752c231Sgmcgarry.Nm
1908752c231Sgmcgarryprovides two pairs of DMA address pointers (transmitting and
191c4903310Swizreceiving) for each DMA-capable device.
192c4903310SwizThe pair of address pointers point to consecutive (but not necessarily
193c4903310Swizcontiguous) DMA blocks of size IOASIC_DMA_BLOCKSIZE.
194c4903310SwizUpon successful transfer of the first block, DMA continues to the next
195c4903310Swizblock and an interrupt is posted to signal an address pointer update.
196c4903310SwizDMA transfers are enabled and disabled by bits inside the
1978752c231Sgmcgarry.Nm
1988752c231Sgmcgarrystatus (CSR) register.
1998752c231Sgmcgarry.Pp
2008752c231SgmcgarryThe interrupt handler must update the address pointers to point to the
201c4903310Swiznext block in the DMA transfer.
202c4903310SwizThe address pointer update must be completed before the completion of
203c4903310Swizthe second DMA block, otherwise a DMA overrun error condition will occur.
2048752c231Sgmcgarry.Sh CODE REFERENCES
2058752c231SgmcgarryThe IOASIC subsystem itself is implemented within the file
2068752c231Sgmcgarry.Pa sys/dev/tc/ioasic_subr.c .
2078752c231SgmcgarryMachine-dependent portions can be found in
208*01869ca4Swiz.Pa sys/arch/<arch>/tc/ioasic.c .
2098752c231Sgmcgarry.Sh SEE ALSO
2108752c231Sgmcgarry.Xr ioasic 4 ,
2118752c231Sgmcgarry.Xr autoconf 9 ,
2128752c231Sgmcgarry.Xr bus_dma 9 ,
2138752c231Sgmcgarry.Xr bus_space 9 ,
214a4d0e4c9Sgmcgarry.Xr driver 9
215