xref: /original-bsd/sys/vax/vax/ka650.h (revision 05bc5180)
1f01d5e99Stef /*
25a10f7e4Sbostic  * Copyright (c) 1988 The Regents of the University of California.
35a10f7e4Sbostic  * All rights reserved.
4f01d5e99Stef  *
5eeb2360dSbostic  * This code is derived from software contributed to Berkeley by
6eeb2360dSbostic  * Mt. Xinu.
7eeb2360dSbostic  *
8*05bc5180Sbostic  * %sccs.include.redist.c%
95a10f7e4Sbostic  *
10*05bc5180Sbostic  *	@(#)ka650.h	7.5 (Berkeley) 06/28/90
11f01d5e99Stef  */
12f01d5e99Stef 
13f01d5e99Stef /*
14f01d5e99Stef  *
15f01d5e99Stef  * Definitions specific to the ka650 (uVAX 3600/3602) cpu card.
16f01d5e99Stef  */
17f01d5e99Stef 
18f01d5e99Stef #ifdef VAX650
19f01d5e99Stef /*
20f01d5e99Stef  * CAER: Memory System Error Register (IPR 39)
21f01d5e99Stef  */
22f01d5e99Stef #define CAER_DAL	0x00000040	/* CDAL or level 2 cache data parity */
23f01d5e99Stef #define CAER_MCD	0x00000020	/* mcheck due to DAL parity error */
24f01d5e99Stef #define CAER_MCC	0x00000010	/* mcheck due to 1st lev cache parity */
25f01d5e99Stef #define CAER_DAT	0x00000002	/* data parity in 1st level cache */
26f01d5e99Stef #define CAER_TAG	0x00000001	/* tag parity in 1st level cache */
27f01d5e99Stef 
28f01d5e99Stef /*
29f01d5e99Stef  * CADR: Cache Disable Register (IPR 37)
30f01d5e99Stef  */
31f01d5e99Stef #define CADR_STMASK	0x000000f0	/* 1st level cache state mask */
32f01d5e99Stef #define CADR_SEN2	0x00000080	/* 1st level cache set 2 enabled */
33f01d5e99Stef #define CADR_SEN1	0x00000040	/* 1st level cache set 1 enabled */
34f01d5e99Stef #define CADR_CENI	0x00000020	/* 1st level I-stream caching enabled */
35f01d5e99Stef #define CADR_CEND	0x00000010	/* 1st level D-stream caching enabled */
36f01d5e99Stef 
37f01d5e99Stef /*
38f01d5e99Stef  * Internal State Info 2: (for mcheck recovery)
39f01d5e99Stef  */
40f01d5e99Stef #define IS2_VCR		0x00008000	/* VAX Can't Restart flag */
41f01d5e99Stef 
425b374011Stef /*
435b374011Stef  * DMA System Error Register (merr_dser)
445b374011Stef  */
455b374011Stef #define DSER_QNXM	0x00000080	/* Q-22 Bus NXM */
465b374011Stef #define DSER_QPE	0x00000020	/* Q-22 Bus parity Error */
475b374011Stef #define DSER_MEM	0x00000010	/* Main mem err due to ext dev DMA */
485b374011Stef #define DSER_LOST	0x00000008	/* Lost error: DSER <7,5,4,0> set */
495b374011Stef #define DSER_NOGRANT	0x00000004	/* No Grant timeout on cpu demand R/W */
505b374011Stef #define DSER_DNXM	0x00000001	/* DMA NXM */
515b374011Stef #define DSER_CLEAR 	(DSER_QNXM | DSER_QPE | DSER_MEM |  \
525b374011Stef 			 DSER_LOST | DSER_NOGRANT | DSER_DNXM)
535b374011Stef #define DMASER_BITS \
545b374011Stef "\20\20BHALT\17DCNEG\10QBNXM\6QBPE\5MEMERR\4LOSTERR\3NOGRANT\1DMANXM"
555b374011Stef 
56f01d5e99Stef #ifndef LOCORE
57f01d5e99Stef /*
58f01d5e99Stef  * Local registers (in I/O space)
59f01d5e99Stef  * This is done in disjoint sections.  Map names are set in locore.s
60f01d5e99Stef  * and they are mapped in routine configcpu()
61f01d5e99Stef  */
62f01d5e99Stef 
63f01d5e99Stef /*
64f01d5e99Stef  * memory error & configuration registers
65f01d5e99Stef  */
66f01d5e99Stef struct ka650_merr {
67f01d5e99Stef 	u_long	merr_scr;	/* System Config Register */
68f01d5e99Stef 	u_long	merr_dser;	/* DMA System Error Register */
69f01d5e99Stef 	u_long	merr_qbear;	/* QBus Error Address Register */
70f01d5e99Stef 	u_long	merr_dear;	/* DMA Error Address Register */
71f01d5e99Stef 	u_long	merr_qbmbr;	/* Q Bus Map Base address Register */
72f01d5e99Stef 	u_long	pad[59];
73f01d5e99Stef 	u_long	merr_csr[16];	/* Main Memory Config Regs (16 banks) */
74f01d5e99Stef 	u_long	merr_errstat;	/* Main Memory Error Status */
75f01d5e99Stef 	u_long	merr_cont;	/* Main Memory Control */
76f01d5e99Stef };
77f01d5e99Stef #define KA650_MERR	0x20080000
78f01d5e99Stef 
79f01d5e99Stef /*
80f01d5e99Stef  * Main Memory Error Status Register (merr_errstat)
81f01d5e99Stef  */
82f01d5e99Stef #define MEM_EMASK	0xe0000180	/* mask of all err bits */
83f01d5e99Stef #define MEM_RDS		0x80000000	/* uncorrectable main memory */
84f01d5e99Stef #define MEM_RDSHIGH	0x40000000	/* high rate RDS errors */
85f01d5e99Stef #define MEM_CRD		0x20000000	/* correctable main memory */
86f01d5e99Stef #define MEM_DMA		0x00000100	/* DMA read or write error */
87f01d5e99Stef #define MEM_CDAL	0x00000080	/* CDAL Parity error on write */
88f01d5e99Stef #define MEM_PAGE	0x1ffffe00	/* Offending Page Number */
89f01d5e99Stef #define MEM_PAGESHFT	9		/* Shift to normalize page number */
90f01d5e99Stef 
91f01d5e99Stef /*
92f01d5e99Stef  * Main Memory Control & Diag Status Reg (merr_cont)
93f01d5e99Stef  */
94f01d5e99Stef #define MEM_CRDINT	0x00001000	/* CRD interrupts enabled */
95f01d5e99Stef #define MEM_REFRESH	0x00000800	/* Forced memory refresh */
96f01d5e99Stef #define MEM_ERRDIS	0x00000400	/* error detect disable	*/
97f01d5e99Stef #define MEM_DIAG	0x00000080	/* Diagnostics mode */
98f01d5e99Stef #define MEM_CHECK	0x0000007f	/* check bits for diagnostic mode */
99f01d5e99Stef 
100f01d5e99Stef /*
101f01d5e99Stef  * Main Memory Config Regs (merr_csr[0-15])
102f01d5e99Stef  */
103f01d5e99Stef #define MEM_BNKENBLE	0x80000000	/* Bank Enable */
104f01d5e99Stef #define MEM_BNKNUM	0x03c00000	/* Physical map Bank number */
105f01d5e99Stef #define MEM_BNKUSAGE	0x00000003	/* Bank Usage */
106f01d5e99Stef 
107f01d5e99Stef /*
108f01d5e99Stef  * Cache Control & Boot/Diag registers
109f01d5e99Stef  */
110f01d5e99Stef struct ka650_cbd {
111f01d5e99Stef 	u_char	cbd_cacr;	/* Low byte: Cache Enable & Parity Err detect */
112f01d5e99Stef 	u_char	cbd_cdf1;	/* Cache diagnostic field (unused) */
113f01d5e99Stef 	u_char	cbd_cdf2;	/* Cache diagnostic field (unused) */
114f01d5e99Stef 	u_char	pad;
115f01d5e99Stef 	u_long	cbd_bdr;	/* Boot & Diagnostic Register (unused) */
116f01d5e99Stef };
117f01d5e99Stef #define KA650_CBD	0x20084000
118f01d5e99Stef 
119f01d5e99Stef /*
120f01d5e99Stef  * CACR: Cache Control Register (2nd level cache) (cbd_cacr)
121f01d5e99Stef  */
122f01d5e99Stef #define CACR_CEN	0x00000010	/* Cache enable */
123f01d5e99Stef #define CACR_CPE	0x00000020	/* Cache Parity Error */
124f01d5e99Stef 
125f01d5e99Stef /*
126f01d5e99Stef  * System Support Chip (SSC) registers
127f01d5e99Stef  */
128f01d5e99Stef struct ka650_ssc {
129f01d5e99Stef 	u_long	ssc_sscbr;	/* SSC Base Addr Register */
130f01d5e99Stef 	u_long	pad1[3];
131f01d5e99Stef 	u_long	ssc_ssccr;	/* SSC Configuration Register */
132f01d5e99Stef 	u_long	pad2[3];
133f01d5e99Stef 	u_long	ssc_cbtcr;	/* CDAL Bus Timeout Control Register */
134f01d5e99Stef 	u_long	pad3[55];
135f01d5e99Stef 	u_long	ssc_tcr0;	/* timer control reg 0 */
136f01d5e99Stef 	u_long	ssc_tir0;	/* timer interval reg 0 */
137f01d5e99Stef 	u_long	ssc_tnir0;	/* timer next interval reg 0 */
138f01d5e99Stef 	u_long	ssc_tivr0;	/* timer interrupt vector reg 0 */
139f01d5e99Stef 	u_long	ssc_tcr1;	/* timer control reg 1 */
140f01d5e99Stef 	u_long	ssc_tir1;	/* timer interval reg 1 */
141f01d5e99Stef 	u_long	ssc_tnir1;	/* timer next interval reg 1 */
142f01d5e99Stef 	u_long	ssc_tivr1;	/* timer interrupt vector reg 1 */
143f01d5e99Stef 	u_long	pad4[184];
144f01d5e99Stef 	u_char	ssc_cpmbx;	/* Console Program Mail Box: Lang & Hact */
145f01d5e99Stef 	u_char	ssc_terminfo;	/* TTY info: Video Dev, MCS, CRT & ROM flags */
146f01d5e99Stef 	u_char	ssc_keyboard;	/* Keyboard code */
147f01d5e99Stef };
148f01d5e99Stef #define KA650_SSC	0x20140000
149f01d5e99Stef 
150f01d5e99Stef /*
151f01d5e99Stef  * CBTCR: CDAL Bus Timeout Control Register (ssc_cbtcr)
152f01d5e99Stef  */
153f01d5e99Stef #define CBTCR_BTO	0x80000000	/* r/w unimp IPR or unack intr */
154f01d5e99Stef #define CBTCR_RWT	0x40000000	/* CDAL Bus Timeout on CPU or DMA */
155f01d5e99Stef 
156f01d5e99Stef /*
157f01d5e99Stef  * TCR0/TCR1: Programable Timer Control Registers (ssc_tcr[01])
158f01d5e99Stef  * (The rest of the bits are the same as in the standard VAX
159f01d5e99Stef  *	Interval timer and are defined in clock.h)
160f01d5e99Stef  */
161f01d5e99Stef #define TCR_STP		0x00000004	/* Stop after time-out */
162f01d5e99Stef 
163f01d5e99Stef /*
164f01d5e99Stef  * Flags for Console Program Mail Box
165f01d5e99Stef  */
166f01d5e99Stef #define CPMB650_HALTACT	0x03	/* Field for halt action */
167f01d5e99Stef #define CPMB650_RESTART	0x01	/* Restart */
168f01d5e99Stef #define CPMB650_REBOOT	0x02	/* Reboot */
169f01d5e99Stef #define CPMB650_HALT	0x03	/* Halt */
170f01d5e99Stef #define CPMB650_BIP	0x04	/* Bootstrap in progress */
171f01d5e99Stef #define CPMB650_RIP	0x08	/* Restart in progress */
172f01d5e99Stef #define CPMB650_LANG	0xf0	/* Language field */
173f01d5e99Stef 
174f01d5e99Stef /*
175f01d5e99Stef  * Inter Processor Communication Register
176f01d5e99Stef  * To determine if memory error was from QBUS device DMA (as opposed to cpu).
177f01d5e99Stef  */
178f01d5e99Stef struct ka650_ipcr {
179f01d5e99Stef 	u_long	pad[80];
180f01d5e99Stef 	u_short	ipcr0;		/* InterProcessor Comm Reg for arbiter */
181f01d5e99Stef };
182f01d5e99Stef #define KA650_IPCR	0x20001e00
183f01d5e99Stef 
184f01d5e99Stef #ifndef STANDALONE
185f01d5e99Stef /*
186f01d5e99Stef  * External declarations of the map names (declared in spt.s)
187f01d5e99Stef  * for the local register space.
188f01d5e99Stef  */
189f01d5e99Stef extern	struct pte KA650MERRmap[];
190f01d5e99Stef extern	struct ka650_merr ka650merr;	/* mem err & mem config regs */
191f01d5e99Stef extern	struct pte KA650CBDmap[];
192f01d5e99Stef extern	struct ka650_cbd ka650cbd;	/* cache control & boot/diag regs */
193f01d5e99Stef extern	struct pte KA650SSCmap[];
194f01d5e99Stef extern	struct ka650_ssc ka650ssc;	/* SSC regs (& console prog mail box) */
195f01d5e99Stef extern	struct pte KA650IPCRmap[];
196f01d5e99Stef extern	struct ka650_ipcr ka650ipcr;	/* InterProcessor Com Regs */
197f01d5e99Stef extern	struct pte KA650CACHEmap[];
198f01d5e99Stef extern	int	ka650cache[];		/* Cache Diagnostic space (for flush) */
199f01d5e99Stef #endif	STANDALONE
200f01d5e99Stef #endif	LOCORE
201f01d5e99Stef 
202f01d5e99Stef /*
203f01d5e99Stef  * Physical start address of the Qbus memory.
204f01d5e99Stef  * The q-bus memory size is 4 meg.
205f01d5e99Stef  * Physical start address of the I/O space (where the 8Kbyte I/O page is).
206f01d5e99Stef  */
207f01d5e99Stef #define KA650_QMEM	0x30000000
208f01d5e99Stef #define KA650_QMEMSIZE	(512*8192)
209f01d5e99Stef #define KA650_QDEVADDR	0x20000000
210f01d5e99Stef 
211f01d5e99Stef /*
212f01d5e99Stef  * Mapping info for Cache Entries, including
213f01d5e99Stef  * Size (in bytes) of 2nd Level Cache for cache flush operation
214f01d5e99Stef  */
215f01d5e99Stef #define KA650_CACHE	0x10000000
216f01d5e99Stef #define KA650_CACHESIZE	(64*1024)
217f01d5e99Stef 
218f01d5e99Stef /*
219f01d5e99Stef  * Useful ROM addresses
220f01d5e99Stef  */
221f01d5e99Stef #define	KA650ROM_SIDEX	0x20060004	/* system ID extension */
222f01d5e99Stef #define	KA650ROM_GETC	0x20060008	/* (jsb) get character from console */
223f01d5e99Stef #define	KA650ROM_PUTS	0x2006000c	/* (jsb) put string to console */
224f01d5e99Stef #define	KA650ROM_GETS	0x20060010	/* (jsb) read string with prompt */
225f01d5e99Stef #define KA650_CONSTYPE	0x20140401	/* byte at which console type resides */
226f01d5e99Stef #endif
227