xref: /titanic_41/usr/src/uts/sun/sys/scsi/adapters/fasdma.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*
23*7c478bd9Sstevel@tonic-gate  * Copyright (c) 1996, by Sun Microsystems, Inc.
24*7c478bd9Sstevel@tonic-gate  * All rights reserved.
25*7c478bd9Sstevel@tonic-gate  */
26*7c478bd9Sstevel@tonic-gate 
27*7c478bd9Sstevel@tonic-gate #ifndef	_SYS_SCSI_ADAPTERS_FASDMA_H
28*7c478bd9Sstevel@tonic-gate #define	_SYS_SCSI_ADAPTERS_FASDMA_H
29*7c478bd9Sstevel@tonic-gate 
30*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*7c478bd9Sstevel@tonic-gate 
32*7c478bd9Sstevel@tonic-gate /*
33*7c478bd9Sstevel@tonic-gate  * SCSI	Channel	Engine (fas SCSI DVMA) definitions
34*7c478bd9Sstevel@tonic-gate  */
35*7c478bd9Sstevel@tonic-gate #include <sys/note.h>
36*7c478bd9Sstevel@tonic-gate 
37*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
38*7c478bd9Sstevel@tonic-gate extern "C" {
39*7c478bd9Sstevel@tonic-gate #endif
40*7c478bd9Sstevel@tonic-gate 
41*7c478bd9Sstevel@tonic-gate /*
42*7c478bd9Sstevel@tonic-gate  * for historical reasons, we call the scsi channel engine
43*7c478bd9Sstevel@tonic-gate  * dma for now
44*7c478bd9Sstevel@tonic-gate  */
45*7c478bd9Sstevel@tonic-gate struct dma {
46*7c478bd9Sstevel@tonic-gate 	uint32_t dma_csr;		/* control/status register */
47*7c478bd9Sstevel@tonic-gate 	uint32_t dma_addr;		/* dma address register	*/
48*7c478bd9Sstevel@tonic-gate 	uint32_t dma_count;		/* count register */
49*7c478bd9Sstevel@tonic-gate 	uint32_t dma_test;		/* test csr register */
50*7c478bd9Sstevel@tonic-gate };
51*7c478bd9Sstevel@tonic-gate 
52*7c478bd9Sstevel@tonic-gate 
53*7c478bd9Sstevel@tonic-gate /*
54*7c478bd9Sstevel@tonic-gate  * dma_csr bits
55*7c478bd9Sstevel@tonic-gate  */
56*7c478bd9Sstevel@tonic-gate #define	DMA_INTPEND	0x0001	/* (R) interrupt pending from fas or dma */
57*7c478bd9Sstevel@tonic-gate #define	DMA_ERRPEND	0x0002	/* (R) error pending from dma */
58*7c478bd9Sstevel@tonic-gate #define	DMA_DRAINING	0x0004	/* (R) if set, buffers aredraining to mem */
59*7c478bd9Sstevel@tonic-gate #define	DMA_INTEN	0x0010	/* (RW)	enable interrupts */
60*7c478bd9Sstevel@tonic-gate #define	DMA_RESET	0x0080	/* (RW)	invalidates the	buffers, resets	CE */
61*7c478bd9Sstevel@tonic-gate #define	DMA_WRITE	0x0100	/* (RW)	write to memory	*/
62*7c478bd9Sstevel@tonic-gate #define	DMA_ENDVMA	0x0200	/* (RW)	enable dvma */
63*7c478bd9Sstevel@tonic-gate #define	DMA_REQPEND	0x0400	/* (R) do not assert reset when	set! */
64*7c478bd9Sstevel@tonic-gate #define	DMA_DMAREV	0x7800	/* (R) dma revision */
65*7c478bd9Sstevel@tonic-gate #define	DMA_WIDE_EN	0x8000	/* (RW)	enable wide SBus DVMA mode */
66*7c478bd9Sstevel@tonic-gate #define	DMA_DSBL_DRAIN  0x00020000	/* (RW)	disable	draining on slave */
67*7c478bd9Sstevel@tonic-gate 					/*	accesses */
68*7c478bd9Sstevel@tonic-gate #define	DMA_BURSTS  	0x000c0000	/* (RW)	burst sizes */
69*7c478bd9Sstevel@tonic-gate #define	DMA_TWO_CYCLE	0x00200000	/* (RW)	2 cycle	dma access to 366 */
70*7c478bd9Sstevel@tonic-gate #define	DMA_DSBL_PARITY	0x02000000	/* (RW)	disables checking for parity */
71*7c478bd9Sstevel@tonic-gate #define	DMA_PAUSE_FAS	0x04000000	/* (RW)	pause  fas */
72*7c478bd9Sstevel@tonic-gate #define	DMA_RESET_FAS	0x08000000	/* (RW)	hardware reset to fas */
73*7c478bd9Sstevel@tonic-gate #define	DMA_DEV_ID	0xf0000000	/* (R)	Device ID (0xb)	*/
74*7c478bd9Sstevel@tonic-gate 
75*7c478bd9Sstevel@tonic-gate #define	DMA_INT_MASK  (DMA_INTPEND | DMA_ERRPEND)
76*7c478bd9Sstevel@tonic-gate 
77*7c478bd9Sstevel@tonic-gate #define	DMA_BITS	\
78*7c478bd9Sstevel@tonic-gate "\20\34RST\33PSE\31DSBLPAR\26TWOCYC\24BRST1\23BST0\
79*7c478bd9Sstevel@tonic-gate \22DSBLEDRN\20WIDE\13REQPEND\12ENBLE\11WR\10RST\05INTEN\
80*7c478bd9Sstevel@tonic-gate \03DRNING\02ERRPEND\01INTPND"
81*7c478bd9Sstevel@tonic-gate 
82*7c478bd9Sstevel@tonic-gate #define	DMAREV(dmap)	(((dmap->dma_csr) & DMA_DMAREV) >> 11)
83*7c478bd9Sstevel@tonic-gate 
84*7c478bd9Sstevel@tonic-gate /*
85*7c478bd9Sstevel@tonic-gate  * burst sizes for dma
86*7c478bd9Sstevel@tonic-gate  */
87*7c478bd9Sstevel@tonic-gate #define	DMA_BURST16	0x00000000
88*7c478bd9Sstevel@tonic-gate #define	DMA_BURST32	0x00040000
89*7c478bd9Sstevel@tonic-gate #define	DMA_BURST64	0x000c0000
90*7c478bd9Sstevel@tonic-gate #define	DMA_CE_ID	0xb0000000	/* SCSI	CE device ID */
91*7c478bd9Sstevel@tonic-gate 
92*7c478bd9Sstevel@tonic-gate /*
93*7c478bd9Sstevel@tonic-gate  * burst sizes for dma attr
94*7c478bd9Sstevel@tonic-gate  */
95*7c478bd9Sstevel@tonic-gate #define	BURST1		0x01
96*7c478bd9Sstevel@tonic-gate #define	BURST2		0x02
97*7c478bd9Sstevel@tonic-gate #define	BURST4		0x04
98*7c478bd9Sstevel@tonic-gate #define	BURST8		0x08
99*7c478bd9Sstevel@tonic-gate #define	BURST16		0x10
100*7c478bd9Sstevel@tonic-gate #define	BURST32		0x20
101*7c478bd9Sstevel@tonic-gate #define	BURST64		0x40
102*7c478bd9Sstevel@tonic-gate #define	BURSTSIZE_MASK	0x7f
103*7c478bd9Sstevel@tonic-gate #define	DEFAULT_BURSTSIZE \
104*7c478bd9Sstevel@tonic-gate 		BURST64|BURST32|BURST16|BURST8|BURST4|BURST2|BURST1
105*7c478bd9Sstevel@tonic-gate 
106*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
107*7c478bd9Sstevel@tonic-gate }
108*7c478bd9Sstevel@tonic-gate #endif
109*7c478bd9Sstevel@tonic-gate 
110*7c478bd9Sstevel@tonic-gate #endif	/* _SYS_SCSI_ADAPTERS_FASDMA_H */
111