FreeBSD/Linux Kernel Cross Reference
sys/sqt/SGSmem.h
1 /*
2 * Mach Operating System
3 * Copyright (c) 1991 Carnegie Mellon University
4 * Copyright (c) 1991 Sequent Computer Systems
5 * All Rights Reserved.
6 *
7 * Permission to use, copy, modify and distribute this software and its
8 * documentation is hereby granted, provided that both the copyright
9 * notice and this permission notice appear in all copies of the
10 * software, derivative works or modified versions, and any portions
11 * thereof, and that both notices appear in supporting documentation.
12 *
13 * CARNEGIE MELLON AND SEQUENT COMPUTER SYSTEMS ALLOW FREE USE OF
14 * THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON AND
15 * SEQUENT COMPUTER SYSTEMS DISCLAIM ANY LIABILITY OF ANY KIND FOR
16 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
17 *
18 * Carnegie Mellon requests users of this software to return to
19 *
20 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
21 * School of Computer Science
22 * Carnegie Mellon University
23 * Pittsburgh PA 15213-3890
24 *
25 * any improvements or extensions that they make and grant Carnegie Mellon
26 * the rights to redistribute these changes.
27 */
28
29 /*
30 * HISTORY
31 * $Log: SGSmem.h,v $
32 * Revision 2.3 91/07/31 17:58:18 dbg
33 * Changed copyright.
34 * [91/07/31 dbg]
35 *
36 * Revision 2.2 91/05/08 12:50:08 dbg
37 * Added, from Sequent SYMMETRY sources.
38 * [91/04/26 14:45:32 dbg]
39 *
40 */
41 /*
42 * $Header: SGSmem.h,v 2.3 91/07/31 17:58:18 dbg Exp $
43 *
44 * SGSmem.h
45 * Second-Generation System memory controller definitions.
46 */
47
48 /* SGSmem.h
49 * Revision 1.1 89/07/19 14:48:50 kak
50 * Initial revision
51 *
52 */
53
54 #ifndef _SQT_SGSMEM_H_
55 #define _SQT_SGSMEM_H_
56
57 /*
58 * SGS memory EDC Diagnostic Latch bits
59 */
60 #define MEM_EDC_DL_MASK 0x7f /* useful bits */
61 #define MEM_EDC_DL_CBX 0x01 /* Check Bit 0 Diagnostic */
62 #define MEM_EDC_DL_CB0 0x02 /* Check Bit 1 Diagnostic */
63 #define MEM_EDC_DL_CB1 0x04 /* Check Bit 2 Diagnostic */
64 #define MEM_EDC_DL_CB2 0x08 /* Check Bit 3 Diagnostic */
65 #define MEM_EDC_DL_CB4 0x10 /* Check Bit 4 Diagnostic */
66 #define MEM_EDC_DL_CB8 0x20 /* Check Bit 5 Diagnostic */
67 #define MEM_EDC_DL_CB16 0x40 /* Check Bit 6 Diagnostic */
68
69 /*
70 * Load EDC Diag Latch: Write Only.
71 * A write of any value causes EDCs to latch data from BDPs
72 */
73 #define MEM_LOAD_EDC 0x30 /* Load EDC Diag Latch */
74
75 /*
76 * Bank Enable Register: Read/Write.
77 * Bits 0-7 enables banks 0-7.
78 * Resets to zero on "hard resets" (power-up) only.
79 */
80 #define MEM_BANKS 0x40 /* Bank Enable Register */
81
82 /*
83 * Config Register: Read/Write.
84 * Resets to zero on "hard resets" (power-up) only.
85 */
86 #define MEM_CFG 0x50 /* Config Register */
87 #define MEM_CFG_MASK 0xff /* useful bits */
88 #define MEM_CFG_WIDE_BUS 0x80 /* Wide Bus Enable */
89 #define MEM_CFG_EN_EXT_MODE 0x40 /* Enable Extended Mode */
90 #define MEM_CFG_4MB 0x20 /* Decode for 4MB DRAMs */
91 #define MEM_CFG_4_BANKS 0x10 /* Decode for 4 banks maximum */
92 #define MEM_CFG_SWAP_BANKS 0x08 /* Decode swapping banks 0 & 1 */
93 #define MEM_CFG_INTERLEAVE 0x04 /* Enable Interleave */
94 #define MEM_CFG_INIT_MASK 0x03 /* useful bits */
95 #define MEM_CFG_SCRUB 0x03 /* Scrub always */
96 #define MEM_CFG_LOGGABLE 0x02 /* Scrub if loggable error */
97 #define MEM_CFG_CHECK 0x01 /* Check only */
98 #define MEM_CFG_INIT 0x00 /* Initialize */
99
100 /*
101 * Start Initialization/Check: Write Only (Address Strobe Only)
102 * A write of any value causes initialization or check to begin,
103 * according to MEM_CFG_INIT_MASK bits.
104 */
105 #define MEM_START 0x60 /* Start Initialization/Check */
106
107 /*
108 * Refresh Delay and EDC Control Register: Read/Write.
109 * Resets to zero on "hard resets" (power-up) only.
110 */
111 #define MEM_CTRL 0x70 /* Refresh Delay Register */
112 #define MEM_CTRL_MASK 0xff /* useful bits */
113 #define MEM_CTRL_EN_EXP_ID 0x80 /* Enable Expansion ID */
114 #define MEM_CTRL_EDC_COR_EN 0x40 /* enable EDC Correct mode */
115 #define MEM_CTRL_EDC_MODE 0x30 /* EDC Diag Mode mask */
116 #define MEM_CTRL_EDC_MODE_0 0x10 /* EDC Diag Mode bit 0 */
117 #define MEM_CTRL_EDC_MODE_1 0x20 /* EDC Diag Mode bit 1 */
118 #define MEM_CTRL_REFRESH_EN 0x08 /* enable refresh */
119 #define MEM_CTRL_DMASK 0x07 /* delay count useful bits */
120 #define MEM_CTRL_0 0x07 /* no delay */
121 #define MEM_CTRL_1600 0x06 /* 1600-nsec delay */
122 #define MEM_CTRL_3200 0x05 /* 3200-nsec delay */
123 #define MEM_CTRL_4800 0x04 /* 4800-nsec delay */
124 #define MEM_CTRL_6400 0x03 /* 6400-nsec delay */
125 #define MEM_CTRL_8000 0x02 /* 8000-nsec delay */
126 #define MEM_CTRL_9600 0x01 /* 9600-nsec delay */
127 #define MEM_CTRL_11200 0x00 /* 11200-nsec delay */
128 /* other values are invalid */
129 #define MEM_CTRL_DELAY(nsec) \
130 (MEM_CTRL_DMASK & ~((nsec)/1600))
131
132 /* Diagnostic Generate Mode */
133 #define MEM_EDC_DIAG_GEN (MEM_CTRL_EDC_MODE_0)
134
135 /* Diagnostic Detect Mode */
136 #define MEM_EDC_DIAG_DET (MEM_CTRL_EDC_MODE_1)
137
138 /* Diagnostic Pass Thru Mode */
139 #define MEM_EDC_DIAG_THRU (MEM_CTRL_EDC_MODE_1 | MEM_CTRL_EDC_MODE_0)
140
141 /* Diagnostic Correct Mode */
142 #define MEM_EDC_DIAG_COR (MEM_CTRL_EDC_COR_EN | MEM_CTRL_EDC_MODE_1)
143
144 /* Initialize Mode */
145 #define MEM_EDC_INIT (MEM_CTRL_EDC_COR_EN | MEM_CTRL_EDC_MODE)
146
147
148 /*
149 * Low BDP Register: Read/Write.
150 */
151 #define MEM_BDP_LO 0x80 /* Low BDP Register */
152
153 /*
154 * High BDP Register: Read/Write.
155 */
156 #define MEM_BDP_HI 0x90 /* High BDP Register */
157
158 /*
159 * BIC: Read/Write.
160 */
161 #define MEM_BIC 0xa0 /* BIC Register */
162
163 /*
164 * Status Register: Read Only.
165 * Cleared by writing to MEM_CLR_EDC register.
166 */
167 #define MEM_STATUS 0xb0 /* Status Register */
168 #define MEM_STATUS_MASK 0x5 /* useful bits */
169 #define MEM_STATUS_RCYCLE 0x4 /* Refresh cycle occurred */
170 #define MEM_STATUS_CYCLE 0x1 /* Init/Check cycle complete */
171
172 /*
173 * EDC Error Register: Read Only.
174 * Cleared by writing to MEM_CLR_EDC register.
175 */
176 #define MEM_EDC 0xc0 /* EDC Error Register */
177 #define MEM_EDC_MASK 0x3f /* useful bits */
178 #define MEM_EDC_HI_MASK 0x38 /* High EDC useful bits */
179 #define MEM_EDC_HI_OV 0x20 /* High EDC overflow */
180 #define MEM_EDC_HI_ME 0x10 /* High EDC multiple-bit error */
181 #define MEM_EDC_HI_SE 0x08 /* High EDC single-bit error */
182 #define MEM_EDC_LO_MASK 0x07 /* Low EDC useful bits */
183 #define MEM_EDC_LO_OV 0x04 /* Low EDC overflow */
184 #define MEM_EDC_LO_ME 0x02 /* Low EDC multiple-bit error */
185 #define MEM_EDC_LO_SE 0x01 /* Low EDC single-bit error */
186
187 /*
188 * Clear EDC Errors and Status: Write Only.
189 * A write of any value clears MEM_EDC_ERR and MEM_STATUS.
190 */
191 #define MEM_CLR_EDC 0xd0 /* Clear EDC Errors and Status */
192
193 /*
194 * EDC Syndrome Registers: Read Only.
195 * Reads the EDCs' Syndrome registers, which are valid
196 * only if an EDC error has been logged.
197 */
198 #define MEM_SYND_LO 0xe0 /* Low EDC Syndrome */
199 #define MEM_SYND_MASK 0xff /* useful bits */
200 #define MEM_NORMCY 0x80 /* Logged during a normal cycle */
201 #define MEM_SYND_BITS 0x7f /* syndrome bits */
202 #define MEM_SYND_HI 0xf0 /* High EDC Syndrome */
203 #define MEM_XOVER 0x80 /* Logged during a cross-over cycle */
204
205
206 /*
207 * Following are non-SLIC defines related to mem2 control:
208 */
209
210 /*
211 * Expansion ID register
212 * (read by accessing expansion memory with MEM_CFG_EN_EXP_ID asserted)
213 */
214 #define MEM_EXP_MASK 0xff /* useful bits */
215 #define MEM_EXP_NONE 0xff /* Value for no expansion board */
216 #define MEM_EXP_BANKS 0x07 /* Number of populated banks */
217 #define MEM_EXP_4MB 0x08 /* 4-MBit DRAM (else 1-MBit) */
218 #define MEM_EXP_WIDE 0x10 /* Supports wide bus */
219 #define MEM_EXP_REV 0xe0 /* Revision level */
220
221 /*
222 * bits to check against the controller's config prom's
223 * list of acceptable expansions.
224 */
225 #define MEM_EXP_CHECK (MEM_EXP_WIDE|MEM_EXP_REV)
226
227 #define MEM_EXP_WIDTH(x) (((x) & MEM_EXP_WIDE)? 64: 32)
228
229 /*
230 * Expansion control
231 * These bits correspond to the bank select bits when the
232 * expansion memory is accessed with MEM_CFG_EN_EXP_ID
233 * asserted in the memory configuration register.
234 */
235 #define MEM_EXP_CTL_SHIFT 0x2
236 #define MEM_EXP_CTL_INTERLEAVE 0x1
237
238 /*
239 * Offset from cd_m_base of memory controllers interleaved
240 * as ILEAVE_HIGH.
241 */
242 #define MEM_ILEAVE_OFFSET 0x20
243
244 #endif /* _SQT_SGSMEM_H_ */
Cache object: abf4d281e43b1bc8bea215f7d6503bb9
|