xref: /original-bsd/sys/vax/uba/vsreg.h (revision 9f325586)
1 /* @(#)vsreg.h	7.1 (MIT) 06/05/86 */
2  /****************************************************************************
3  *									    *
4  *  Copyright (c) 1983, 1984 by						    *
5  *  DIGITAL EQUIPMENT CORPORATION, Maynard, Massachusetts.		    *
6  *  All rights reserved.						    *
7  * 									    *
8  *  This software is furnished on an as-is basis and may be used and copied *
9  *  only with inclusion of the above copyright notice. This software or any *
10  *  other copies thereof may be provided or otherwise made available to     *
11  *  others only for non-commercial purposes.  No title to or ownership of   *
12  *  the software is hereby transferred.					    *
13  * 									    *
14  *  The information in this software is  subject to change without notice   *
15  *  and  should  not  be  construed as  a commitment by DIGITAL EQUIPMENT   *
16  *  CORPORATION.							    *
17  * 									    *
18  *  DIGITAL assumes no responsibility for the use  or  reliability of its   *
19  *  software on equipment which is not supplied by DIGITAL.		    *
20  * 									    *
21  *									    *
22  ****************************************************************************/
23 
24 /*
25  * vsreg.h - VS100 Registers and Bits
26  *
27  * Author:	Christopher A. Kent
28  *		Digital Equipment Corporation
29  *		Western Research Lab
30  * Date:	Tue Jun 14 1983
31  */
32 
33 struct vsdevice{
34 	u_short	vs_csr0;		/* Control and Status */
35 	u_short	vs_csr1;		/* Interrupt Reason */
36 	u_short	vs_csr2;		/* Keyboard Receive */
37 	u_short	vs_csr3;		/* Function Parameter Low */
38 	u_short	vs_csr4;		/* Function Parameter High */
39 	u_short	vs_csr5;		/* Cursor Position X */
40 	u_short	vs_csr6;		/* Cursor Position Y */
41 	u_short	vs_csr7;		/* Interrupt Vector */
42 	u_short	vs_csr8;		/* Spare 1 */
43 	u_short	vs_csr9;		/* Spare 2 */
44 	u_short	vs_csra;		/* Spare 3 */
45 	u_short	vs_csrb;		/* Spare 4 */
46 	u_short	vs_csrc;		/* Spare 5 */
47 	u_short	vs_csrd;		/* Spare 6 */
48 	u_short	vs_csre;		/* Spare 7 */
49 	u_short	vs_csrf;		/* Interrupt Vector (2Bs) */
50 };
51 
52 /*
53  * CSR0 - Control and Status
54  */
55 
56 #define	VS_LNK_TRNS	0100000		/* Link Transition */
57 #define	VS_LNK_AVL	0040000		/* Link Available */
58 #define	VS_LNK_ERR	0020000		/* Link Error */
59 #define	VS_XMIT_ON	0010000		/* Transmitter On */
60 #define	VS_MNT_MODE	0004000		/* Maintenance Mode */
61 #define	VS_CRC_DIS	0002000		/* CRC Disable */
62 #define	VS_MNT_DONE	0001000		/* Maintenance Done */
63 #define	VS_SPARE	0000400		/* Spare */
64 #define	VS_OWN		0000200		/* Owner */
65 #define	VS_IE		0000100		/* Interrupt Enable */
66 #define	VS_FCN		0000076		/* Function Code */
67 #define	VS_GO		0000001		/* GO! */
68 
69 struct vs_csr{
70     union{
71 	u_short	_register;
72 	struct{
73 	    unsigned _go : 1;
74 	    unsigned _function : 5;
75 	    unsigned _ie : 1;
76 	    unsigned _own : 1;
77 	    unsigned _spare : 1;
78 	    unsigned _mainDone : 1;
79 	    unsigned _CRCdisable : 1;
80 	    unsigned _mainMode : 1;
81 	    unsigned _xmitOn : 1;
82 	    unsigned _linkErr : 1;
83 	    unsigned _linkAvail : 1;
84 	    unsigned _linkTran : 1;
85 	}_bits;
86     }_X;
87 };
88 
89 #define	csr_reg		_X._register
90 #define csr_go		_X._bits._go
91 #define csr_ie		_X._bits._ie
92 #define	csr_own		_X._bits._own
93 #define	csr_mainDone	_X._bits._mainDone
94 #define	csr_CRCdisable	_X._bits._CRCdisable
95 #define csr_mainMode	_X._bits._mainMode
96 #define	csr_xmitOn	_X._bits._xmitOn
97 #define	csr_linkErr	_X._bits._linkErr
98 #define	csr_linkAvail	_X._bits._linkAvail
99 #define	csr_linkTran	_X._bits._linkTran
100 
101 /* Function Codes */
102 
103 #define	VS_INIT		01		/* Initialize Display */
104 #define	VS_SEND		02		/* Send Packet */
105 #define	VS_START	03		/* Start Microcode */
106 #define	VS_ABORT	04		/* Abort Command Chain */
107 #define	VS_PWRUP	05		/* Power Up Reset */
108 /**/
109 #define	VS_ENABBA	020		/* Enable BBA */
110 #define	VS_DISBBA	021		/* Disable BBA */
111 #define	VS_INFINITE	022		/* Inifinite Retries */
112 #define	VS_FINITE	023		/* Finite Retries */
113 
114 /* amount to shift to get function code into right place */
115 
116 #define	VS_FCSHIFT	01
117 
118 /*
119  * CSR1 - Interrupt Reason
120  */
121 
122 #define	vs_irr		vs_csr1
123 
124 #define	VS_ERROR	0100000		/* Any error */
125 #define	VS_REASON	0077777		/* Reason Mask */
126 #define	VSIRR_BITS \
127 "\20\20ERROR\10PWRUP\6TABLET\5MOUSE\4BUTTON\3START\2DONE\1INIT"
128 
129 #define	VS_INT_US	0
130 #define	VS_INT_ID	01
131 #define	VS_INT_CD	02
132 #define	VS_INT_SE	04
133 #define	VS_INT_BE	010
134 #define	VS_INT_MM	020
135 #define	VS_INT_TM	040
136 #define	VS_INT_PWR	0200
137 
138 struct vs_intr{
139     union{
140 	u_short	 _register;		/* whole register */
141 	struct{
142 	    unsigned _reason : 14;	/* Reason bits */
143 	    unsigned _diagnostic : 1;	/* Diagnostic Error bit */
144 	    unsigned _error : 1;	/* Error bit */
145 	}_bits;
146     }_X;
147 };
148 
149 #define	intr_reg	_X._register
150 #define	intr_reason	_X._bits._reason
151 #define	intr_diagnostic	_X._bits._diagnostic	/* not in rev 2b */
152 #define	intr_error	_X._bits._error
153 
154 /*
155  * CSR2 - Keyboard Receive
156  */
157 
158 #define	vs_krr		vs_csr2
159 
160 #define	VS_KBDEV	0007000		/* Device mask */
161 #define	VS_KBT		0000400		/* Transition direction */
162 #define	VS_KBKEY	0000377		/* Key mask */
163 
164 struct vs_kbd{
165     union{
166 	u_short	 _register;		/* whole register */
167 	struct{
168 	    unsigned _key : 8;		/* Key number */
169 	    unsigned _transition : 1;	/* Transition direction */
170 	    unsigned _device : 3;	/* Device */
171 	    unsigned _x : 4;		/* Unused */
172 	}_bits;
173     }_X;
174 };
175 
176 #define	kbd_reg		_X._register
177 #define	kbd_key		_X._bits._key
178 #define	kbd_transition	_X._bits._transition
179 #define	kbd_device	_X._bits._device
180 
181 #define	VS_KBTUP	0		/* up */
182 #define	VS_KBTDOWN	1		/* down */
183 
184 /*
185  * CSR3/4 Function Parameter Address
186  */
187 
188 #define	vs_pr1		vs_csr3
189 #define	vs_pr2		vs_csr4
190 
191 struct vs_fparm{
192     union{
193 	struct{
194 	    u_short _plow;	/* low 16 bits of address */
195 	    u_short _phigh;	/* high 16 bits of address */
196 	}_parts;
197 	caddr_t _pall;
198     }_X;
199 };
200 #define	fparm_low	_X._parts._plow
201 #define	fparm_high	_X._parts._phigh
202 #define	fparm_all	_X._pall
203 
204 /*
205  * CSR5/6 - Cursor position
206  */
207 
208 #define	vs_cxr		vs_csr5
209 #define	vs_cyr		vs_csr6
210 
211 
212 /*
213  * CSR 7 - Interrupt vector in fiber cable machines
214  */
215 
216 #define	vs_ivr		vs_csr7
217 
218 /*
219  * CSR 8 through 14 Spare
220  */
221 
222 #define	vs_spr2		vs_csr8
223 #define	vs_spr3		vs_csr9
224 #define	vs_spr4		vs_csra
225 #define	vs_spr5		vs_csrb
226 #define	vs_spr6		vs_csrc
227 #define	vs_spr7		vs_csrd
228 #define	vs_spr8		vs_csre
229 
230 /*
231  * CSR 15 - Interrupt vector in rev 2B
232  */
233 
234 #define	vs_ivr2		vs_csrf
235