xref: /titanic_51/usr/src/uts/common/sys/1394/ieee1394.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) 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_IEEE1394_H
28*7c478bd9Sstevel@tonic-gate #define	_SYS_1394_IEEE1394_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  * ieee1394.h
34*7c478bd9Sstevel@tonic-gate  *    This file contains various defines that go with IEEE 1394
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  * IEEE1394_MAX_NODES defines the maximum number of nodes
44*7c478bd9Sstevel@tonic-gate  * that can be addressed on a single 1394 bus.  There are
45*7c478bd9Sstevel@tonic-gate  * a 63 physical nodes that can be present and 1 broadcast
46*7c478bd9Sstevel@tonic-gate  * node id.  The range of 1394 nodeid's are
47*7c478bd9Sstevel@tonic-gate  * 0 ... (IEEE1394_MAX_NODES - 1)
48*7c478bd9Sstevel@tonic-gate  */
49*7c478bd9Sstevel@tonic-gate #define	IEEE1394_MAX_NODES		64
50*7c478bd9Sstevel@tonic-gate 
51*7c478bd9Sstevel@tonic-gate /* The node id for broadcast writes */
52*7c478bd9Sstevel@tonic-gate #define	IEEE1394_BROADCAST_NODEID	63
53*7c478bd9Sstevel@tonic-gate 
54*7c478bd9Sstevel@tonic-gate /* Maximum number of ports per node */
55*7c478bd9Sstevel@tonic-gate #define	IEEE1394_MAX_NUM_PORTS		16
56*7c478bd9Sstevel@tonic-gate 
57*7c478bd9Sstevel@tonic-gate #define	IEEE1394_BUS_NUM_MASK		0x0000FFC0
58*7c478bd9Sstevel@tonic-gate #define	IEEE1394_LOCAL_BUS		0x3FF
59*7c478bd9Sstevel@tonic-gate 
60*7c478bd9Sstevel@tonic-gate #define	IEEE1394_NODE_NUM_MASK		0x0000003F
61*7c478bd9Sstevel@tonic-gate #define	IEEE1394_NODE_NUM(DATA)		((DATA) & IEEE1394_NODE_NUM_MASK)
62*7c478bd9Sstevel@tonic-gate 
63*7c478bd9Sstevel@tonic-gate #define	IEEE1394_BUS_CYCLES_PER_SEC	8000
64*7c478bd9Sstevel@tonic-gate 
65*7c478bd9Sstevel@tonic-gate /* IEEE 1394 Bus related definitions */
66*7c478bd9Sstevel@tonic-gate #define	IEEE1394_ADDR_NODE_ID_MASK	0xFFFF000000000000
67*7c478bd9Sstevel@tonic-gate #define	IEEE1394_ADDR_NODE_ID_SHIFT	48
68*7c478bd9Sstevel@tonic-gate #define	IEEE1394_ADDR_NODE_ID(ADDR)				\
69*7c478bd9Sstevel@tonic-gate 	(((ADDR) & IEEE1394_ADDR_NODE_ID_MASK) >>		\
70*7c478bd9Sstevel@tonic-gate 	    IEEE1394_ADDR_NODE_ID_SHIFT)
71*7c478bd9Sstevel@tonic-gate 
72*7c478bd9Sstevel@tonic-gate #define	IEEE1394_ADDR_BUS_ID_MASK	0xFFC0000000000000
73*7c478bd9Sstevel@tonic-gate #define	IEEE1394_ADDR_BUS_ID_SHIFT	54
74*7c478bd9Sstevel@tonic-gate #define	IEEE1394_ADDR_BUS_ID(ADDR)				\
75*7c478bd9Sstevel@tonic-gate 	(((ADDR) & IEEE1394_ADDR_BUS_ID_MASK) >>		\
76*7c478bd9Sstevel@tonic-gate 	    IEEE1394_ADDR_BUS_ID_SHIFT)
77*7c478bd9Sstevel@tonic-gate 
78*7c478bd9Sstevel@tonic-gate #define	IEEE1394_ADDR_PHY_ID_MASK	0x003F000000000000
79*7c478bd9Sstevel@tonic-gate #define	IEEE1394_ADDR_PHY_ID_SHIFT	48
80*7c478bd9Sstevel@tonic-gate #define	IEEE1394_ADDR_PHY_ID(ADDR)				\
81*7c478bd9Sstevel@tonic-gate 	(((ADDR) & IEEE1394_ADDR_PHY_ID_MASK) >>		\
82*7c478bd9Sstevel@tonic-gate 	    IEEE1394_ADDR_PHY_ID_SHIFT)
83*7c478bd9Sstevel@tonic-gate 
84*7c478bd9Sstevel@tonic-gate #define	IEEE1394_ADDR_OFFSET_MASK	0x0000FFFFFFFFFFFF
85*7c478bd9Sstevel@tonic-gate 
86*7c478bd9Sstevel@tonic-gate /* IEEE 1394 data sizes */
87*7c478bd9Sstevel@tonic-gate #define	IEEE1394_QUADLET		(sizeof (uint32_t))
88*7c478bd9Sstevel@tonic-gate #define	IEEE1394_OCTLET			(sizeof (uint64_t))
89*7c478bd9Sstevel@tonic-gate 
90*7c478bd9Sstevel@tonic-gate /* Still need to look at these */
91*7c478bd9Sstevel@tonic-gate /* TCODES - packet transaction codes (as defined in 1394-1995 6.2.4.5) */
92*7c478bd9Sstevel@tonic-gate #define	IEEE1394_TCODE_WRITE_QUADLET		0x0
93*7c478bd9Sstevel@tonic-gate #define	IEEE1394_TCODE_WRITE_BLOCK		0x1
94*7c478bd9Sstevel@tonic-gate #define	IEEE1394_TCODE_WRITE_RESP		0x2
95*7c478bd9Sstevel@tonic-gate #define	IEEE1394_TCODE_RES1			0x3
96*7c478bd9Sstevel@tonic-gate #define	IEEE1394_TCODE_READ_QUADLET		0x4
97*7c478bd9Sstevel@tonic-gate #define	IEEE1394_TCODE_READ_BLOCK		0x5
98*7c478bd9Sstevel@tonic-gate #define	IEEE1394_TCODE_READ_QUADLET_RESP	0x6
99*7c478bd9Sstevel@tonic-gate #define	IEEE1394_TCODE_READ_BLOCK_RESP		0x7
100*7c478bd9Sstevel@tonic-gate #define	IEEE1394_TCODE_CYCLE_START		0x8
101*7c478bd9Sstevel@tonic-gate #define	IEEE1394_TCODE_LOCK			0x9
102*7c478bd9Sstevel@tonic-gate #define	IEEE1394_TCODE_ISOCH			0xA
103*7c478bd9Sstevel@tonic-gate #define	IEEE1394_TCODE_LOCK_RESP		0xB
104*7c478bd9Sstevel@tonic-gate #define	IEEE1394_TCODE_RES2			0xC
105*7c478bd9Sstevel@tonic-gate #define	IEEE1394_TCODE_RES3			0xD
106*7c478bd9Sstevel@tonic-gate #define	IEEE1394_TCODE_PHY			0xE
107*7c478bd9Sstevel@tonic-gate #define	IEEE1394_TCODE_RES4			0xF
108*7c478bd9Sstevel@tonic-gate 
109*7c478bd9Sstevel@tonic-gate #define	IEEE1394_RESP_COMPLETE			0x0
110*7c478bd9Sstevel@tonic-gate #define	IEEE1394_RESP_CONFLICT_ERROR		0x4
111*7c478bd9Sstevel@tonic-gate #define	IEEE1394_RESP_DATA_ERROR		0x5
112*7c478bd9Sstevel@tonic-gate #define	IEEE1394_RESP_TYPE_ERROR		0x6
113*7c478bd9Sstevel@tonic-gate #define	IEEE1394_RESP_ADDRESS_ERROR		0x7
114*7c478bd9Sstevel@tonic-gate 
115*7c478bd9Sstevel@tonic-gate #define	IEEE1394_ISOCH_HDR_QUAD_SZ	3
116*7c478bd9Sstevel@tonic-gate 
117*7c478bd9Sstevel@tonic-gate /* Self ID packet definitions */
118*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_PCKT_ID_MASK	0xC0000000
119*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_PCKT_ID_SHIFT	30
120*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_PCKT_ID_VALID	0x2
121*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_ISVALID(S_PKT)				\
122*7c478bd9Sstevel@tonic-gate 	(~((S_PKT)->spkt_data ^ (S_PKT)->spkt_inverse) ? 0 : 1)
123*7c478bd9Sstevel@tonic-gate 
124*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_PHYID_MASK	0x3F000000
125*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_PHYID_SHIFT	24
126*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_PHYID(S_PKT)				\
127*7c478bd9Sstevel@tonic-gate 	(((S_PKT)->spkt_data & IEEE1394_SELFID_PHYID_MASK) >>	\
128*7c478bd9Sstevel@tonic-gate 	    IEEE1394_SELFID_PHYID_SHIFT)
129*7c478bd9Sstevel@tonic-gate 
130*7c478bd9Sstevel@tonic-gate /* SelfID PKT #0 */
131*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_L_MASK		0x00400000
132*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_L_SHIFT		22
133*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_ISLINKON(S_PKT)				\
134*7c478bd9Sstevel@tonic-gate 	(((S_PKT)->spkt_data & IEEE1394_SELFID_L_MASK) >>	\
135*7c478bd9Sstevel@tonic-gate 	    IEEE1394_SELFID_L_SHIFT)
136*7c478bd9Sstevel@tonic-gate 
137*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_GAP_CNT_MASK	0x003F0000
138*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_GAP_CNT_SHIFT	16
139*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_GAP_CNT(S_PKT)				\
140*7c478bd9Sstevel@tonic-gate 	(((S_PKT)->spkt_data & IEEE1394_SELFID_GAP_CNT_MASK) >>	\
141*7c478bd9Sstevel@tonic-gate 	    IEEE1394_SELFID_GAP_CNT_SHIFT)
142*7c478bd9Sstevel@tonic-gate 
143*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_SP_MASK		0x0000C000
144*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_SP_SHIFT	14
145*7c478bd9Sstevel@tonic-gate 
146*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_DEL_MASK	(0x00003000)
147*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_DEL_SHIFT	12
148*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_DELAY(S_PKT)				\
149*7c478bd9Sstevel@tonic-gate 	(((S_PKT)->spkt_data & IEEE1394_SELFID_DEL_MASK) >>	\
150*7c478bd9Sstevel@tonic-gate 	    IEEE1394_SELFID_DEL_SHIFT)
151*7c478bd9Sstevel@tonic-gate 
152*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_C_MASK		0x00000800
153*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_C_SHIFT		11
154*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_ISCONTENDER(S_PKT)			\
155*7c478bd9Sstevel@tonic-gate 	(((S_PKT)->spkt_data & IEEE1394_SELFID_C_MASK) >>	\
156*7c478bd9Sstevel@tonic-gate 	    IEEE1394_SELFID_C_SHIFT)
157*7c478bd9Sstevel@tonic-gate 
158*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_PWR_MASK	0x00000700
159*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_PWR_SHIFT	8
160*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_POWER(S_PKT)				\
161*7c478bd9Sstevel@tonic-gate 	(((S_PKT)->spkt_data & IEEE1394_SELFID_PWR_MASK) >>	\
162*7c478bd9Sstevel@tonic-gate 	    IEEE1394_SELFID_PWR_SHIFT)
163*7c478bd9Sstevel@tonic-gate 
164*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_PORT_TO_CHILD		0x3
165*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_PORT_TO_PARENT		0x2
166*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_PORT_NOT_CONNECTED	0x1
167*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_PORT_NO_PORT		0x0
168*7c478bd9Sstevel@tonic-gate 
169*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_I_MASK		0x00000002
170*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_I_SHIFT		1
171*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_INITIATED_RESET(S_PKT)			\
172*7c478bd9Sstevel@tonic-gate 	(((S_PKT)->spkt_data & IEEE1394_SELFID_I_MASK) >>	\
173*7c478bd9Sstevel@tonic-gate 	    IEEE1394_SELFID_I_SHIFT)
174*7c478bd9Sstevel@tonic-gate 
175*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_M_MASK		0x00000001
176*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_M_SHIFT		0
177*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_ISMORE(S_PKT)				\
178*7c478bd9Sstevel@tonic-gate 	(((S_PKT)->spkt_data & IEEE1394_SELFID_M_MASK) >>	\
179*7c478bd9Sstevel@tonic-gate 	    IEEE1394_SELFID_M_SHIFT)
180*7c478bd9Sstevel@tonic-gate 
181*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_PORT_OFFSET_FIRST	6
182*7c478bd9Sstevel@tonic-gate 
183*7c478bd9Sstevel@tonic-gate /* SelfID PKT #1 (n=0) */
184*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_N_MASK		0x00700000
185*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_N_SHIFT		20
186*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_PKT_NUM(S_PKT)				\
187*7c478bd9Sstevel@tonic-gate 	(((S_PKT)->spkt_data & IEEE1394_SELFID_N_MASK) >>	\
188*7c478bd9Sstevel@tonic-gate 	    IEEE1394_SELFID_N_SHIFT)
189*7c478bd9Sstevel@tonic-gate 
190*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SELFID_PORT_OFFSET_OTHERS	16
191*7c478bd9Sstevel@tonic-gate 
192*7c478bd9Sstevel@tonic-gate /* PHY Config Packet definitions */
193*7c478bd9Sstevel@tonic-gate #define	IEEE1394_PHY_CONFIG_T_BIT_MASK		0x00400000
194*7c478bd9Sstevel@tonic-gate #define	IEEE1394_PHY_CONFIG_T_BIT_SHIFT		22
195*7c478bd9Sstevel@tonic-gate #define	IEEE1394_PHY_CONFIG_GAP_CNT_MASK	0x003F0000
196*7c478bd9Sstevel@tonic-gate #define	IEEE1394_PHY_CONFIG_GAP_CNT_SHIFT	16
197*7c478bd9Sstevel@tonic-gate 
198*7c478bd9Sstevel@tonic-gate #define	IEEE1394_PHY_CONFIG_R_BIT_MASK		0x00800000
199*7c478bd9Sstevel@tonic-gate #define	IEEE1394_PHY_CONFIG_R_BIT_SHIFT		23
200*7c478bd9Sstevel@tonic-gate #define	IEEE1394_PHY_CONFIG_ROOT_HOLD_MASK	0x3F000000
201*7c478bd9Sstevel@tonic-gate #define	IEEE1394_PHY_CONFIG_ROOT_HOLD_SHIFT	24
202*7c478bd9Sstevel@tonic-gate 
203*7c478bd9Sstevel@tonic-gate 
204*7c478bd9Sstevel@tonic-gate /*
205*7c478bd9Sstevel@tonic-gate  * CSR Registers and register fields.
206*7c478bd9Sstevel@tonic-gate  */
207*7c478bd9Sstevel@tonic-gate /* CSR Register Addresses (IEEE1394-1995 8.3.2.2) */
208*7c478bd9Sstevel@tonic-gate #define	IEEE1394_CSR_STATE_CLEAR	0xFFFFF0000000
209*7c478bd9Sstevel@tonic-gate #define	IEEE1394_CSR_STATE_SET		0xFFFFF0000004
210*7c478bd9Sstevel@tonic-gate #define	IEEE1394_CSR_NODE_IDS		0xFFFFF0000008
211*7c478bd9Sstevel@tonic-gate #define	IEEE1394_CSR_RESET_START	0xFFFFF000000C
212*7c478bd9Sstevel@tonic-gate #define	IEEE1394_CSR_SPLIT_TIMEOUT_HI	0xFFFFF0000018
213*7c478bd9Sstevel@tonic-gate #define	IEEE1394_CSR_SPLIT_TIMEOUT_LO	0xFFFFF000001C
214*7c478bd9Sstevel@tonic-gate #define	IEEE1394_CSR_ARG_HI		0xFFFFF0000020
215*7c478bd9Sstevel@tonic-gate #define	IEEE1394_CSR_ARG_LO		0xFFFFF0000024
216*7c478bd9Sstevel@tonic-gate #define	IEEE1394_CSR_TEST_START		0xFFFFF0000028
217*7c478bd9Sstevel@tonic-gate #define	IEEE1394_CSR_TEST_STATUS	0xFFFFF000002C
218*7c478bd9Sstevel@tonic-gate 
219*7c478bd9Sstevel@tonic-gate /* Optional Register Addresses */
220*7c478bd9Sstevel@tonic-gate #define	IEEE1394_CSR_INTERRUPT_TARGET	0xFFFFF0000050
221*7c478bd9Sstevel@tonic-gate #define	IEEE1394_CSR_INTERRUPT_MASK	0xFFFFF0000054
222*7c478bd9Sstevel@tonic-gate #define	IEEE1394_CSR_CLOCK_VALUE	0xFFFFF0000058
223*7c478bd9Sstevel@tonic-gate #define	IEEE1394_CSR_CLOCK_VALUE_SZ	0x28
224*7c478bd9Sstevel@tonic-gate #define	IEEE1394_CSR_MESSAGE_REQUEST	0xFFFFF0000080
225*7c478bd9Sstevel@tonic-gate #define	IEEE1394_CSR_MESSAGE_REQUEST_SZ	0x80
226*7c478bd9Sstevel@tonic-gate 
227*7c478bd9Sstevel@tonic-gate /* Serial Bus CSR Register Addresss (IEEE1394-1995 8.3.2.3) */
228*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SCSR_CYCLE_TIME	0xFFFFF0000200
229*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SCSR_BUS_TIME		0xFFFFF0000204
230*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SCSR_PWRFAIL_IMMINENT	0xFFFFF0000208
231*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SCSR_PWRSRC		0xFFFFF000020C
232*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SCSR_BUSY_TIMEOUT	0xFFFFF0000210
233*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SCSR_BUSMGR_ID		0xFFFFF000021C
234*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SCSR_BANDWIDTH_AVAIL	0xFFFFF0000220
235*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SCSR_CHANS_AVAIL_HI	0xFFFFF0000224
236*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SCSR_CHANS_AVAIL_LO	0xFFFFF0000228
237*7c478bd9Sstevel@tonic-gate 
238*7c478bd9Sstevel@tonic-gate /* Config ROM Address */
239*7c478bd9Sstevel@tonic-gate #define	IEEE1394_CONFIG_ROM_ADDR	0xFFFFF0000400
240*7c478bd9Sstevel@tonic-gate #define	IEEE1394_CONFIG_ROM_SZ		0x400
241*7c478bd9Sstevel@tonic-gate #define	IEEE1394_CONFIG_ROM_QUAD_SZ	0x100
242*7c478bd9Sstevel@tonic-gate 
243*7c478bd9Sstevel@tonic-gate /*  Unit CSR Register Addresses */
244*7c478bd9Sstevel@tonic-gate #define	IEEE1394_UCSR_TOPOLOGY_MAP	0xFFFFF0001000
245*7c478bd9Sstevel@tonic-gate #define	IEEE1394_UCSR_TOPOLOGY_MAP_SZ	0x400
246*7c478bd9Sstevel@tonic-gate #define	IEEE1394_UCSR_SPEED_MAP		0xFFFFF0002000
247*7c478bd9Sstevel@tonic-gate #define	IEEE1394_UCSR_SPEED_MAP_SZ	0x1000
248*7c478bd9Sstevel@tonic-gate 
249*7c478bd9Sstevel@tonic-gate /* Boundary for "reserved" CSR registers */
250*7c478bd9Sstevel@tonic-gate #define	IEEE1394_UCSR_RESERVED_BOUNDARY	0xFFFFF0010000
251*7c478bd9Sstevel@tonic-gate 
252*7c478bd9Sstevel@tonic-gate #define	IEEE1394_CSR_OFFSET_MASK	0x00000000FFFF
253*7c478bd9Sstevel@tonic-gate 
254*7c478bd9Sstevel@tonic-gate /* 1394 Bus Speeds */
255*7c478bd9Sstevel@tonic-gate #define	IEEE1394_S100			0
256*7c478bd9Sstevel@tonic-gate #define	IEEE1394_S200			1
257*7c478bd9Sstevel@tonic-gate #define	IEEE1394_S400			2
258*7c478bd9Sstevel@tonic-gate #define	IEEE1394_S800			3
259*7c478bd9Sstevel@tonic-gate #define	IEEE1394_S1600			4
260*7c478bd9Sstevel@tonic-gate #define	IEEE1394_S3200			5
261*7c478bd9Sstevel@tonic-gate 
262*7c478bd9Sstevel@tonic-gate /* IEEE 1394 Bandwidth bounds */
263*7c478bd9Sstevel@tonic-gate #define	IEEE1394_BANDWIDTH_MIN		0
264*7c478bd9Sstevel@tonic-gate #define	IEEE1394_BANDWIDTH_MAX		0x1333
265*7c478bd9Sstevel@tonic-gate 
266*7c478bd9Sstevel@tonic-gate /* Speed Map specific defines */
267*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SPEED_MAP_CRC_LEN	0x03F1
268*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SPEED_MAP_LEN_MASK	0x0000FFFF
269*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SPEED_MAP_LEN_SHIFT	16
270*7c478bd9Sstevel@tonic-gate #define	IEEE1394_SPEED_MAP_DATA_LEN	0x0FBE
271*7c478bd9Sstevel@tonic-gate 
272*7c478bd9Sstevel@tonic-gate /* Topology Map specific defines */
273*7c478bd9Sstevel@tonic-gate #define	IEEE1394_TOP_MAP_LEN_MASK	0x0000FFFF
274*7c478bd9Sstevel@tonic-gate #define	IEEE1394_TOP_MAP_LEN_SHIFT	16
275*7c478bd9Sstevel@tonic-gate 
276*7c478bd9Sstevel@tonic-gate /* Config ROM specific defines */
277*7c478bd9Sstevel@tonic-gate #define	IEEE1394_CFG_ROM_CRC_VALUE_MASK	0x0000FFFF
278*7c478bd9Sstevel@tonic-gate #define	IEEE1394_CFG_ROM_CRC_LEN_SHIFT	16
279*7c478bd9Sstevel@tonic-gate #define	IEEE1394_CFG_ROM_CRC_LEN_MASK	0xFF
280*7c478bd9Sstevel@tonic-gate #define	IEEE1394_CFG_ROM_LEN_SHIFT	16
281*7c478bd9Sstevel@tonic-gate 
282*7c478bd9Sstevel@tonic-gate /* CRC16 defines */
283*7c478bd9Sstevel@tonic-gate #define	IEEE1394_CRC16_MASK		0xFFFF
284*7c478bd9Sstevel@tonic-gate 
285*7c478bd9Sstevel@tonic-gate /* Bit positions in the STATE register */
286*7c478bd9Sstevel@tonic-gate #define	IEEE1394_CSR_STATE_CMSTR	0x00000100
287*7c478bd9Sstevel@tonic-gate #define	IEEE1394_CSR_STATE_DREQ		0x00000040
288*7c478bd9Sstevel@tonic-gate #define	IEEE1394_CSR_STATE_ABDICATE	0x00000400
289*7c478bd9Sstevel@tonic-gate 
290*7c478bd9Sstevel@tonic-gate /* Positions in the BUS_INFO_BLOCK */
291*7c478bd9Sstevel@tonic-gate #define	IEEE1394_BIB_LNK_SPD_MASK	0x00000007
292*7c478bd9Sstevel@tonic-gate #define	IEEE1394_BIB_LNK_SPD_SHIFT	0
293*7c478bd9Sstevel@tonic-gate #define	IEEE1394_BIB_GEN_MASK		0x000000F0
294*7c478bd9Sstevel@tonic-gate #define	IEEE1394_BIB_GEN_SHIFT		4
295*7c478bd9Sstevel@tonic-gate #define	IEEE1394_BIB_MROM_MASK		0x00000300
296*7c478bd9Sstevel@tonic-gate #define	IEEE1394_BIB_MROM_SHIFT		8
297*7c478bd9Sstevel@tonic-gate #define	IEEE1394_BIB_IRMC_MASK		0x80000000
298*7c478bd9Sstevel@tonic-gate #define	IEEE1394_BIB_IRMC_SHIFT		31
299*7c478bd9Sstevel@tonic-gate #define	IEEE1394_BIB_BMC_MASK		0x10000000
300*7c478bd9Sstevel@tonic-gate #define	IEEE1394_BIB_BMC_SHIFT		28
301*7c478bd9Sstevel@tonic-gate #define	IEEE1394_BIB_CMC_MASK		0x40000000
302*7c478bd9Sstevel@tonic-gate #define	IEEE1394_BIB_CMC_SHIFT		30
303*7c478bd9Sstevel@tonic-gate #define	IEEE1394_BIB_MAXREC_MASK	0x0000F000
304*7c478bd9Sstevel@tonic-gate #define	IEEE1394_BIB_MAXREC_SHIFT	12
305*7c478bd9Sstevel@tonic-gate 
306*7c478bd9Sstevel@tonic-gate #define	IEEE1394_BIB_QUAD_SZ		5
307*7c478bd9Sstevel@tonic-gate #define	IEEE1394_BIB_SZ			0x14
308*7c478bd9Sstevel@tonic-gate 
309*7c478bd9Sstevel@tonic-gate /* Bus Manager specific defines */
310*7c478bd9Sstevel@tonic-gate #define	IEEE1394_BM_IRM_TIMEOUT		625000
311*7c478bd9Sstevel@tonic-gate #define	IEEE1394_BM_INCUMBENT_TIMEOUT	125000
312*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus
313*7c478bd9Sstevel@tonic-gate }
314*7c478bd9Sstevel@tonic-gate #endif
315*7c478bd9Sstevel@tonic-gate 
316*7c478bd9Sstevel@tonic-gate #endif	/* _SYS_1394_IEEE1394_H */
317