xref: /illumos-gate/usr/src/uts/sun4u/sys/sysioerr.h (revision 7c478bd9)
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) 1991-1999 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_SYSIOERR_H
28*7c478bd9Sstevel@tonic-gate #define	_SYS_SYSIOERR_H
29*7c478bd9Sstevel@tonic-gate 
30*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*7c478bd9Sstevel@tonic-gate 
32*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
33*7c478bd9Sstevel@tonic-gate extern "C" {
34*7c478bd9Sstevel@tonic-gate #endif
35*7c478bd9Sstevel@tonic-gate 
36*7c478bd9Sstevel@tonic-gate /*
37*7c478bd9Sstevel@tonic-gate  * Sbus error interrupt priorities
38*7c478bd9Sstevel@tonic-gate  */
39*7c478bd9Sstevel@tonic-gate #define	SBUS_UE_PIL		12
40*7c478bd9Sstevel@tonic-gate #define	SBUS_CE_PIL		11
41*7c478bd9Sstevel@tonic-gate #define	SBUS_ERR_PIL		12
42*7c478bd9Sstevel@tonic-gate #define	SBUS_THERMAL_PIL	9
43*7c478bd9Sstevel@tonic-gate #define	SBUS_PF_PIL		12
44*7c478bd9Sstevel@tonic-gate #define	SBUS_PM_PIL		12
45*7c478bd9Sstevel@tonic-gate 
46*7c478bd9Sstevel@tonic-gate /*
47*7c478bd9Sstevel@tonic-gate  * Bits of Sun5 SYSIO Control/Status Register
48*7c478bd9Sstevel@tonic-gate  */
49*7c478bd9Sstevel@tonic-gate #define	SYSIO_IMPL	0xF000000000000000ULL /* implementation number */
50*7c478bd9Sstevel@tonic-gate #define	SYSIO_VER	0x0F00000000000000ULL /* revision number */
51*7c478bd9Sstevel@tonic-gate #define	SYSIO_MID	0x00F8000000000000ULL /* UPA mid for SYSIO */
52*7c478bd9Sstevel@tonic-gate #define	SYSIO_INTGN	0x0007C00000000000ULL /* interrupt group number */
53*7c478bd9Sstevel@tonic-gate #define	SYSIO_APCKEN	0x0000000000000008ULL /* address parity check enable */
54*7c478bd9Sstevel@tonic-gate #define	SYSIO_APERR	0x0000000000000004ULL /* system address parity error */
55*7c478bd9Sstevel@tonic-gate #define	SYSIO_IAP	0x0000000000000002ULL /* invert UPA address parity */
56*7c478bd9Sstevel@tonic-gate #define	SYSIO_MODE	0x0000000000000001ULL /* speed of SYSIO clock */
57*7c478bd9Sstevel@tonic-gate 
58*7c478bd9Sstevel@tonic-gate /*
59*7c478bd9Sstevel@tonic-gate  * Bits of Sun5 SBus ECC Control Register
60*7c478bd9Sstevel@tonic-gate  */
61*7c478bd9Sstevel@tonic-gate #define	SECR_ECC_EN	0x8000000000000000ULL /* enable ECC checking */
62*7c478bd9Sstevel@tonic-gate #define	SECR_UE_INTEN	0x4000000000000000ULL /* enable UE_INT interrupt */
63*7c478bd9Sstevel@tonic-gate #define	SECR_CE_INTEN	0x2000000000000000ULL /* enable CE_INT interrupt */
64*7c478bd9Sstevel@tonic-gate 
65*7c478bd9Sstevel@tonic-gate /*
66*7c478bd9Sstevel@tonic-gate  * Bits of Sun5 SBus UE Asynchronous Fault Status Register
67*7c478bd9Sstevel@tonic-gate  */
68*7c478bd9Sstevel@tonic-gate #define	SB_UE_AFSR_P_PIO 0x8000000000000000ULL /* primary UE, PIO access */
69*7c478bd9Sstevel@tonic-gate #define	SB_UE_AFSR_P_DRD 0x4000000000000000ULL /* primary UE, DVMA read */
70*7c478bd9Sstevel@tonic-gate #define	SB_UE_AFSR_P_DWR 0x2000000000000000ULL /* primary UE, DVMA write */
71*7c478bd9Sstevel@tonic-gate #define	SB_UE_AFSR_P	 0xE000000000000000ULL /* primary UE */
72*7c478bd9Sstevel@tonic-gate #define	SB_UE_AFSR_S_PIO 0x1000000000000000ULL /* secondary UE, PIO access */
73*7c478bd9Sstevel@tonic-gate #define	SB_UE_AFSR_S_DRD 0x0800000000000000ULL /* secondary UE, DVMA read */
74*7c478bd9Sstevel@tonic-gate #define	SB_UE_AFSR_S_DWR 0x0400000000000000ULL /* secondary UE, DVMA write */
75*7c478bd9Sstevel@tonic-gate #define	SB_UE_AFSR_S	 0x1C00000000000000ULL /* secondary UE */
76*7c478bd9Sstevel@tonic-gate #define	SB_UE_AFSR_OFF   0x0000E00000000000ULL /* offset of dword w/pri. UE */
77*7c478bd9Sstevel@tonic-gate #define	SB_UE_AFSR_SIZE  0x00001C0000000000ULL /* 2**size of bad transfer */
78*7c478bd9Sstevel@tonic-gate #define	SB_UE_AFSR_MID   0x000003E000000000ULL /* master ID for pri. error */
79*7c478bd9Sstevel@tonic-gate #define	SB_UE_AFSR_ISAP	 0x0000001000000000ULL /* system parity error */
80*7c478bd9Sstevel@tonic-gate 
81*7c478bd9Sstevel@tonic-gate /*
82*7c478bd9Sstevel@tonic-gate  * Shifts for SBus Sysio UE Asynchronous Fault Status Register
83*7c478bd9Sstevel@tonic-gate  */
84*7c478bd9Sstevel@tonic-gate #define	SB_UE_DW_SHIFT		(45)
85*7c478bd9Sstevel@tonic-gate #define	SB_UE_SIZE_SHIFT	(42)
86*7c478bd9Sstevel@tonic-gate #define	SB_UE_MID_SHIFT		(37)
87*7c478bd9Sstevel@tonic-gate 
88*7c478bd9Sstevel@tonic-gate /*
89*7c478bd9Sstevel@tonic-gate  * Bits of Fusion Desktop SBus UE Asynchronous Fault Address Register
90*7c478bd9Sstevel@tonic-gate  */
91*7c478bd9Sstevel@tonic-gate #define	SB_UE_AFAR_PA	0x000001FFFFFFFFFF    /* PA<40:0>: physical address */
92*7c478bd9Sstevel@tonic-gate 
93*7c478bd9Sstevel@tonic-gate /*
94*7c478bd9Sstevel@tonic-gate  * Bits of Sun5 SBus CE Asynchronous Fault Status Register
95*7c478bd9Sstevel@tonic-gate  */
96*7c478bd9Sstevel@tonic-gate #define	SB_CE_AFSR_P_PIO 0x8000000000000000ULL /* primary CE, PIO access */
97*7c478bd9Sstevel@tonic-gate #define	SB_CE_AFSR_P_DRD 0x4000000000000000ULL /* primary CE, DVMA read */
98*7c478bd9Sstevel@tonic-gate #define	SB_CE_AFSR_P_DWR 0x2000000000000000ULL /* primary CE, DVMA write */
99*7c478bd9Sstevel@tonic-gate #define	SB_CE_AFSR_P	 0xE000000000000000ULL /* primary CE */
100*7c478bd9Sstevel@tonic-gate #define	SB_CE_AFSR_S_PIO 0x1000000000000000ULL /* secondary CE, PIO access */
101*7c478bd9Sstevel@tonic-gate #define	SB_CE_AFSR_S_DRD 0x0800000000000000ULL /* secondary CE, DVMA read */
102*7c478bd9Sstevel@tonic-gate #define	SB_CE_AFSR_S_DWR 0x0400000000000000ULL /* secondary CE, DVMA write */
103*7c478bd9Sstevel@tonic-gate #define	SB_CE_AFSR_S	 0x1C00000000000000ULL /* secondary CE */
104*7c478bd9Sstevel@tonic-gate #define	SB_CE_AFSR_SYND  0x00FF000000000000ULL /* CE syndrome bits */
105*7c478bd9Sstevel@tonic-gate #define	SB_CE_AFSR_OFF   0x0000E00000000000ULL /* offset of dword w/pri. CE */
106*7c478bd9Sstevel@tonic-gate #define	SB_CE_AFSR_SIZE	 0x00001C0000000000ULL /* 2**size of failed transfer */
107*7c478bd9Sstevel@tonic-gate #define	SB_CE_AFSR_MID	 0x000003E000000000ULL /* master ID for primary error */
108*7c478bd9Sstevel@tonic-gate 
109*7c478bd9Sstevel@tonic-gate /*
110*7c478bd9Sstevel@tonic-gate  * Shifts for Sun5 SBus CE Asynchronous Fault Status Register
111*7c478bd9Sstevel@tonic-gate  */
112*7c478bd9Sstevel@tonic-gate #define	SB_CE_SYND_SHIFT	(48)
113*7c478bd9Sstevel@tonic-gate #define	SB_CE_OFFSET_SHIFT	(45)
114*7c478bd9Sstevel@tonic-gate #define	SB_CE_SIZE_SHIFT	(42)
115*7c478bd9Sstevel@tonic-gate #define	SB_CE_MID_SHIFT		(37)
116*7c478bd9Sstevel@tonic-gate 
117*7c478bd9Sstevel@tonic-gate /*
118*7c478bd9Sstevel@tonic-gate  * Bits of Sun5 Fusion Desktop SBus CE Asynchronous Fault Address Register
119*7c478bd9Sstevel@tonic-gate  * Note: Fusion Desktop does not support E_SYND2.
120*7c478bd9Sstevel@tonic-gate  */
121*7c478bd9Sstevel@tonic-gate #define	SB_CE_E_SYND2	0xFF00000000000000ULL /* syndrome of prim. CE */
122*7c478bd9Sstevel@tonic-gate #define	SB_CE_AFAR_PA	0x000001FFFFFFFFFFULL /* PA<40:0>: physical address */
123*7c478bd9Sstevel@tonic-gate 
124*7c478bd9Sstevel@tonic-gate /*
125*7c478bd9Sstevel@tonic-gate  * Shift for Sun5 SBus CE Asynchronous Fault Address Register
126*7c478bd9Sstevel@tonic-gate  */
127*7c478bd9Sstevel@tonic-gate #define	SB_CE_SYND2_SHIFT	(56)
128*7c478bd9Sstevel@tonic-gate 
129*7c478bd9Sstevel@tonic-gate /*
130*7c478bd9Sstevel@tonic-gate  * Bits of Sun5 SBus Control and Status Register
131*7c478bd9Sstevel@tonic-gate  * See Fusion Desktop System Spec. Table 3-63 for details on slots 13-15
132*7c478bd9Sstevel@tonic-gate  */
133*7c478bd9Sstevel@tonic-gate #define	SB_CSR_IMPL	 0xF000000000000000ULL /* host adapter impl. number */
134*7c478bd9Sstevel@tonic-gate #define	SB_CSR_REV	 0x0F00000000000000ULL /* host adapter rev. number */
135*7c478bd9Sstevel@tonic-gate #define	SB_CSR_DPERR_S14 0x0020000000000000ULL /* SBus slot 14 aka Happy Meal */
136*7c478bd9Sstevel@tonic-gate #define	SB_CSR_DPERR_S13 0x0010000000000000ULL /* SBus slot 13 aka APC */
137*7c478bd9Sstevel@tonic-gate #define	SB_CSR_DPERR_S3  0x0008000000000000ULL /* SBus slot 3 DVMA parity err */
138*7c478bd9Sstevel@tonic-gate #define	SB_CSR_DPERR_S2  0x0004000000000000ULL /* SBus slot 2 DVMA parity err */
139*7c478bd9Sstevel@tonic-gate #define	SB_CSR_DPERR_S1  0x0002000000000000ULL /* SBus slot 1 DVMA parity err */
140*7c478bd9Sstevel@tonic-gate #define	SB_CSR_DPERR_S0  0x0001000000000000ULL /* SBus slot 0 DVMA parity err */
141*7c478bd9Sstevel@tonic-gate #define	SB_CSR_PIO_PERRS 0x00007F0000000000ULL /* SBus parity errors */
142*7c478bd9Sstevel@tonic-gate #define	SB_CSR_PPERR_S15 0x0000400000000000ULL /* SBus slot 15 aka slavio */
143*7c478bd9Sstevel@tonic-gate #define	SB_CSR_PPERR_S14 0x0000200000000000ULL /* SBus slot 14 aka Happy Meal */
144*7c478bd9Sstevel@tonic-gate #define	SB_CSR_PPERR_S13 0x0000100000000000ULL /* SBus slot 13 aka APC */
145*7c478bd9Sstevel@tonic-gate #define	SB_CSR_PPERR_S3  0x0000080000000000ULL /* SBus slot 3 PIO parity err */
146*7c478bd9Sstevel@tonic-gate #define	SB_CSR_PPERR_S2  0x0000040000000000ULL /* SBus slot 2 PIO parity err */
147*7c478bd9Sstevel@tonic-gate #define	SB_CSR_PPERR_S1  0x0000020000000000ULL /* SBus slot 1 PIO parity err */
148*7c478bd9Sstevel@tonic-gate #define	SB_CSR_PPERR_S0  0x0000010000000000ULL /* SBus slot 0 PIO parity err */
149*7c478bd9Sstevel@tonic-gate #define	SB_CSR_FAST_SBUS 0x0000000000000400ULL /* shorten PIO access latency */
150*7c478bd9Sstevel@tonic-gate #define	SB_CSR_WAKEUP_EN 0x0000000000000200ULL /* power-management bit */
151*7c478bd9Sstevel@tonic-gate #define	SB_CSR_ERRINT_EN 0x0000000000000100ULL /* enable intr. for SBus errs */
152*7c478bd9Sstevel@tonic-gate #define	SB_CSR_ARBEN_MAC 0x0000000000000020ULL /* enable DVMA for Macio */
153*7c478bd9Sstevel@tonic-gate #define	SB_CSR_ARBEN_APC 0x0000000000000010ULL /* enable DVMA for APC */
154*7c478bd9Sstevel@tonic-gate #define	SB_CSR_ARBEN_SLT 0x000000000000000FULL /* enable DVMA for SBus slots */
155*7c478bd9Sstevel@tonic-gate 
156*7c478bd9Sstevel@tonic-gate /*
157*7c478bd9Sstevel@tonic-gate  * Shifts for Sun5 SBus Control and Status Register
158*7c478bd9Sstevel@tonic-gate  */
159*7c478bd9Sstevel@tonic-gate #define	SB_CSR_IMPL_SHIFT	(60)
160*7c478bd9Sstevel@tonic-gate #define	SB_CSR_REV_SHIFT	(56)
161*7c478bd9Sstevel@tonic-gate #define	SB_CSR_DVMA_PERR_SHIFT	(48)
162*7c478bd9Sstevel@tonic-gate #define	SB_CSR_PIO_PERR_SHIFT	(40)
163*7c478bd9Sstevel@tonic-gate 
164*7c478bd9Sstevel@tonic-gate /*
165*7c478bd9Sstevel@tonic-gate  * Bits of Sun5 SBus Asynchronous Fault Status Register
166*7c478bd9Sstevel@tonic-gate  */
167*7c478bd9Sstevel@tonic-gate #define	SB_AFSR_P_ERRS	0xE000000000000000ULL /* primary errors */
168*7c478bd9Sstevel@tonic-gate #define	SB_AFSR_P_LE	0x8000000000000000ULL /* primary LATE_ERR */
169*7c478bd9Sstevel@tonic-gate #define	SB_AFSR_P_TO	0x4000000000000000ULL /* primary SBus TIMEOUT */
170*7c478bd9Sstevel@tonic-gate #define	SB_AFSR_P_BERR	0x2000000000000000ULL /* primary SBus ERR ack */
171*7c478bd9Sstevel@tonic-gate #define	SB_AFSR_S_ERRS	0x1C00000000000000ULL /* secondary errors */
172*7c478bd9Sstevel@tonic-gate #define	SB_AFSR_S_LE	0x1000000000000000ULL /* secondary LATE_ERR */
173*7c478bd9Sstevel@tonic-gate #define	SB_AFSR_S_TO	0x0800000000000000ULL /* secondary SBus TIMEOUT */
174*7c478bd9Sstevel@tonic-gate #define	SB_AFSR_S_BERR	0x0400000000000000ULL /* secondary SBus ERR ack */
175*7c478bd9Sstevel@tonic-gate #define	SB_AFSR_RD	0x0000800000000000ULL /* primary error was READ op. */
176*7c478bd9Sstevel@tonic-gate #define	SB_AFSR_SIZE	0x00001C0000000000ULL /* 2**size of failed transfer */
177*7c478bd9Sstevel@tonic-gate #define	SB_AFSR_MID	0x000003E000000000ULL /* master ID for primary error */
178*7c478bd9Sstevel@tonic-gate 
179*7c478bd9Sstevel@tonic-gate /*
180*7c478bd9Sstevel@tonic-gate  * Shifts for Sun5 SBus Asynchronous Fault Status Register
181*7c478bd9Sstevel@tonic-gate  */
182*7c478bd9Sstevel@tonic-gate #define	SB_AFSR_SIZE_SHIFT	(42)
183*7c478bd9Sstevel@tonic-gate #define	SB_AFSR_MID_SHIFT	(37)
184*7c478bd9Sstevel@tonic-gate 
185*7c478bd9Sstevel@tonic-gate /*
186*7c478bd9Sstevel@tonic-gate  * Bits of Fusion Desktop SBus Asynchronous Fault Address Register
187*7c478bd9Sstevel@tonic-gate  */
188*7c478bd9Sstevel@tonic-gate #define	SB_AFAR_PA	0x000001FFFFFFFFFFULL /* PA<40:0>: physical address */
189*7c478bd9Sstevel@tonic-gate 
190*7c478bd9Sstevel@tonic-gate /*
191*7c478bd9Sstevel@tonic-gate  * Function prototypes
192*7c478bd9Sstevel@tonic-gate  */
193*7c478bd9Sstevel@tonic-gate extern int
194*7c478bd9Sstevel@tonic-gate sysio_err_init(struct sbus_soft_state *softsp, caddr_t address);
195*7c478bd9Sstevel@tonic-gate extern int
196*7c478bd9Sstevel@tonic-gate sysio_err_resume_init(struct sbus_soft_state *softsp);
197*7c478bd9Sstevel@tonic-gate 
198*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
199*7c478bd9Sstevel@tonic-gate }
200*7c478bd9Sstevel@tonic-gate #endif
201*7c478bd9Sstevel@tonic-gate 
202*7c478bd9Sstevel@tonic-gate #endif	/* _SYS_SYSIOERR_H */
203