1 .\" $NetBSD: vme.9,v 1.10 2003/06/30 19:12:34 wiz Exp $
3 .\" Copyright (c) 2001 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" This code is derived from software contributed to The NetBSD Foundation
7 .\" by Gregory McGarry.
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
39 .Nm vme_intr_establish ,
40 .Nm vme_intr_disestablish ,
42 .Nm vme_dmamap_create ,
43 .Nm vme_dmamap_destroy ,
44 .Nm vme_dmamem_alloc ,
49 .Nd Versa Module Euroboard bus
55 .Fn vme_probe "void *vc" "vme_addr_t vmeaddr" "vme_size_t len" "vme_am_t am" \
56 "vme_datasize_t datasize" \
57 "int (*callback)()" "void *arg"
60 .Fa "void *vc" "vme_addr_t vmeaddr" "vme_size_t len" \
61 "vme_am_t am" "vme_datasize_t datasize" "vme_swap_t swap" \
62 "bus_space_tag_t *tag" "bus_space_handle_t *handle" "vme_mapresc_t *resc"
65 .Fn vme_space_unmap "void *vc" "vme_mapresc_t resc"
67 .Fn vme_intr_map "void *vc" "int level" "int vector" \
68 "vme_intr_handle_t *handlep"
70 .Fn vme_intr_establish "void *vc" "vme_intr_handle_t handle" "int prio" \
71 "int (*func)(void *)" "void *arg"
73 .Fn vme_intr_disestablish "void *vc" "void *cookie"
74 .Ft const struct evcnt *
75 .Fn vme_intr_evcnt "void *vc" "vme_intr_handle_t handle"
78 .Fa "void *vc" "vme_size_t size" "vme_am_t am" "vme_datasize_t datasize"
79 .Fa "vme_swap_t swap" "int nsegs" "vme_size_t segsz" "vme_addr_t bound"
80 .Fa "int flags" "bus_dmamap_t *map"
83 .Fn vme_dmamap_destroy "void *vc" "bus_dmamap_t map"
86 .Fa "void *vc" "vme_size_t size" "vme_am_t am" \
87 "vme_datasize_t datasize" "vme_swap_t swap" "bus_dma_segment_t *segs" \
88 "int nsegs" "int *rsegs" "int flags"
91 .Fn vme_dmamem_free "void *vc" "bus_dma_segment_t *segs" "int nsegs"
93 .Fn vme_space_alloc "struct vmebus_softc *tag" "vme_addr_t addr" "vme_size_t size" "vme_am_t ams"
95 .Fn vme_space_free "void *vc" "vme_addr_t addr" "vme_size_t size" \
98 .Fn vme_space_get "void *vc" "vme_size_t size" "vme_am_t ams" \
99 "u_long align" "vme_addr_t *addr"
103 bus provides support for VME devices.
104 The VME bus is a high-performance backplane bus for use in computer systems.
105 It is based on the VMEbus specification initially released by the VMEbus
106 International Trade Association (VITA) in August of 1982.
107 It has since undergone IEC and IEEE standardisation.
109 The VME bus supports 8, 16, and 32-bit transfers over non-multiplexed
110 32-bit data and address paths.
111 The latest revisions allow 64-bit, multiplexed transfers.
112 It supports asynchronous, fully handshaken transfers at speeds
114 It has a master-slave architecture, encouraging multiprocessing and
115 supports up to seven interrupt levels.
117 Drivers attached to the
119 bus will make use of the following data types:
120 .Bl -tag -width compact
121 .It Fa vme_chipset_tag_t
122 An opaque type identifying the bus controller.
124 Addresses on the bus.
127 Valid values are VME_AM_A32, VME_AM_A16, VME_AM_A24, VME_AM_USERDEF
128 (user/vendor definable), VME_AM_MBO, VME_AM_SUPER, VME_AM_USER,
129 VME_AM_DATA, VME_AM_PRG, VME_AM_BLT32 and VME_AM_BLT64.
130 .It Fa vme_datasize_t
131 The datasize of the address space.
132 Valid values are VME_D8, VME_D16, and VME_D32.
134 Generic placeholder for any resources needed for a mapping.
135 .It Fa vme_intr_handle_t
136 An opaque type describing an interrupt mapping.
138 Hardware swap capabilities for controlling data endianness.
139 Valid values have not been specified yet.
140 .It Fa struct vme_range
141 A structure used to describe an address range on the VME bus.
142 It contains the following members:
148 .It Fa struct vme_attach_args
149 A structure used to inform the driver of the
151 It contains the following members:
153 vme_chipset_tag_t va_vct;
154 bus_dma_tag_t va_bdt;
158 struct vme_range r[VME_MAXCFRANGES];
162 .Bl -tag -width compact
163 .It Fn vme_probe "vc" "vmeaddr" "len" "am" "datasize" "callback" "arg"
164 Probes the VME space managed by controller
170 with address modifiers
175 If a VME device is found, the function
177 (if it is not NULL) is called to perform device-specific
180 is called with the argument
182 and the bus-space tag and bus-space handle for accessing the VME space
183 mapping and should return a nonzero positive integer for a positive
185 .It Fn vme_space_map "vc" "vmeaddr" "len" "am" "datasize" "swap" "tag" "handle" "resc"
186 Maps the VME space managed by controller
192 with address modifiers
199 If the mapping is successful
201 contains the bus-space tag and
203 contains the bus-space handle for accessing the VME space mapping.
205 contains the resources for the mappings.
207 returns 0 on success, and nonzero on error.
208 .It Fn vme_space_unmap "vc" "resc"
209 Unmaps the VME space mapping managed by controller
213 .It Fn vme_intr_map "vc" "level" "vector" "handlep"
216 to a machine-dependent value which identifies a particular interrupt
224 returns zero on success, and nonzero on failure.
225 .It Fn vme_intr_establish "vc" "handle" "prio" "func" "arg"
226 Establishes the interrupt handler
228 When the device interrupts,
230 will be called with a single argument
232 and will run at the interrupt priority level
235 .Fn vme_intr_establish
236 may be saved and passed to
237 .Fn vme_intr_disestablish .
238 .It Fn vme_intr_disestablish "vc" "cookie"
239 Disables the interrupt handler when the driver is no longer interested
240 in interrupts from the device.
242 is the value returned by
243 .Fn vme_intr_establish .
244 .It Fn vme_intr_evcnt "vc" "handle"
245 Increment the interrupt event counter for the interrupt specified by
247 .It Fn vme_dmamap_create "vc" "size" "am" "datasize" "swap" "nsegs" "segsz" "bound" "flags" "map"
248 Allocates a DMA handle and initializes it according to the parameters
250 The VME-specific parameters describe the address-space modifiers
256 The remaining parameters are described in
258 .It Fn vme_dmamap_destroy "vc" "map"
259 Frees all resources associated with a given DMA handle.
260 The parameters are described in
262 .It Fn vme_dmamem_alloc "vc" "size" "am" "datasize" "swap" "segs" "nsegs" "rsegs" "flags"
263 Allocates memory that is
266 .Dc for the VME bus managed by
269 The VME-specific parameters describe the
270 address-space modifiers
276 The remaining parameters are described in
278 .It Fn vme_dmamem_free "vc" "segs" "nsegs"
279 Frees memory previously allocated by
281 for the VME space managed by controller
283 .It Fn vme_space_alloc "tag" "addr" "size" "ams"
284 Allocate VME space for the bus-space
290 and address-space modifiers
293 returns EINVAL on invalid inputs.
294 .It Fn vme_space_free "vc" "addr" "size" "ams"
295 Deallocate VME space for the bus-space
301 and address-space modifiers
303 .It Fn vme_space_get "vc" "size" "ams" "align" "addr"
304 Returns EINVAL on invalid inputs.
306 .Sh AUTOCONFIGURATION
307 The VME bus is an indirect-connection bus.
308 During autoconfiguration each driver is required to probe the bus
309 for the presence of a device.
310 A VME driver will receive a pointer to a
311 .Fa struct vme_attach_args
312 hinting at "locations" (address ranges) on the VME bus where the
313 device may be located.
314 The driver should check the number of address
315 ranges, allocate the address space of these ranges using
316 .Fn vme_space_alloc ,
317 and probe the address space for the device using
320 During driver attach the driver should also map the address ranges
323 The interrupt locators in
324 .Fa struct vme_attach_args
328 .Fn vme_intr_establish .
330 Extensive DMA facilities are provided.
332 This section describes places within the
334 source tree where actual code implementing or using the
337 subsystem can be found.
338 All pathnames are relative to
343 subsystem itself is implemented within the file
344 .Pa sys/dev/vme/vme.c .
352 The machine-independent VME subsystem appeared in
355 This page is incomplete.