xref: /csrg-svn/sys/vax/vax/ka820.h (revision 35042)
134399Skarels /*
2*35042Sbostic  * Copyright (c) 1988 Regents of the University of California.
3*35042Sbostic  * All rights reserved.
434399Skarels  *
5*35042Sbostic  * This code is derived from software contributed to Berkeley by
6*35042Sbostic  * Chris Torek.
7*35042Sbostic  *
8*35042Sbostic  * Redistribution and use in source and binary forms are permitted
9*35042Sbostic  * provided that the above copyright notice and this paragraph are
10*35042Sbostic  * duplicated in all such forms and that any documentation,
11*35042Sbostic  * advertising materials, and other materials related to such
12*35042Sbostic  * distribution and use acknowledge that the software was developed
13*35042Sbostic  * by the University of California, Berkeley.  The name of the
14*35042Sbostic  * University may not be used to endorse or promote products derived
15*35042Sbostic  * from this software without specific prior written permission.
16*35042Sbostic  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
17*35042Sbostic  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
18*35042Sbostic  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19*35042Sbostic  *
20*35042Sbostic  *	@(#)ka820.h	7.2 (Berkeley) 07/09/88
21*35042Sbostic  */
22*35042Sbostic 
23*35042Sbostic /*
2434399Skarels  * Definitions specific to the ka820 cpu.
2534399Skarels  */
2634399Skarels 
2734399Skarels #if VAX8200
2834399Skarels 
2934399Skarels /*
3034399Skarels  * Device addresses.
3134399Skarels  */
3234399Skarels #define	KA820_PORTADDR		0x20088000	/* port controller */
3334399Skarels #define	KA820_BRAMADDR		0x20090000	/* boot ram */
3434399Skarels #define	KA820_EEPROMADDR	0x20098000	/* eeprom */
3534399Skarels #define	KA820_RX50ADDR		0x200b0000	/* rcx50 */
3634399Skarels #define	KA820_CLOCKADDR		0x200b8000	/* watch chip */
3734399Skarels 
3834399Skarels /*
3934399Skarels  * Sizes.  The port controller, RCX50, and watch chip are all one page.
4034399Skarels  */
4134399Skarels #define	KA820_BRPAGES		16		/* 8K */
4234399Skarels #define	KA820_EEPAGES		64		/* 32K */
4334399Skarels 
4434399Skarels /* port controller CSR bit values */
4534399Skarels #define	KA820PORT_RSTHALT	0x80000000	/* restart halt */
4634399Skarels #define	KA820PORT_LCONS		0x40000000	/* logical console */
4734399Skarels #define	KA820PORT_LCONSEN	0x20000000	/* logical console enable */
4834399Skarels #define	KA820PORT_BIRESET	0x10000000	/* BI reset */
4934399Skarels #define	KA820PORT_BISTF		0x08000000	/* ??? */
5034399Skarels #define	KA820PORT_ENBAPT	0x04000000	/* ??? */
5134399Skarels #define	KA820PORT_STPASS	0x02000000	/* self test pass */
5234399Skarels #define	KA820PORT_RUN		0x01000000	/* run */
5334399Skarels #define	KA820PORT_WWPE		0x00800000	/* ??? parity even? */
5434399Skarels #define	KA820PORT_EVLCK		0x00400000	/* event lock */
5534399Skarels #define	KA820PORT_WMEM		0x00200000	/* write mem */
5634399Skarels #define	KA820PORT_EV4		0x00100000	/* event 4 */
5734399Skarels #define	KA820PORT_EV3		0x00080000	/* event 3 */
5834399Skarels #define	KA820PORT_EV2		0x00040000	/* event 2 */
5934399Skarels #define	KA820PORT_EV1		0x00020000	/* event 1 */
6034399Skarels #define	KA820PORT_EV0		0x00010000	/* event 0 */
6134399Skarels #define	KA820PORT_WWPO		0x00008000	/* ??? parity odd? */
6234399Skarels #define	KA820PORT_PERH		0x00004000	/* parity error H */
6334399Skarels #define	KA820PORT_ENBPIPE	0x00002000	/* enable? pipe */
6434399Skarels #define	KA820PORT_TIMEOUT	0x00001000	/* timeout */
6534399Skarels #define	KA820PORT_RSVD		0x00000800	/* reserved */
6634399Skarels #define	KA820PORT_CONSEN	0x00000400	/* console interrupt enable */
6734399Skarels #define	KA820PORT_CONSCLR	0x00000200	/* clear console interrupt */
6834399Skarels #define	KA820PORT_CONSINTR	0x00000100	/* console interrupt req */
6934399Skarels #define	KA820PORT_RXIE		0x00000080	/* RX50 interrupt enable */
7034399Skarels #define	KA820PORT_RXCLR		0x00000040	/* clear RX50 interrupt */
7134399Skarels #define	KA820PORT_RXIRQ		0x00000020	/* RX50 interrupt request */
7234399Skarels #define	KA820PORT_IPCLR		0x00000010	/* clear IP interrupt */
7334399Skarels #define	KA820PORT_IPINTR	0x00000008	/* IP interrupt request */
7434399Skarels #define	KA820PORT_CRDEN		0x00000004	/* enable CRD interrupts */
7534399Skarels #define	KA820PORT_CRDCLR	0x00000002	/* clear CRD interrupt */
7634399Skarels #define	KA820PORT_CRDINTR	0x00000001	/* CRD interrupt request */
7734399Skarels 
7834399Skarels /* what the heck */
7934399Skarels #define	KA820PORT_BITS \
8034399Skarels "\20\40RSTHALT\37LCONS\36LCONSEN\35BIRESET\34BISTF\33ENBAPT\32STPASS\31RUN\
8134399Skarels \30WWPE\27EVLCK\26WMEM\25EV4\24EV3\23EV2\22EV1\21EV\20WWPO\17PERH\16ENBPIPE\
8234399Skarels \15TIMEOUT\13CONSEN\12CONSCLR\11CONSINTR\10RXIE\7RXCLR\6RXIRQ\5IPCLR\4IPINTR\
8334399Skarels \3CRDEN\2CLRCLR\1CRDINTR"
8434399Skarels 
8534399Skarels /* clock CSR bit values, per csr */
8634399Skarels #define	KA820CLK_0_BUSY		0x01		/* busy (time changing) */
8734399Skarels #define	KA820CLK_1_GO		0x0c		/* run */
8834399Skarels #define	KA820CLK_1_SET		0x0d		/* set the time */
8934399Skarels #define	KA820CLK_3_VALID	0x01		/* clock is valid */
9034399Skarels 
9134399Skarels #ifndef LOCORE
9234399Skarels struct ka820port {
9334399Skarels 	u_long	csr;
9434399Skarels 	/* that seems to be all.... */
9534399Skarels };
9634399Skarels 
9734399Skarels struct ka820clock {
9834399Skarels 	u_char	sec;
9934399Skarels 	u_char	pad0;
10034399Skarels 	u_char	secalrm;
10134399Skarels 	u_char	pad1;
10234399Skarels 	u_char	min;
10334399Skarels 	u_char	pad2;
10434399Skarels 	u_char	minalrm;
10534399Skarels 	u_char	pad3;
10634399Skarels 	u_char	hr;
10734399Skarels 	u_char	pad4;
10834399Skarels 	u_char	hralrm;
10934399Skarels 	u_char	pad5;
11034399Skarels 	u_char	dayofwk;
11134399Skarels 	u_char	pad6;
11234399Skarels 	u_char	day;
11334399Skarels 	u_char	pad7;
11434399Skarels 	u_char	mon;
11534399Skarels 	u_char	pad8;
11634399Skarels 	u_char	yr;
11734399Skarels 	u_char	pad9;
11834399Skarels 	u_short	csr0;
11934399Skarels 	u_short	csr1;
12034399Skarels 	u_short	csr2;
12134399Skarels 	u_short	csr3;
12234399Skarels };
12334399Skarels #endif
12434399Skarels #endif
125