Merge zeep.eecs.umich.edu:/m5/Bitkeeper/alpha-system
[gem5.git] / system / alpha / h / ssb.h
1 #ifndef __SSB_H_LOADED
2 #define __SSB_H_LOADED
3 /*****************************************************************************
4
5 Copyright © 1993, 1994 Digital Equipment Corporation,
6 Maynard, Massachusetts.
7
8 All Rights Reserved
9
10 Permission to use, copy, modify, and distribute this software and its
11 documentation for any purpose and without fee is hereby granted, provided
12 that the copyright notice and this permission notice appear in all copies
13 of software and supporting documentation, and that the name of Digital not
14 be used in advertising or publicity pertaining to distribution of the software
15 without specific, written prior permission. Digital grants this permission
16 provided that you prominently mark, as not part of the original, any
17 modifications made to this software or documentation.
18
19 Digital Equipment Corporation disclaims all warranties and/or guarantees
20 with regard to this software, including all implied warranties of fitness for
21 a particular purpose and merchantability, and makes no representations
22 regarding the use of, or the results of the use of, the software and
23 documentation in terms of correctness, accuracy, reliability, currentness or
24 otherwise; and you rely on the software, documentation and results solely at
25 your own risk.
26
27 ******************************************************************************/
28
29 /*
30 * $Id: ssb.h,v 1.1.1.1 1997/10/30 23:27:17 verghese Exp $;
31 */
32
33 /*
34 * $Log: ssb.h,v $
35 * Revision 1.1.1.1 1997/10/30 23:27:17 verghese
36 * current 10/29/97
37 *
38 * Revision 1.3 1994/08/05 20:13:47 fdh
39 * Updated Copyright header and RCS $Id: identifier.
40 *
41 * Revision 1.2 1994/06/20 14:18:59 fdh
42 * Fixup header file preprocessor #include conditionals.
43 *
44 * Revision 1.1 1993/06/08 19:56:16 fdh
45 * Initial revision
46 *
47 */
48
49
50
51 /* ssbinit */
52 /* Set up SSB definitions */
53 /* Last modified on 1/3/91 by L. Stewart */
54
55 #define SSB_stcreset1 0x0800 /* CR_DIR */
56 #define SSB_stcreset2 0x3820 /* CR_CABEN | CR_AUTO | CR_DIR */
57 /* | CR_FIFOMR */
58
59 #define SSB_TagCable 0
60 #define SSB_TagSlot 3
61 #define SSB_TagTVA 2
62 #define SSB_TagRFA 1
63 #define SSB_TagORF 5
64 #define SSB_TagStartTV 4
65 #define SSB_TagTVStat 6
66 #define SSB_TagLocalStat 7
67
68 #define SSB_AdrLocalStat 0x4000
69 #define SSB_AdrSRA 0x8000
70 #define SSB_AdrSRB 0x8001
71
72 #define SSB_LCRenable 0x1
73 #define SSB_LCRclrstat 0x2
74 #define SSB_LCRfifomr 0x4
75 #define SSB_LCRreset 0x8
76 #define SSB_LCRled 0x10
77
78 #define SSB_LSTfifoff 0x100
79 #define SSB_LSTfifohf 0x200
80 #define SSB_LSTfifoef 0x400
81 #define SSB_LSTinst 0x800
82 #define SSB_LSTid 0x1000
83 #define SSB_LSTotherinst 0x2000
84 #define SSB_LSTcnfg0 0x4000
85 #define SSB_LSTcnfg1 0x8000
86 #define SSB_LSTnode 0xf000
87
88 #define SSB_CRrParityS 0x01
89 #define SSB_CRdataWP 0x02
90 #define SSB_CRadrWP 0x04
91 #define SSB_CRerrEnable 0x08
92 #define SSB_CRreset 0x10
93 #define SSB_CRdoConfig 0x20
94 #define SSB_CRnodeClock 0x40
95
96 #define SSB_SRAshared 0x00000080
97 #define SSB_SRAdirty 0x00100000
98 #define SSB_SRAnType 0x80000000
99
100 #define SSB_PSRinst 0x001
101 #define SSB_PSRmerror 0x002
102 #define SSB_PSRreset 0x004
103 #define SSB_PSRerror 0x008
104 #define SSB_PSRserror 0x010
105 #define SSB_PSRisr 0x7e0
106
107 struct SSB_lsrtype {
108 unsigned sequence : 8;
109 unsigned slot : 8;
110 unsigned mix : 4;
111 unsigned inst : 1;
112 unsigned ef : 1;
113 unsigned hf : 1;
114 unsigned ff : 1;
115 unsigned crpad : 3;
116 unsigned crled : 1;
117 unsigned crreset : 1;
118 unsigned crfifomr : 1;
119 unsigned crclrstat : 1;
120 unsigned crenable : 1;
121 };
122
123 struct SSB_pstattype {
124 unsigned pad : 21;
125 unsigned isr : 6;
126 unsigned serror : 1;
127 unsigned error : 1;
128 unsigned reset : 1;
129 unsigned merror : 1;
130 unsigned inst : 1;
131 };
132
133 struct SSB_sratype {
134 unsigned nodeType : 1;
135 unsigned p0stat: 11;
136 unsigned dirty : 1;
137 unsigned p1stat : 11;
138 unsigned shared : 1;
139 unsigned cr : 7;
140 };
141
142 struct SSB_srbtype {
143 unsigned p1count : 8;
144 unsigned p0count : 8;
145 unsigned arbcount : 16;
146 };
147
148 extern int ssb_sequence;
149 extern int ssb_localcr;
150 extern int ssb_maincr;
151 extern int ssb_port;
152 extern int ssb_node;
153 extern int ssb_config1;
154 extern int ssb_config0;
155 extern int ssb_lastsra;
156 extern int ssb_lastsrb;
157 extern int ssb_lastlsr;
158 extern int ssb_lastieecc;
159 extern struct SSB_lsrtype ssb_lsr;
160 extern int ssb_mix;
161 extern struct SSB_sratype ssb_sra;
162 extern struct SSB_srbtype ssb_srb;
163 extern int ssb_resid;
164 extern struct SSB_pstattype ssb_portstatus;
165
166
167 /* ssb routines */
168 #define SSB_CR SSB_stcreset2
169 #define SSBCH 1020
170
171 #define SSB_CABLE(x) (wfifo(x, SSB_TagCable))
172 #define SSB_LDSLOT(x) (wfifo(x, SSB_TagSlot))
173 #define SSB_LDTVA(x, w) (wfifo((x) | ((w) ? 0x80000000 : 0), SSB_TagTVA))
174 #define SSB_LDRFA(a, c) (wfifo(((255 - c) << 16) + a, SSB_TagRFA))
175 #define SSB_LDORF(x) (wfifo(x, SSB_TagORF))
176 #define SSB_STARTTV(a, c, w) (wfifo(( (w << 15) | ((255 - c) << 16) | a), SSB_TagStartTV ))
177 #define SSB_TVSTAT(x) (wfifo(x, SSB_TagTVStat))
178 #define SSB_LOCALSTAT(x) (wfifo(x, SSB_TagLocalStat))
179
180 #define SSB_CFF() ( STC_SETCR(tvp->crmask & ~STC_CRFIFOMR), \
181 STC_SETCR(tvp->crmask | STC_CRFIFOMR) )
182
183 #endif /* __SSB_H_LOADED */