xref: /onnv-gate/usr/src/uts/common/sys/ddidmareq.h (revision 0:68f95e015346)
1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate  * CDDL HEADER START
3*0Sstevel@tonic-gate  *
4*0Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*0Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*0Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*0Sstevel@tonic-gate  * with the License.
8*0Sstevel@tonic-gate  *
9*0Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*0Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*0Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*0Sstevel@tonic-gate  * and limitations under the License.
13*0Sstevel@tonic-gate  *
14*0Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*0Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*0Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*0Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*0Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*0Sstevel@tonic-gate  *
20*0Sstevel@tonic-gate  * CDDL HEADER END
21*0Sstevel@tonic-gate  */
22*0Sstevel@tonic-gate /*
23*0Sstevel@tonic-gate  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24*0Sstevel@tonic-gate  * Use is subject to license terms.
25*0Sstevel@tonic-gate  */
26*0Sstevel@tonic-gate 
27*0Sstevel@tonic-gate #ifndef	_SYS_DDIDMAREQ_H
28*0Sstevel@tonic-gate #define	_SYS_DDIDMAREQ_H
29*0Sstevel@tonic-gate 
30*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*0Sstevel@tonic-gate 
32*0Sstevel@tonic-gate #ifdef	__cplusplus
33*0Sstevel@tonic-gate extern "C" {
34*0Sstevel@tonic-gate #endif
35*0Sstevel@tonic-gate 
36*0Sstevel@tonic-gate /*
37*0Sstevel@tonic-gate  * Memory Objects
38*0Sstevel@tonic-gate  *
39*0Sstevel@tonic-gate  * Definitions of structures that can describe
40*0Sstevel@tonic-gate  * an object that can be mapped for DMA.
41*0Sstevel@tonic-gate  */
42*0Sstevel@tonic-gate 
43*0Sstevel@tonic-gate /*
44*0Sstevel@tonic-gate  * Structure describing a virtual address
45*0Sstevel@tonic-gate  */
46*0Sstevel@tonic-gate struct v_address {
47*0Sstevel@tonic-gate 	caddr_t		v_addr;		/* base virtual address */
48*0Sstevel@tonic-gate 	struct	as	*v_as;		/* pointer to address space */
49*0Sstevel@tonic-gate 	void 		*v_priv;	/* priv data for shadow I/O */
50*0Sstevel@tonic-gate };
51*0Sstevel@tonic-gate 
52*0Sstevel@tonic-gate /*
53*0Sstevel@tonic-gate  * Structure describing a page-based address
54*0Sstevel@tonic-gate  */
55*0Sstevel@tonic-gate struct pp_address {
56*0Sstevel@tonic-gate 	/*
57*0Sstevel@tonic-gate 	 * A pointer to a circularly linked list of page structures.
58*0Sstevel@tonic-gate 	 */
59*0Sstevel@tonic-gate 	struct page *pp_pp;
60*0Sstevel@tonic-gate 	uint_t pp_offset;	/* offset within first page */
61*0Sstevel@tonic-gate };
62*0Sstevel@tonic-gate 
63*0Sstevel@tonic-gate /*
64*0Sstevel@tonic-gate  * Structure to describe a physical memory address.
65*0Sstevel@tonic-gate  */
66*0Sstevel@tonic-gate struct phy_address {
67*0Sstevel@tonic-gate 	ulong_t	p_addr;		/* base physical address */
68*0Sstevel@tonic-gate 	ulong_t	p_memtype;	/* memory type */
69*0Sstevel@tonic-gate };
70*0Sstevel@tonic-gate 
71*0Sstevel@tonic-gate /*
72*0Sstevel@tonic-gate  * A union of all of the above structures.
73*0Sstevel@tonic-gate  *
74*0Sstevel@tonic-gate  * This union describes the relationship between
75*0Sstevel@tonic-gate  * the kind of an address description and an object.
76*0Sstevel@tonic-gate  */
77*0Sstevel@tonic-gate typedef union {
78*0Sstevel@tonic-gate 	struct v_address virt_obj;	/* Some virtual address		*/
79*0Sstevel@tonic-gate 	struct pp_address pp_obj;	/* Some page-based address	*/
80*0Sstevel@tonic-gate 	struct phy_address phys_obj;	/* Some physical address	*/
81*0Sstevel@tonic-gate } ddi_dma_aobj_t;
82*0Sstevel@tonic-gate 
83*0Sstevel@tonic-gate /*
84*0Sstevel@tonic-gate  * DMA object types - used to select how the object
85*0Sstevel@tonic-gate  * being mapped is being addressed by the IU.
86*0Sstevel@tonic-gate  */
87*0Sstevel@tonic-gate typedef enum {
88*0Sstevel@tonic-gate 	DMA_OTYP_VADDR = 0,	/* enforce starting value of zero */
89*0Sstevel@tonic-gate 	DMA_OTYP_PAGES,
90*0Sstevel@tonic-gate 	DMA_OTYP_PADDR,
91*0Sstevel@tonic-gate 	DMA_OTYP_BUFVADDR
92*0Sstevel@tonic-gate } ddi_dma_atyp_t;
93*0Sstevel@tonic-gate 
94*0Sstevel@tonic-gate /*
95*0Sstevel@tonic-gate  * A compact package to describe an object that is to be mapped for DMA.
96*0Sstevel@tonic-gate  */
97*0Sstevel@tonic-gate typedef struct {
98*0Sstevel@tonic-gate 	uint_t		dmao_size;	/* size, in bytes, of the object */
99*0Sstevel@tonic-gate 	ddi_dma_atyp_t	dmao_type;	/* type of object */
100*0Sstevel@tonic-gate 	ddi_dma_aobj_t	dmao_obj;	/* the object described */
101*0Sstevel@tonic-gate } ddi_dma_obj_t;
102*0Sstevel@tonic-gate 
103*0Sstevel@tonic-gate /*
104*0Sstevel@tonic-gate  * DMA addressing limits.
105*0Sstevel@tonic-gate  *
106*0Sstevel@tonic-gate  * This structure describes the constraints that a particular device's
107*0Sstevel@tonic-gate  * DMA engine has to its parent so that the parent may correctly set
108*0Sstevel@tonic-gate  * things up for a DMA mapping. Each parent may in turn modify the
109*0Sstevel@tonic-gate  * constraints listed in a DMA request structure in order to describe
110*0Sstevel@tonic-gate  * to its parent any changed or additional constraints. The rules
111*0Sstevel@tonic-gate  * are that each parent may modify a constraint in order to further
112*0Sstevel@tonic-gate  * constrain things (e.g., picking a more limited address range than
113*0Sstevel@tonic-gate  * that permitted by the child), but that the parent may not ignore
114*0Sstevel@tonic-gate  * a child's constraints.
115*0Sstevel@tonic-gate  *
116*0Sstevel@tonic-gate  * A particular constraint that we do *not* address is whether or not
117*0Sstevel@tonic-gate  * a requested mapping is too large for a DMA engine's counter to
118*0Sstevel@tonic-gate  * correctly track. It is still up to each driver to explicitly handle
119*0Sstevel@tonic-gate  * transfers that are too large for its own hardware to deal with directly.
120*0Sstevel@tonic-gate  *
121*0Sstevel@tonic-gate  * The mapping routines that are cognizant of this structure will
122*0Sstevel@tonic-gate  * copy any user defined limits structure if they need to modify
123*0Sstevel@tonic-gate  * the fields (as alluded to above).
124*0Sstevel@tonic-gate  *
125*0Sstevel@tonic-gate  * A note as to how to define constraints:
126*0Sstevel@tonic-gate  *
127*0Sstevel@tonic-gate  * How you define the constraints for your device depends on how you
128*0Sstevel@tonic-gate  * define your device. For example, you may have an SBus card with a
129*0Sstevel@tonic-gate  * device on it that address only the bottom 16mb of virtual DMA space.
130*0Sstevel@tonic-gate  * However, if the card also has ancillary circuitry that pulls the high 8
131*0Sstevel@tonic-gate  * bits of address lines high, the more correct expression for your device
132*0Sstevel@tonic-gate  * is that it address [0xff000000..0xffffffff] rather than [0..0x00ffffff].
133*0Sstevel@tonic-gate  */
134*0Sstevel@tonic-gate #if defined(__sparc)
135*0Sstevel@tonic-gate typedef struct ddi_dma_lim {
136*0Sstevel@tonic-gate 
137*0Sstevel@tonic-gate 	/*
138*0Sstevel@tonic-gate 	 * Low range of 32 bit addressing capability.
139*0Sstevel@tonic-gate 	 */
140*0Sstevel@tonic-gate 	uint_t	dlim_addr_lo;
141*0Sstevel@tonic-gate 
142*0Sstevel@tonic-gate 	/*
143*0Sstevel@tonic-gate 	 * Upper inclusive bound of addressing capability. It is an
144*0Sstevel@tonic-gate 	 * inclusive boundary limit to allow for the addressing range
145*0Sstevel@tonic-gate 	 * [0..0xffffffff] to be specified in preference to [0..0].
146*0Sstevel@tonic-gate 	 */
147*0Sstevel@tonic-gate 	uint_t	dlim_addr_hi;
148*0Sstevel@tonic-gate 
149*0Sstevel@tonic-gate 	/*
150*0Sstevel@tonic-gate 	 * Inclusive upper bound with which The DMA engine's counter acts as
151*0Sstevel@tonic-gate 	 * a register.
152*0Sstevel@tonic-gate 	 *
153*0Sstevel@tonic-gate 	 * This handles the case where an upper portion of a DMA address
154*0Sstevel@tonic-gate 	 * register is a latch instead of being a full 32 bit register
155*0Sstevel@tonic-gate 	 * (e.g., the upper 8 bits may remain constant while the lower
156*0Sstevel@tonic-gate 	 * 24 bits are the real address register).
157*0Sstevel@tonic-gate 	 *
158*0Sstevel@tonic-gate 	 * This essentially gives a hint about segment limitations
159*0Sstevel@tonic-gate 	 * to the mapping routines.
160*0Sstevel@tonic-gate 	 */
161*0Sstevel@tonic-gate 	uint_t	dlim_cntr_max;
162*0Sstevel@tonic-gate 
163*0Sstevel@tonic-gate 	/*
164*0Sstevel@tonic-gate 	 * DMA burst sizes.
165*0Sstevel@tonic-gate 	 *
166*0Sstevel@tonic-gate 	 * At the time of a mapping request, this tag defines the possible
167*0Sstevel@tonic-gate 	 * DMA burst cycle sizes that the requestor's DMA engine can
168*0Sstevel@tonic-gate 	 * emit. The format of the data is binary encoding of burst sizes
169*0Sstevel@tonic-gate 	 * assumed to be powers of two. That is, if a DMA engine is capable
170*0Sstevel@tonic-gate 	 * of doing 1, 2, 4 and 16 byte transfers, the encoding would be 0x17.
171*0Sstevel@tonic-gate 	 *
172*0Sstevel@tonic-gate 	 * As the mapping request is handled by intervening nexi, the
173*0Sstevel@tonic-gate 	 * burstsizes value may be modified. Prior to enabling DMA for
174*0Sstevel@tonic-gate 	 * the specific device, the driver that owns the DMA engine should
175*0Sstevel@tonic-gate 	 * check (via ddi_dma_burstsizes(9F)) what the allowed burstsizes
176*0Sstevel@tonic-gate 	 * have become and program their DMA engine appropriately.
177*0Sstevel@tonic-gate 	 */
178*0Sstevel@tonic-gate 	uint_t	dlim_burstsizes;
179*0Sstevel@tonic-gate 
180*0Sstevel@tonic-gate 	/*
181*0Sstevel@tonic-gate 	 * Minimum effective DMA transfer size, in units of bytes.
182*0Sstevel@tonic-gate 	 *
183*0Sstevel@tonic-gate 	 * This value specifies the minimum effective granularity of the
184*0Sstevel@tonic-gate 	 * DMA engine. It is distinct from dlim_burtsizes in that it
185*0Sstevel@tonic-gate 	 * describes the minimum amount of access a DMA transfer will
186*0Sstevel@tonic-gate 	 * effect. dlim_burtsizes describes in what electrical fashion
187*0Sstevel@tonic-gate 	 * the DMA engine might perform its accesses, while dlim_minxfer
188*0Sstevel@tonic-gate 	 * describes the minimum amount of memory that can be touched by
189*0Sstevel@tonic-gate 	 * the DMA transfer.
190*0Sstevel@tonic-gate 	 *
191*0Sstevel@tonic-gate 	 * As the mapping request is handled by intervening nexi, the
192*0Sstevel@tonic-gate 	 * dlim_minxfer value may be modifed contingent upon the presence
193*0Sstevel@tonic-gate 	 * (and use) of I/O caches and DMA write buffers in between the
194*0Sstevel@tonic-gate 	 * DMA engine and the object that DMA is being performed on.
195*0Sstevel@tonic-gate 	 *
196*0Sstevel@tonic-gate 	 */
197*0Sstevel@tonic-gate 	uint_t	dlim_minxfer;
198*0Sstevel@tonic-gate 
199*0Sstevel@tonic-gate 	/*
200*0Sstevel@tonic-gate 	 * Expected average data rate for this DMA engine
201*0Sstevel@tonic-gate 	 * while transferring data.
202*0Sstevel@tonic-gate 	 *
203*0Sstevel@tonic-gate 	 * This is used as a hint for a number of operations that might
204*0Sstevel@tonic-gate 	 * want to know the possible optimal latency requirements of this
205*0Sstevel@tonic-gate 	 * device. A value of zero will be interpreted as a 'do not care'.
206*0Sstevel@tonic-gate 	 */
207*0Sstevel@tonic-gate 	uint_t	dlim_dmaspeed;
208*0Sstevel@tonic-gate 
209*0Sstevel@tonic-gate } ddi_dma_lim_t;
210*0Sstevel@tonic-gate 
211*0Sstevel@tonic-gate #elif defined(__x86)
212*0Sstevel@tonic-gate 
213*0Sstevel@tonic-gate /*
214*0Sstevel@tonic-gate  * values for dlim_minxfer
215*0Sstevel@tonic-gate  */
216*0Sstevel@tonic-gate #define	DMA_UNIT_8  1
217*0Sstevel@tonic-gate #define	DMA_UNIT_16 2
218*0Sstevel@tonic-gate #define	DMA_UNIT_32 4
219*0Sstevel@tonic-gate 
220*0Sstevel@tonic-gate /*
221*0Sstevel@tonic-gate  * Version number
222*0Sstevel@tonic-gate  */
223*0Sstevel@tonic-gate #define	DMALIM_VER0	((0x86000000) + 0)
224*0Sstevel@tonic-gate 
225*0Sstevel@tonic-gate typedef struct ddi_dma_lim {
226*0Sstevel@tonic-gate 
227*0Sstevel@tonic-gate 	/*
228*0Sstevel@tonic-gate 	 * Low range of 32 bit addressing capability.
229*0Sstevel@tonic-gate 	 */
230*0Sstevel@tonic-gate 	uint_t	dlim_addr_lo;
231*0Sstevel@tonic-gate 
232*0Sstevel@tonic-gate 	/*
233*0Sstevel@tonic-gate 	 * Upper Inclusive bound of 32 bit addressing capability.
234*0Sstevel@tonic-gate 	 *
235*0Sstevel@tonic-gate 	 * The ISA nexus restricts this to 0x00ffffff, since this bus has
236*0Sstevel@tonic-gate 	 * only 24 address lines.  This enforces the 16 Mb address limitation.
237*0Sstevel@tonic-gate 	 * The EISA nexus restricts this to 0xffffffff.
238*0Sstevel@tonic-gate 	 */
239*0Sstevel@tonic-gate 	uint_t	dlim_addr_hi;
240*0Sstevel@tonic-gate 
241*0Sstevel@tonic-gate 	/*
242*0Sstevel@tonic-gate 	 * DMA engine counter not used; set to 0
243*0Sstevel@tonic-gate 	 */
244*0Sstevel@tonic-gate 	uint_t	dlim_cntr_max;
245*0Sstevel@tonic-gate 
246*0Sstevel@tonic-gate 	/*
247*0Sstevel@tonic-gate 	 *  DMA burst sizes not used; set to 1
248*0Sstevel@tonic-gate 	 */
249*0Sstevel@tonic-gate 	uint_t	dlim_burstsizes;
250*0Sstevel@tonic-gate 
251*0Sstevel@tonic-gate 	/*
252*0Sstevel@tonic-gate 	 * Minimum effective DMA transfer size.
253*0Sstevel@tonic-gate 	 *
254*0Sstevel@tonic-gate 	 * This value specifies the minimum effective granularity of the
255*0Sstevel@tonic-gate 	 * DMA engine. It is distinct from dlim_burstsizes in that it
256*0Sstevel@tonic-gate 	 * describes the minimum amount of access a DMA transfer will
257*0Sstevel@tonic-gate 	 * effect. dlim_burstsizes describes in what electrical fashion
258*0Sstevel@tonic-gate 	 * the DMA engine might perform its accesses, while dlim_minxfer
259*0Sstevel@tonic-gate 	 * describes the minimum amount of memory that can be touched by
260*0Sstevel@tonic-gate 	 * the DMA transfer.
261*0Sstevel@tonic-gate 	 *
262*0Sstevel@tonic-gate 	 * This value also implies the required address alignment.
263*0Sstevel@tonic-gate 	 * The number of bytes transferred is assumed to be
264*0Sstevel@tonic-gate 	 * 	dlim_minxfer * (DMA engine count)
265*0Sstevel@tonic-gate 	 *
266*0Sstevel@tonic-gate 	 * It should be set to DMA_UNIT_8, DMA_UNIT_16, or DMA_UNIT_32.
267*0Sstevel@tonic-gate 	 */
268*0Sstevel@tonic-gate 	uint_t	dlim_minxfer;
269*0Sstevel@tonic-gate 
270*0Sstevel@tonic-gate 	/*
271*0Sstevel@tonic-gate 	 * Expected average data rate for this DMA engine
272*0Sstevel@tonic-gate 	 * while transferring data.
273*0Sstevel@tonic-gate 	 *
274*0Sstevel@tonic-gate 	 * This is used as a hint for a number of operations that might
275*0Sstevel@tonic-gate 	 * want to know the possible optimal latency requirements of this
276*0Sstevel@tonic-gate 	 * device. A value of zero will be interpreted as a 'do not care'.
277*0Sstevel@tonic-gate 	 */
278*0Sstevel@tonic-gate 	uint_t	dlim_dmaspeed;
279*0Sstevel@tonic-gate 
280*0Sstevel@tonic-gate 
281*0Sstevel@tonic-gate 	/*
282*0Sstevel@tonic-gate 	 * Version number of this structure
283*0Sstevel@tonic-gate 	 */
284*0Sstevel@tonic-gate 	uint_t	dlim_version;	/* = 0x86 << 24 + 0 */
285*0Sstevel@tonic-gate 
286*0Sstevel@tonic-gate 	/*
287*0Sstevel@tonic-gate 	 * Inclusive upper bound with which the DMA engine's Address acts as
288*0Sstevel@tonic-gate 	 * a register.
289*0Sstevel@tonic-gate 	 * This handles the case where an upper portion of a DMA address
290*0Sstevel@tonic-gate 	 * register is a latch instead of being a full 32 bit register
291*0Sstevel@tonic-gate 	 * (e.g., the upper 16 bits remain constant while the lower 16 bits
292*0Sstevel@tonic-gate 	 * are incremented for each DMA transfer).
293*0Sstevel@tonic-gate 	 *
294*0Sstevel@tonic-gate 	 * The ISA nexus restricts only 3rd-party DMA requests to 0x0000ffff,
295*0Sstevel@tonic-gate 	 * since the ISA DMA engine has a 16-bit register for low address and
296*0Sstevel@tonic-gate 	 * an 8-bit latch for high address.  This enforces the first 64 Kb
297*0Sstevel@tonic-gate 	 * limitation (address boundary).
298*0Sstevel@tonic-gate 	 * The EISA nexus restricts only 3rd-party DMA requests to 0xffffffff.
299*0Sstevel@tonic-gate 	 */
300*0Sstevel@tonic-gate 	uint_t	dlim_adreg_max;
301*0Sstevel@tonic-gate 
302*0Sstevel@tonic-gate 	/*
303*0Sstevel@tonic-gate 	 * Maximum transfer count that the DMA engine can handle.
304*0Sstevel@tonic-gate 	 *
305*0Sstevel@tonic-gate 	 * The ISA nexus restricts only 3rd-party DMA requests to 0x0000ffff,
306*0Sstevel@tonic-gate 	 * since the ISA DMA engine has a 16-bit register for counting.
307*0Sstevel@tonic-gate 	 * This enforces the other 64 Kb limitation (count size).
308*0Sstevel@tonic-gate 	 * The EISA nexus restricts only 3rd-party DMA requests to 0x00ffffff,
309*0Sstevel@tonic-gate 	 * since the EISA DMA engine has a 24-bit register for counting.
310*0Sstevel@tonic-gate 	 *
311*0Sstevel@tonic-gate 	 * This transfer count limitation is a per segment limitation.
312*0Sstevel@tonic-gate 	 * It can also be used to restrict the size of segments.
313*0Sstevel@tonic-gate 	 *
314*0Sstevel@tonic-gate 	 * This is used as a bit mask, so it must be a power of 2, minus 1.
315*0Sstevel@tonic-gate 	 */
316*0Sstevel@tonic-gate 	uint_t	dlim_ctreg_max;
317*0Sstevel@tonic-gate 
318*0Sstevel@tonic-gate 	/*
319*0Sstevel@tonic-gate 	 * Granularity of DMA transfer, in units of bytes.
320*0Sstevel@tonic-gate 	 *
321*0Sstevel@tonic-gate 	 * Breakup sizes must be multiples of this value.
322*0Sstevel@tonic-gate 	 * If no scatter/gather capabilty is specified, then the size of
323*0Sstevel@tonic-gate 	 * each DMA transfer must be a multiple of this value.
324*0Sstevel@tonic-gate 	 *
325*0Sstevel@tonic-gate 	 * If there is scatter/gather capability, then a single cookie cannot
326*0Sstevel@tonic-gate 	 * be smaller in size than the minimum xfer value, and may be less
327*0Sstevel@tonic-gate 	 * than the granularity value.  The total transfer length of the
328*0Sstevel@tonic-gate 	 * scatter/gather list should be a multiple of the granularity value;
329*0Sstevel@tonic-gate 	 * use dlim_sgllen to specify the length of the scatter/gather list.
330*0Sstevel@tonic-gate 	 *
331*0Sstevel@tonic-gate 	 * This value should be equal to the sector size of the device.
332*0Sstevel@tonic-gate 	 */
333*0Sstevel@tonic-gate 	uint_t	dlim_granular;
334*0Sstevel@tonic-gate 
335*0Sstevel@tonic-gate 	/*
336*0Sstevel@tonic-gate 	 * Length of scatter/gather list
337*0Sstevel@tonic-gate 	 *
338*0Sstevel@tonic-gate 	 * This value specifies the number of segments or cookies that a DMA
339*0Sstevel@tonic-gate 	 * engine can consume in one i/o request to the device.  For 3rd-party
340*0Sstevel@tonic-gate 	 * DMA that uses the bus nexus this should be set to 1.  Devices with
341*0Sstevel@tonic-gate 	 * 1st-party DMA capability should specify the number of entries in
342*0Sstevel@tonic-gate 	 * its scatter/gather list.  The breakup routine will ensure that each
343*0Sstevel@tonic-gate 	 * group of dlim_sgllen cookies (within a DMA window) will have a
344*0Sstevel@tonic-gate 	 * total transfer length that is a multiple of dlim_granular.
345*0Sstevel@tonic-gate 	 *
346*0Sstevel@tonic-gate 	 *	< 0  :  tbd
347*0Sstevel@tonic-gate 	 *	= 0  :  breakup is for PIO.
348*0Sstevel@tonic-gate 	 *	= 1  :  breakup is for DMA engine with no scatter/gather
349*0Sstevel@tonic-gate 	 *		capability.
350*0Sstevel@tonic-gate 	 *	>= 2 :  breakup is for DMA engine with scatter/gather
351*0Sstevel@tonic-gate 	 *		capability; value is max number of entries in list.
352*0Sstevel@tonic-gate 	 *
353*0Sstevel@tonic-gate 	 * Note that this list length is not dependent on the DMA window
354*0Sstevel@tonic-gate 	 * size.  The size of the DMA window is based on resources consumed,
355*0Sstevel@tonic-gate 	 * such as intermediate buffers.  Several s/g lists may exist within
356*0Sstevel@tonic-gate 	 * a window.  But the end of a window does imply the end of the s/g
357*0Sstevel@tonic-gate 	 * list.
358*0Sstevel@tonic-gate 	 */
359*0Sstevel@tonic-gate 	short	dlim_sgllen;
360*0Sstevel@tonic-gate 
361*0Sstevel@tonic-gate 	/*
362*0Sstevel@tonic-gate 	 * Size of device i/o request
363*0Sstevel@tonic-gate 	 *
364*0Sstevel@tonic-gate 	 * This value indicates the maximum number of bytes the device
365*0Sstevel@tonic-gate 	 * can transmit/receive for one i/o command.  This limitation is
366*0Sstevel@tonic-gate 	 * significant ony if it is less than (dlim_ctreg_max * dlim_sgllen).
367*0Sstevel@tonic-gate 	 */
368*0Sstevel@tonic-gate 	uint_t	dlim_reqsize;
369*0Sstevel@tonic-gate 
370*0Sstevel@tonic-gate } ddi_dma_lim_t;
371*0Sstevel@tonic-gate 
372*0Sstevel@tonic-gate #else
373*0Sstevel@tonic-gate #error "struct ddi_dma_lim not defined for this architecture"
374*0Sstevel@tonic-gate #endif	/* defined(__sparc) */
375*0Sstevel@tonic-gate 
376*0Sstevel@tonic-gate /*
377*0Sstevel@tonic-gate  * Flags definition for dma_attr_flags
378*0Sstevel@tonic-gate  */
379*0Sstevel@tonic-gate 
380*0Sstevel@tonic-gate /*
381*0Sstevel@tonic-gate  * return physical DMA address on platforms
382*0Sstevel@tonic-gate  * which support DVMA
383*0Sstevel@tonic-gate  */
384*0Sstevel@tonic-gate #define	DDI_DMA_FORCE_PHYSICAL		0x0100
385*0Sstevel@tonic-gate 
386*0Sstevel@tonic-gate /*
387*0Sstevel@tonic-gate  * An error will be flagged for DMA data path errors
388*0Sstevel@tonic-gate  */
389*0Sstevel@tonic-gate #define	DDI_DMA_FLAGERR			0x200
390*0Sstevel@tonic-gate 
391*0Sstevel@tonic-gate #define	DMA_ATTR_V0		0
392*0Sstevel@tonic-gate #define	DMA_ATTR_VERSION	DMA_ATTR_V0
393*0Sstevel@tonic-gate 
394*0Sstevel@tonic-gate typedef struct ddi_dma_attr {
395*0Sstevel@tonic-gate 	uint_t		dma_attr_version;	/* version number */
396*0Sstevel@tonic-gate 	uint64_t	dma_attr_addr_lo;	/* low DMA address range */
397*0Sstevel@tonic-gate 	uint64_t	dma_attr_addr_hi;	/* high DMA address range */
398*0Sstevel@tonic-gate 	uint64_t	dma_attr_count_max;	/* DMA counter register */
399*0Sstevel@tonic-gate 	uint64_t	dma_attr_align;		/* DMA address alignment */
400*0Sstevel@tonic-gate 	uint_t		dma_attr_burstsizes;	/* DMA burstsizes */
401*0Sstevel@tonic-gate 	uint32_t	dma_attr_minxfer;	/* min effective DMA size */
402*0Sstevel@tonic-gate 	uint64_t 	dma_attr_maxxfer;	/* max DMA xfer size */
403*0Sstevel@tonic-gate 	uint64_t 	dma_attr_seg;		/* segment boundary */
404*0Sstevel@tonic-gate 	int		dma_attr_sgllen;	/* s/g length */
405*0Sstevel@tonic-gate 	uint32_t	dma_attr_granular;	/* granularity of device */
406*0Sstevel@tonic-gate 	uint_t		dma_attr_flags;		/* Bus specific DMA flags */
407*0Sstevel@tonic-gate } ddi_dma_attr_t;
408*0Sstevel@tonic-gate 
409*0Sstevel@tonic-gate /*
410*0Sstevel@tonic-gate  * Handy macro to set a maximum bit value (should be elsewhere)
411*0Sstevel@tonic-gate  *
412*0Sstevel@tonic-gate  * Clear off all bits lower then 'mybit' in val; if there are no
413*0Sstevel@tonic-gate  * bits higher than or equal to mybit in val then set mybit. Assumes
414*0Sstevel@tonic-gate  * mybit equals some power of 2 and is not zero.
415*0Sstevel@tonic-gate  */
416*0Sstevel@tonic-gate #define	maxbit(val, mybit)	\
417*0Sstevel@tonic-gate 	((val) & ~((mybit)-1)) | ((((val) & ~((mybit)-1)) == 0) ? (mybit) : 0)
418*0Sstevel@tonic-gate 
419*0Sstevel@tonic-gate /*
420*0Sstevel@tonic-gate  * Handy macro to set a minimum bit value (should be elsewhere)
421*0Sstevel@tonic-gate  *
422*0Sstevel@tonic-gate  * Clear off all bits higher then 'mybit' in val; if there are no
423*0Sstevel@tonic-gate  * bits lower than or equal to mybit in val then set mybit. Assumes
424*0Sstevel@tonic-gate  * mybit equals some pow2 and is not zero.
425*0Sstevel@tonic-gate  */
426*0Sstevel@tonic-gate #define	minbit(val, mybit)	\
427*0Sstevel@tonic-gate 	(((val)&((mybit)|((mybit)-1))) | \
428*0Sstevel@tonic-gate 	((((val) & ((mybit)-1)) == 0) ? (mybit) : 0))
429*0Sstevel@tonic-gate 
430*0Sstevel@tonic-gate /*
431*0Sstevel@tonic-gate  * Structure of a request to map an object for DMA.
432*0Sstevel@tonic-gate  */
433*0Sstevel@tonic-gate typedef struct ddi_dma_req {
434*0Sstevel@tonic-gate 	/*
435*0Sstevel@tonic-gate 	 * Caller's DMA engine constraints.
436*0Sstevel@tonic-gate 	 *
437*0Sstevel@tonic-gate 	 * If there are no particular constraints to the caller's DMA
438*0Sstevel@tonic-gate 	 * engine, this field may be set to NULL. The implementation DMA
439*0Sstevel@tonic-gate 	 * setup functions will then select a set of standard beginning
440*0Sstevel@tonic-gate 	 * constraints.
441*0Sstevel@tonic-gate 	 *
442*0Sstevel@tonic-gate 	 * In either case, as the mapping proceeds, the initial DMA
443*0Sstevel@tonic-gate 	 * constraints may become more restrictive as each intervening
444*0Sstevel@tonic-gate 	 * nexus might add further restrictions.
445*0Sstevel@tonic-gate 	 */
446*0Sstevel@tonic-gate 	ddi_dma_lim_t	*dmar_limits;
447*0Sstevel@tonic-gate 
448*0Sstevel@tonic-gate 	/*
449*0Sstevel@tonic-gate 	 * Contains the information passed to the DMA mapping allocation
450*0Sstevel@tonic-gate 	 * routine(s).
451*0Sstevel@tonic-gate 	 */
452*0Sstevel@tonic-gate 	uint_t		dmar_flags;
453*0Sstevel@tonic-gate 
454*0Sstevel@tonic-gate 	/*
455*0Sstevel@tonic-gate 	 * Callback function. A caller of the DMA mapping functions must
456*0Sstevel@tonic-gate 	 * specify by filling in this field whether the allocation routines
457*0Sstevel@tonic-gate 	 * can sleep awaiting mapping resources, must *not* sleep awaiting
458*0Sstevel@tonic-gate 	 * resources, or may *not* sleep awaiting any resources and must
459*0Sstevel@tonic-gate 	 * call the function specified by dmar_fp with the the argument
460*0Sstevel@tonic-gate 	 * dmar_arg when resources might have become available at a future
461*0Sstevel@tonic-gate 	 * time.
462*0Sstevel@tonic-gate 	 */
463*0Sstevel@tonic-gate 	int		(*dmar_fp)();
464*0Sstevel@tonic-gate 
465*0Sstevel@tonic-gate 	caddr_t		dmar_arg;	/* Callback function argument */
466*0Sstevel@tonic-gate 
467*0Sstevel@tonic-gate 	/*
468*0Sstevel@tonic-gate 	 * Description of the object to be mapped for DMA.
469*0Sstevel@tonic-gate 	 * Must be last in this structure in case that the
470*0Sstevel@tonic-gate 	 * union ddi_dma_obj_t changes in the future.
471*0Sstevel@tonic-gate 	 */
472*0Sstevel@tonic-gate 	ddi_dma_obj_t	dmar_object;
473*0Sstevel@tonic-gate 
474*0Sstevel@tonic-gate } ddi_dma_req_t;
475*0Sstevel@tonic-gate 
476*0Sstevel@tonic-gate /*
477*0Sstevel@tonic-gate  * Defines for the DMA mapping allocation functions
478*0Sstevel@tonic-gate  *
479*0Sstevel@tonic-gate  * If a DMA callback funtion is set to anything other than the following
480*0Sstevel@tonic-gate  * defines then it is assumed that one wishes a callback and is providing
481*0Sstevel@tonic-gate  * a function address.
482*0Sstevel@tonic-gate  */
483*0Sstevel@tonic-gate #ifdef __STDC__
484*0Sstevel@tonic-gate #define	DDI_DMA_DONTWAIT	((int (*)(caddr_t))0)
485*0Sstevel@tonic-gate #define	DDI_DMA_SLEEP		((int (*)(caddr_t))1)
486*0Sstevel@tonic-gate #else
487*0Sstevel@tonic-gate #define	DDI_DMA_DONTWAIT	((int (*)())0)
488*0Sstevel@tonic-gate #define	DDI_DMA_SLEEP		((int (*)())1)
489*0Sstevel@tonic-gate #endif
490*0Sstevel@tonic-gate 
491*0Sstevel@tonic-gate /*
492*0Sstevel@tonic-gate  * Return values from callback functions.
493*0Sstevel@tonic-gate  */
494*0Sstevel@tonic-gate #define	DDI_DMA_CALLBACK_RUNOUT	0
495*0Sstevel@tonic-gate #define	DDI_DMA_CALLBACK_DONE	1
496*0Sstevel@tonic-gate 
497*0Sstevel@tonic-gate /*
498*0Sstevel@tonic-gate  * Flag definitions for the allocation functions.
499*0Sstevel@tonic-gate  */
500*0Sstevel@tonic-gate #define	DDI_DMA_WRITE		0x0001	/* Direction memory --> IO 	*/
501*0Sstevel@tonic-gate #define	DDI_DMA_READ		0x0002	/* Direction IO --> memory	*/
502*0Sstevel@tonic-gate #define	DDI_DMA_RDWR		(DDI_DMA_READ | DDI_DMA_WRITE)
503*0Sstevel@tonic-gate 
504*0Sstevel@tonic-gate /*
505*0Sstevel@tonic-gate  * If possible, establish a MMU redzone after the mapping (to protect
506*0Sstevel@tonic-gate  * against cheap DMA hardware that might get out of control).
507*0Sstevel@tonic-gate  */
508*0Sstevel@tonic-gate #define	DDI_DMA_REDZONE		0x0004
509*0Sstevel@tonic-gate 
510*0Sstevel@tonic-gate /*
511*0Sstevel@tonic-gate  * A partial allocation is allowed. That is, if the size of the object
512*0Sstevel@tonic-gate  * exceeds the mapping resources available, only map a portion of the
513*0Sstevel@tonic-gate  * object and return status indicating that this took place. The caller
514*0Sstevel@tonic-gate  * can use the functions ddi_dma_numwin(9F) and ddi_dma_getwin(9F) to
515*0Sstevel@tonic-gate  * change, at a later point, the actual mapped portion of the object.
516*0Sstevel@tonic-gate  *
517*0Sstevel@tonic-gate  * The mapped portion begins at offset 0 of the object.
518*0Sstevel@tonic-gate  *
519*0Sstevel@tonic-gate  */
520*0Sstevel@tonic-gate #define	DDI_DMA_PARTIAL		0x0008
521*0Sstevel@tonic-gate 
522*0Sstevel@tonic-gate /*
523*0Sstevel@tonic-gate  * Map the object for byte consistent access. Note that explicit
524*0Sstevel@tonic-gate  * synchronization (via ddi_dma_sync(9F)) will still be required.
525*0Sstevel@tonic-gate  * Consider this flag to be a hint to the mapping routines as to
526*0Sstevel@tonic-gate  * the intended use of the mapping.
527*0Sstevel@tonic-gate  *
528*0Sstevel@tonic-gate  * Normal data transfers can be usually consider to use 'streaming'
529*0Sstevel@tonic-gate  * modes of operations. They start at a specific point, transfer a
530*0Sstevel@tonic-gate  * fairly large amount of data sequentially, and then stop (usually
531*0Sstevel@tonic-gate  * on a well aligned boundary).
532*0Sstevel@tonic-gate  *
533*0Sstevel@tonic-gate  * Control mode data transfers (for memory resident device control blocks,
534*0Sstevel@tonic-gate  * e.g., ethernet message descriptors) do not access memory in such
535*0Sstevel@tonic-gate  * a streaming sequential fashion. Instead, they tend to modify a few
536*0Sstevel@tonic-gate  * words or bytes, move around and maybe modify a few more.
537*0Sstevel@tonic-gate  *
538*0Sstevel@tonic-gate  * There are many machine implementations that make this difficult to
539*0Sstevel@tonic-gate  * control in a generic and seamless fashion. Therefore, explicit synch-
540*0Sstevel@tonic-gate  * ronization steps (via ddi_dma_sync(9F)) are still required (even if you
541*0Sstevel@tonic-gate  * ask for a byte-consistent mapping) in order to make the view of the
542*0Sstevel@tonic-gate  * memory object shared between a CPU and a DMA master in consistent.
543*0Sstevel@tonic-gate  * However, judicious use of this flag can give sufficient hints to
544*0Sstevel@tonic-gate  * the mapping routines to attempt to pick the most efficacious mapping
545*0Sstevel@tonic-gate  * such that the synchronization steps are as efficient as possible.
546*0Sstevel@tonic-gate  *
547*0Sstevel@tonic-gate  */
548*0Sstevel@tonic-gate #define	DDI_DMA_CONSISTENT	0x0010
549*0Sstevel@tonic-gate 
550*0Sstevel@tonic-gate /*
551*0Sstevel@tonic-gate  * Some DMA mappings have to be 'exclusive' access.
552*0Sstevel@tonic-gate  */
553*0Sstevel@tonic-gate #define	DDI_DMA_EXCLUSIVE	0x0020
554*0Sstevel@tonic-gate 
555*0Sstevel@tonic-gate /*
556*0Sstevel@tonic-gate  * Sequential, unidirectional, block-sized and block aligned transfers
557*0Sstevel@tonic-gate  */
558*0Sstevel@tonic-gate #define	DDI_DMA_STREAMING	0x0040
559*0Sstevel@tonic-gate 
560*0Sstevel@tonic-gate /*
561*0Sstevel@tonic-gate  * Support for 64-bit SBus devices
562*0Sstevel@tonic-gate  */
563*0Sstevel@tonic-gate #define	DDI_DMA_SBUS_64BIT	0x2000
564*0Sstevel@tonic-gate 
565*0Sstevel@tonic-gate /*
566*0Sstevel@tonic-gate  * Return values from the mapping allocation functions.
567*0Sstevel@tonic-gate  */
568*0Sstevel@tonic-gate 
569*0Sstevel@tonic-gate /*
570*0Sstevel@tonic-gate  * succeeded in satisfying request
571*0Sstevel@tonic-gate  */
572*0Sstevel@tonic-gate #define	DDI_DMA_MAPPED		0
573*0Sstevel@tonic-gate 
574*0Sstevel@tonic-gate /*
575*0Sstevel@tonic-gate  * Mapping is legitimate (for advisory calls).
576*0Sstevel@tonic-gate  */
577*0Sstevel@tonic-gate #define	DDI_DMA_MAPOK		0
578*0Sstevel@tonic-gate 
579*0Sstevel@tonic-gate /*
580*0Sstevel@tonic-gate  * Succeeded in mapping a portion of the request.
581*0Sstevel@tonic-gate  */
582*0Sstevel@tonic-gate #define	DDI_DMA_PARTIAL_MAP	1
583*0Sstevel@tonic-gate 
584*0Sstevel@tonic-gate /*
585*0Sstevel@tonic-gate  * indicates end of window/segment list
586*0Sstevel@tonic-gate  */
587*0Sstevel@tonic-gate #define	DDI_DMA_DONE		2
588*0Sstevel@tonic-gate 
589*0Sstevel@tonic-gate /*
590*0Sstevel@tonic-gate  * No resources to map request.
591*0Sstevel@tonic-gate  */
592*0Sstevel@tonic-gate #define	DDI_DMA_NORESOURCES	-1
593*0Sstevel@tonic-gate 
594*0Sstevel@tonic-gate /*
595*0Sstevel@tonic-gate  * Can't establish a mapping to the specified object
596*0Sstevel@tonic-gate  * (no specific reason).
597*0Sstevel@tonic-gate  */
598*0Sstevel@tonic-gate #define	DDI_DMA_NOMAPPING	-2
599*0Sstevel@tonic-gate 
600*0Sstevel@tonic-gate /*
601*0Sstevel@tonic-gate  * The request is too big to be mapped.
602*0Sstevel@tonic-gate  */
603*0Sstevel@tonic-gate #define	DDI_DMA_TOOBIG		-3
604*0Sstevel@tonic-gate 
605*0Sstevel@tonic-gate /*
606*0Sstevel@tonic-gate  * The request is too small to be mapped.
607*0Sstevel@tonic-gate  */
608*0Sstevel@tonic-gate #define	DDI_DMA_TOOSMALL	-4
609*0Sstevel@tonic-gate 
610*0Sstevel@tonic-gate /*
611*0Sstevel@tonic-gate  * The request cannot be mapped because the object
612*0Sstevel@tonic-gate  * is locked against mapping by another DMA master.
613*0Sstevel@tonic-gate  */
614*0Sstevel@tonic-gate #define	DDI_DMA_LOCKED		-5
615*0Sstevel@tonic-gate 
616*0Sstevel@tonic-gate /*
617*0Sstevel@tonic-gate  * The request cannot be mapped because the limits
618*0Sstevel@tonic-gate  * structure has bogus values.
619*0Sstevel@tonic-gate  */
620*0Sstevel@tonic-gate #define	DDI_DMA_BADLIMITS	-6
621*0Sstevel@tonic-gate 
622*0Sstevel@tonic-gate /*
623*0Sstevel@tonic-gate  * the segment/window pointer is stale
624*0Sstevel@tonic-gate  */
625*0Sstevel@tonic-gate #define	DDI_DMA_STALE		-7
626*0Sstevel@tonic-gate 
627*0Sstevel@tonic-gate /*
628*0Sstevel@tonic-gate  * The system can't allocate DMA resources using
629*0Sstevel@tonic-gate  * the given DMA attributes
630*0Sstevel@tonic-gate  */
631*0Sstevel@tonic-gate #define	DDI_DMA_BADATTR		-8
632*0Sstevel@tonic-gate 
633*0Sstevel@tonic-gate /*
634*0Sstevel@tonic-gate  * A DMA handle is already used for a DMA
635*0Sstevel@tonic-gate  */
636*0Sstevel@tonic-gate #define	DDI_DMA_INUSE		-9
637*0Sstevel@tonic-gate 
638*0Sstevel@tonic-gate /*
639*0Sstevel@tonic-gate  * In order for the access to a memory object to be consistent
640*0Sstevel@tonic-gate  * between a device and a CPU, the function ddi_dma_sync(9F)
641*0Sstevel@tonic-gate  * must be called upon the DMA handle. The following flags
642*0Sstevel@tonic-gate  * define whose view of the object should be made consistent.
643*0Sstevel@tonic-gate  * There are different flags here because on different machines
644*0Sstevel@tonic-gate  * there are definite performance implications of how long
645*0Sstevel@tonic-gate  * such synchronization takes.
646*0Sstevel@tonic-gate  *
647*0Sstevel@tonic-gate  * DDI_DMA_SYNC_FORDEV makes all device references to the object
648*0Sstevel@tonic-gate  * mapped by the DMA handle up to date. It should be used by a
649*0Sstevel@tonic-gate  * driver after a cpu modifies the memory object (over the range
650*0Sstevel@tonic-gate  * specified by the other arguments to the ddi_dma_sync(9F) call).
651*0Sstevel@tonic-gate  *
652*0Sstevel@tonic-gate  * DDI_DMA_SYNC_FORCPU makes all cpu references to the object
653*0Sstevel@tonic-gate  * mapped by the DMA handle up to date. It should be used
654*0Sstevel@tonic-gate  * by a driver after the receipt of data from the device to
655*0Sstevel@tonic-gate  * the memory object is done (over the range specified by
656*0Sstevel@tonic-gate  * the other arguments to the ddi_dma_sync(9F) call).
657*0Sstevel@tonic-gate  *
658*0Sstevel@tonic-gate  * If the only mapping that concerns the driver is one for the
659*0Sstevel@tonic-gate  * kernel (such as memory allocated by ddi_iopb_alloc(9F)), the
660*0Sstevel@tonic-gate  * flag DDI_DMA_SYNC_FORKERNEL can be used. This is a hint to the
661*0Sstevel@tonic-gate  * system that if it can synchronize the kernel's view faster
662*0Sstevel@tonic-gate  * that the CPU's view, it can do so, otherwise it acts the
663*0Sstevel@tonic-gate  * same as DDI_DMA_SYNC_FORCPU. DDI_DMA_SYNC_FORKERNEL might
664*0Sstevel@tonic-gate  * speed up the synchronization of kernel mappings in case of
665*0Sstevel@tonic-gate  * non IO-coherent CPU caches.
666*0Sstevel@tonic-gate  */
667*0Sstevel@tonic-gate #define	DDI_DMA_SYNC_FORDEV	0x0
668*0Sstevel@tonic-gate #define	DDI_DMA_SYNC_FORCPU	0x1
669*0Sstevel@tonic-gate #define	DDI_DMA_SYNC_FORKERNEL	0x2
670*0Sstevel@tonic-gate 
671*0Sstevel@tonic-gate /*
672*0Sstevel@tonic-gate  * Bus nexus control functions for DMA
673*0Sstevel@tonic-gate  */
674*0Sstevel@tonic-gate 
675*0Sstevel@tonic-gate /*
676*0Sstevel@tonic-gate  * Control operations, defined here so that devops.h can be included
677*0Sstevel@tonic-gate  * by drivers without having to include a specific SYSDDI implementation
678*0Sstevel@tonic-gate  * header file.
679*0Sstevel@tonic-gate  */
680*0Sstevel@tonic-gate 
681*0Sstevel@tonic-gate enum ddi_dma_ctlops {
682*0Sstevel@tonic-gate 	DDI_DMA_FREE,		/* free reference to object		*/
683*0Sstevel@tonic-gate 	DDI_DMA_SYNC,		/* synchronize cache references		*/
684*0Sstevel@tonic-gate 	DDI_DMA_HTOC,		/* return DMA cookie for handle		*/
685*0Sstevel@tonic-gate 	DDI_DMA_KVADDR,		/* return kernel virtual address	*/
686*0Sstevel@tonic-gate 	DDI_DMA_MOVWIN,		/* change mapped DMA window on object	*/
687*0Sstevel@tonic-gate 	DDI_DMA_REPWIN,		/* report current window on DMA object	*/
688*0Sstevel@tonic-gate 	DDI_DMA_GETERR,		/* report any post-transfer DMA errors	*/
689*0Sstevel@tonic-gate 	DDI_DMA_COFF,		/* convert a DMA cookie to an offset	*/
690*0Sstevel@tonic-gate 	DDI_DMA_NEXTWIN,	/* get next window within object	*/
691*0Sstevel@tonic-gate 	DDI_DMA_NEXTSEG,	/* get next segment within window	*/
692*0Sstevel@tonic-gate 	DDI_DMA_SEGTOC,		/* return segment DMA cookie		*/
693*0Sstevel@tonic-gate 	DDI_DMA_RESERVE,	/* reserve some DVMA range		*/
694*0Sstevel@tonic-gate 	DDI_DMA_RELEASE,	/* free preallocated DVMA range		*/
695*0Sstevel@tonic-gate 	DDI_DMA_RESETH,		/* reset next cookie ptr in handle	*/
696*0Sstevel@tonic-gate 	DDI_DMA_CKSYNC,		/* sync intermediate buffer to cookies	*/
697*0Sstevel@tonic-gate 	DDI_DMA_IOPB_ALLOC,	/* get contiguous DMA-able memory	*/
698*0Sstevel@tonic-gate 	DDI_DMA_IOPB_FREE,	/* return contiguous DMA-able memory	*/
699*0Sstevel@tonic-gate 	DDI_DMA_SMEM_ALLOC,	/* get contiguous DMA-able memory	*/
700*0Sstevel@tonic-gate 	DDI_DMA_SMEM_FREE,	/* return contiguous DMA-able memory	*/
701*0Sstevel@tonic-gate 	DDI_DMA_SET_SBUS64,	/* 64 bit SBus support			*/
702*0Sstevel@tonic-gate 	DDI_DMA_REMAP,		/* remap DMA buffers after relocation	*/
703*0Sstevel@tonic-gate 
704*0Sstevel@tonic-gate 		/*
705*0Sstevel@tonic-gate 		 * control ops for DMA engine on motherboard
706*0Sstevel@tonic-gate 		 */
707*0Sstevel@tonic-gate 	DDI_DMA_E_ACQUIRE,	/* get channel for exclusive use	*/
708*0Sstevel@tonic-gate 	DDI_DMA_E_FREE,		/* release channel			*/
709*0Sstevel@tonic-gate 	DDI_DMA_E_1STPTY,	/* setup channel for 1st party DMA	*/
710*0Sstevel@tonic-gate 	DDI_DMA_E_GETCB,	/* get control block for DMA engine	*/
711*0Sstevel@tonic-gate 	DDI_DMA_E_FREECB,	/* free control blk for DMA engine	*/
712*0Sstevel@tonic-gate 	DDI_DMA_E_PROG,		/* program channel of DMA engine	*/
713*0Sstevel@tonic-gate 	DDI_DMA_E_SWSETUP,	/* setup channel for software control	*/
714*0Sstevel@tonic-gate 	DDI_DMA_E_SWSTART,	/* software operation of DMA channel	*/
715*0Sstevel@tonic-gate 	DDI_DMA_E_ENABLE,	/* enable channel of DMA engine		*/
716*0Sstevel@tonic-gate 	DDI_DMA_E_STOP,		/* stop a channel of DMA engine		*/
717*0Sstevel@tonic-gate 	DDI_DMA_E_DISABLE,	/* disable channel of DMA engine	*/
718*0Sstevel@tonic-gate 	DDI_DMA_E_GETCNT,	/* get remaining xfer count		*/
719*0Sstevel@tonic-gate 	DDI_DMA_E_GETLIM,	/* get DMA engine limits		*/
720*0Sstevel@tonic-gate 	DDI_DMA_E_GETATTR	/* get DMA engine attributes		*/
721*0Sstevel@tonic-gate };
722*0Sstevel@tonic-gate 
723*0Sstevel@tonic-gate #ifdef	__cplusplus
724*0Sstevel@tonic-gate }
725*0Sstevel@tonic-gate #endif
726*0Sstevel@tonic-gate 
727*0Sstevel@tonic-gate #endif	/* _SYS_DDIDMAREQ_H */
728