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) 1999-2000 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_1394_ADAPTERS_HCI1394_RIO_REGS_H
28*7c478bd9Sstevel@tonic-gate #define	_SYS_1394_ADAPTERS_HCI1394_RIO_REGS_H
29*7c478bd9Sstevel@tonic-gate 
30*7c478bd9Sstevel@tonic-gate /*
31*7c478bd9Sstevel@tonic-gate  * hci1394_rio_regs.h
32*7c478bd9Sstevel@tonic-gate  *    Sun Microsystems RIO chipset
33*7c478bd9Sstevel@tonic-gate  *    See the RIO specification (r1.0), section 5.9, for a description
34*7c478bd9Sstevel@tonic-gate  *    of the vendor specific registers.
35*7c478bd9Sstevel@tonic-gate  */
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 /*
43*7c478bd9Sstevel@tonic-gate  * RIO's vendor specific register mapping information.  What register set it
44*7c478bd9Sstevel@tonic-gate  * uses and the offset/size of the register set.
45*7c478bd9Sstevel@tonic-gate  */
46*7c478bd9Sstevel@tonic-gate #define	RIOREG_REG_BASE		0x2
47*7c478bd9Sstevel@tonic-gate #define	RIOREG_OFFSET		0x0
48*7c478bd9Sstevel@tonic-gate #define	RIOREG_LENGTH		0x800
49*7c478bd9Sstevel@tonic-gate 
50*7c478bd9Sstevel@tonic-gate /*
51*7c478bd9Sstevel@tonic-gate  * For RIO pass 1, we will setup the GUID in as part of the vendor specific
52*7c478bd9Sstevel@tonic-gate  * init. This is to support the RIO PPX card (since it does not have firmware
53*7c478bd9Sstevel@tonic-gate  * to setup the GUID.
54*7c478bd9Sstevel@tonic-gate  */
55*7c478bd9Sstevel@tonic-gate #define	RIOREG_GUID_MASK		0x000000FFFFFFFFFF
56*7c478bd9Sstevel@tonic-gate #define	RIOREG_GUID_SUN_MICROSYSTEMS	0x0800200000000000
57*7c478bd9Sstevel@tonic-gate #define	RIOREG_SUNW_RIO_PASS1		0x01080020
58*7c478bd9Sstevel@tonic-gate 
59*7c478bd9Sstevel@tonic-gate /*
60*7c478bd9Sstevel@tonic-gate  * RIO vendor specific registers.  These are the offsets of the registers. They
61*7c478bd9Sstevel@tonic-gate  * should be used as paramteres to hci1394_vendor_reg_write() and
62*7c478bd9Sstevel@tonic-gate  * hci1394_vendor_reg_read().
63*7c478bd9Sstevel@tonic-gate  */
64*7c478bd9Sstevel@tonic-gate #define	RIOREG_INTR_EVENT	0x00
65*7c478bd9Sstevel@tonic-gate #define	RIOREG_INTR_MASK	0x04
66*7c478bd9Sstevel@tonic-gate #define	RIOREG_DMA_BURST_SIZE	0x08
67*7c478bd9Sstevel@tonic-gate #define	RIOREG_XMIT_CONTROL	0x0C
68*7c478bd9Sstevel@tonic-gate #define	RIOREG_HOST_CONTROL	0x10
69*7c478bd9Sstevel@tonic-gate #define	RIOREG_STATS_RETRIES	0x14
70*7c478bd9Sstevel@tonic-gate #define	RIOREG_STATS_ERRORS	0x18
71*7c478bd9Sstevel@tonic-gate #define	RIOREG_STATS_PHYSICAL	0x1C
72*7c478bd9Sstevel@tonic-gate 
73*7c478bd9Sstevel@tonic-gate /* RIO interrupt event & mask bit offsets */
74*7c478bd9Sstevel@tonic-gate #define	RIOREG_INTR_STATS1	0x001
75*7c478bd9Sstevel@tonic-gate #define	RIOREG_INTR_STATS2	0x002
76*7c478bd9Sstevel@tonic-gate #define	RIOREG_INTR_STATS3	0x004
77*7c478bd9Sstevel@tonic-gate #define	RIOREG_INTR_STATS4	0x008
78*7c478bd9Sstevel@tonic-gate #define	RIOREG_INTR_STATS5	0x010
79*7c478bd9Sstevel@tonic-gate #define	RIOREG_INTR_STATS6	0x020
80*7c478bd9Sstevel@tonic-gate #define	RIOREG_INTR_STATS7	0x040
81*7c478bd9Sstevel@tonic-gate #define	RIOREG_INTR_STATS8	0x080
82*7c478bd9Sstevel@tonic-gate #define	RIOREG_INTR_LINKON	0x100
83*7c478bd9Sstevel@tonic-gate 
84*7c478bd9Sstevel@tonic-gate /* dma_burst_size (field defs) */
85*7c478bd9Sstevel@tonic-gate #define	RIOREG_INF_BURST_SHIFT	0
86*7c478bd9Sstevel@tonic-gate #define	RIOREG_DBURST_SHIFT	1
87*7c478bd9Sstevel@tonic-gate #define	RIOREG_RXBURST_SHIFT	26
88*7c478bd9Sstevel@tonic-gate #define	RIOREG_TXBURST_SHIFT	28
89*7c478bd9Sstevel@tonic-gate #define	RIOREG_PFBURST_SHIFT	30
90*7c478bd9Sstevel@tonic-gate #define	RIOREG_INF_BURST_MASK	(1 << RIOREG_INF_BURST_SHIFT)
91*7c478bd9Sstevel@tonic-gate #define	RIOREG_DBURST_MASK	(1 << RIOREG_DBURST_SHIFT)
92*7c478bd9Sstevel@tonic-gate #define	RIOREG_RXBURST_MASK	(3 << RIOREG_RXBURST_SHIFT)
93*7c478bd9Sstevel@tonic-gate #define	RIOREG_TXBURST_MASK	(3 << RIOREG_TXBURST_SHIFT)
94*7c478bd9Sstevel@tonic-gate #define	RIOREG_PFBURST_MASK	(3 << RIOREG_PFBURST_SHIFT)
95*7c478bd9Sstevel@tonic-gate 
96*7c478bd9Sstevel@tonic-gate /* dma_burst_size (values) */
97*7c478bd9Sstevel@tonic-gate #define	RIOREG_BURST_32		0 /* 32 bytes or less */
98*7c478bd9Sstevel@tonic-gate #define	RIOREG_BURST_64		1 /* 64 bytes or less */
99*7c478bd9Sstevel@tonic-gate #define	RIOREG_BURST_128	2 /* 128 bytes or less */
100*7c478bd9Sstevel@tonic-gate #define	RIOREG_BURST_256	3 /* 256 bytes or less */
101*7c478bd9Sstevel@tonic-gate 
102*7c478bd9Sstevel@tonic-gate /* xmit ctrl (field defs) */
103*7c478bd9Sstevel@tonic-gate #define	RIOREG_XMIT_BND1_SHIFT	0
104*7c478bd9Sstevel@tonic-gate #define	RIOREG_XMIT_BND2_SHIFT	8
105*7c478bd9Sstevel@tonic-gate #define	RIOREG_XMIT_BND1_MASK	(0xFF << RIOREG_XMIT_BND1_SHIFT)
106*7c478bd9Sstevel@tonic-gate #define	RIOREG_XMIT_BND2_MASK	(0xFF << RIOREG_XMIT_BND2_SHIFT)
107*7c478bd9Sstevel@tonic-gate 
108*7c478bd9Sstevel@tonic-gate /* host control (field defs) */
109*7c478bd9Sstevel@tonic-gate #define	RIOREG_HOST_ATREQ	0x00000001
110*7c478bd9Sstevel@tonic-gate #define	RIOREG_HOST_ATRESP	0x00000002
111*7c478bd9Sstevel@tonic-gate #define	RIOREG_HOST_IT1		0x00000004
112*7c478bd9Sstevel@tonic-gate #define	RIOREG_HOST_IT2		0x00000008
113*7c478bd9Sstevel@tonic-gate #define	RIOREG_HOST_IT3		0x00000010
114*7c478bd9Sstevel@tonic-gate #define	RIOREG_HOST_IT4		0x00000020
115*7c478bd9Sstevel@tonic-gate #define	RIOREG_HOST_ARREQ	0x00000040
116*7c478bd9Sstevel@tonic-gate #define	RIOREG_HOST_ARRESP	0x00000080
117*7c478bd9Sstevel@tonic-gate #define	RIOREG_HOST_IR1		0x00000100
118*7c478bd9Sstevel@tonic-gate #define	RIOREG_HOST_IR2		0x00000200
119*7c478bd9Sstevel@tonic-gate #define	RIOREG_HOST_IR3		0x00000400
120*7c478bd9Sstevel@tonic-gate #define	RIOREG_HOST_IR4		0x00000800
121*7c478bd9Sstevel@tonic-gate #define	RIOREG_HOST_BWCAT	0x02000000
122*7c478bd9Sstevel@tonic-gate #define	RIOREG_HOST_BRCAT	0x04000000
123*7c478bd9Sstevel@tonic-gate #define	RIOREG_HOST_ISOCTL	0xC0000000
124*7c478bd9Sstevel@tonic-gate 
125*7c478bd9Sstevel@tonic-gate /* Allow Descriptor pre-fetching */
126*7c478bd9Sstevel@tonic-gate #define	RIOREG_HOST_CONTROL_SETTING	\
127*7c478bd9Sstevel@tonic-gate 	(RIOREG_HOST_ATREQ | RIOREG_HOST_ATRESP | RIOREG_HOST_IT1 | \
128*7c478bd9Sstevel@tonic-gate 	RIOREG_HOST_IT2 | RIOREG_HOST_IT3 | RIOREG_HOST_IT4 | \
129*7c478bd9Sstevel@tonic-gate 	RIOREG_HOST_ARREQ | RIOREG_HOST_ARRESP | RIOREG_HOST_IR1 | \
130*7c478bd9Sstevel@tonic-gate 	RIOREG_HOST_IR2 | RIOREG_HOST_IR3 | RIOREG_HOST_IR4)
131*7c478bd9Sstevel@tonic-gate 
132*7c478bd9Sstevel@tonic-gate /* stats_retries (field defs) */
133*7c478bd9Sstevel@tonic-gate #define	RIOREG_RET_PHYS		0xFF000000
134*7c478bd9Sstevel@tonic-gate #define	RIOREG_RET_ATS		0x0000FF00
135*7c478bd9Sstevel@tonic-gate #define	RIOREG_RET_ATQ		0x000000FF
136*7c478bd9Sstevel@tonic-gate 
137*7c478bd9Sstevel@tonic-gate /* stats_errors (field defs) */
138*7c478bd9Sstevel@tonic-gate #define	RIOREG_ERR_EACKR	0x000000FF
139*7c478bd9Sstevel@tonic-gate #define	RIOREG_ERR_EACKX	0x0000FF00
140*7c478bd9Sstevel@tonic-gate #define	RIOREG_ERR_BUS		0x0FFF0000
141*7c478bd9Sstevel@tonic-gate 
142*7c478bd9Sstevel@tonic-gate /* stats_phys (field defs) */
143*7c478bd9Sstevel@tonic-gate #define	RIOREG_PHYS_WRQ		0x000000FF
144*7c478bd9Sstevel@tonic-gate #define	RIOREG_PHYS_RDQ		0x00FF0000
145*7c478bd9Sstevel@tonic-gate 
146*7c478bd9Sstevel@tonic-gate 
147*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
148*7c478bd9Sstevel@tonic-gate }
149*7c478bd9Sstevel@tonic-gate #endif
150*7c478bd9Sstevel@tonic-gate 
151*7c478bd9Sstevel@tonic-gate #endif /* _SYS_1394_ADAPTERS_HCI1394_RIO_REGS_H */
152