xref: /netbsd-src/sys/arch/vax/include/ka820.h (revision dfba816635b288ffc525cb86146857ef1a9333c3)
1*dfba8166Smatt /*	$NetBSD: ka820.h,v 1.9 2008/03/11 05:34:02 matt Exp $	*/
25b099226Sragge /*
35b099226Sragge  * Copyright (c) 1988 Regents of the University of California.
45b099226Sragge  * All rights reserved.
55b099226Sragge  *
65b099226Sragge  * This code is derived from software contributed to Berkeley by
75b099226Sragge  * Chris Torek.
85b099226Sragge  *
95b099226Sragge  * Redistribution and use in source and binary forms, with or without
105b099226Sragge  * modification, are permitted provided that the following conditions
115b099226Sragge  * are met:
125b099226Sragge  * 1. Redistributions of source code must retain the above copyright
135b099226Sragge  *    notice, this list of conditions and the following disclaimer.
145b099226Sragge  * 2. Redistributions in binary form must reproduce the above copyright
155b099226Sragge  *    notice, this list of conditions and the following disclaimer in the
165b099226Sragge  *    documentation and/or other materials provided with the distribution.
17aad01611Sagc  * 3. Neither the name of the University nor the names of its contributors
185b099226Sragge  *    may be used to endorse or promote products derived from this software
195b099226Sragge  *    without specific prior written permission.
205b099226Sragge  *
215b099226Sragge  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
225b099226Sragge  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
235b099226Sragge  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
245b099226Sragge  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
255b099226Sragge  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
265b099226Sragge  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
275b099226Sragge  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
285b099226Sragge  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
295b099226Sragge  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
305b099226Sragge  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
315b099226Sragge  * SUCH DAMAGE.
325b099226Sragge  *
335b099226Sragge  *	@(#)ka820.h	7.3 (Berkeley) 6/28/90
345b099226Sragge  */
355b099226Sragge 
365b099226Sragge /*
37d20841bbSwiz  * Definitions specific to the ka820 CPU.
385b099226Sragge  */
3956effcf2Smatt #ifndef _VAX_KA820_H_
4056effcf2Smatt #define _VAX_KA820_H_
415b099226Sragge 
425b099226Sragge /*
435b099226Sragge  * Device addresses.
445b099226Sragge  */
455b099226Sragge #define KA820_PORTADDR		0x20088000	/* port controller */
465b099226Sragge #define KA820_BRAMADDR		0x20090000	/* boot ram */
475b099226Sragge #define KA820_EEPROMADDR	0x20098000	/* eeprom */
485b099226Sragge #define KA820_RX50ADDR		0x200b0000	/* rcx50 */
495b099226Sragge #define KA820_CLOCKADDR		0x200b8000	/* watch chip */
505b099226Sragge 
515b099226Sragge /*
525b099226Sragge  * Sizes.  The port controller, RCX50, and watch chip are all one page.
535b099226Sragge  */
545b099226Sragge #define KA820_BRPAGES		16		/* 8K */
555b099226Sragge #define KA820_EEPAGES		64		/* 32K */
565b099226Sragge 
575b099226Sragge /* port controller CSR bit values */
585b099226Sragge #define KA820PORT_RSTHALT	0x80000000	/* restart halt */
595b099226Sragge #define KA820PORT_LCONS		0x40000000	/* logical console */
605b099226Sragge #define KA820PORT_LCONSEN	0x20000000	/* logical console enable */
615b099226Sragge #define KA820PORT_BIRESET	0x10000000	/* BI reset */
625b099226Sragge #define KA820PORT_BISTF		0x08000000	/* ??? */
635b099226Sragge #define KA820PORT_ENBAPT	0x04000000	/* ??? */
645b099226Sragge #define KA820PORT_STPASS	0x02000000	/* self test pass */
655b099226Sragge #define KA820PORT_RUN		0x01000000	/* run */
665b099226Sragge #define KA820PORT_WWPE		0x00800000	/* ??? parity even? */
675b099226Sragge #define KA820PORT_EVLCK		0x00400000	/* event lock */
685b099226Sragge #define KA820PORT_WMEM		0x00200000	/* write mem */
695b099226Sragge #define KA820PORT_EV4		0x00100000	/* event 4 */
705b099226Sragge #define KA820PORT_EV3		0x00080000	/* event 3 */
715b099226Sragge #define KA820PORT_EV2		0x00040000	/* event 2 */
725b099226Sragge #define KA820PORT_EV1		0x00020000	/* event 1 */
735b099226Sragge #define KA820PORT_EV0		0x00010000	/* event 0 */
745b099226Sragge #define KA820PORT_WWPO		0x00008000	/* ??? parity odd? */
755b099226Sragge #define KA820PORT_PERH		0x00004000	/* parity error H */
765b099226Sragge #define KA820PORT_ENBPIPE	0x00002000	/* enable? pipe */
775b099226Sragge #define KA820PORT_TIMEOUT	0x00001000	/* timeout */
785b099226Sragge #define KA820PORT_RSVD		0x00000800	/* reserved */
795b099226Sragge #define KA820PORT_CONSEN	0x00000400	/* console interrupt enable */
805b099226Sragge #define KA820PORT_CONSCLR	0x00000200	/* clear console interrupt */
815b099226Sragge #define KA820PORT_CONSINTR	0x00000100	/* console interrupt req */
825b099226Sragge #define KA820PORT_RXIE		0x00000080	/* RX50 interrupt enable */
835b099226Sragge #define KA820PORT_RXCLR		0x00000040	/* clear RX50 interrupt */
845b099226Sragge #define KA820PORT_RXIRQ		0x00000020	/* RX50 interrupt request */
855b099226Sragge #define KA820PORT_IPCLR		0x00000010	/* clear IP interrupt */
865b099226Sragge #define KA820PORT_IPINTR	0x00000008	/* IP interrupt request */
875b099226Sragge #define KA820PORT_CRDEN		0x00000004	/* enable CRD interrupts */
885b099226Sragge #define KA820PORT_CRDCLR	0x00000002	/* clear CRD interrupt */
895b099226Sragge #define KA820PORT_CRDINTR	0x00000001	/* CRD interrupt request */
905b099226Sragge 
91bef0af53Sragge /* interrupt vectors unique for this CPU */
92bef0af53Sragge #define	KA820_INT_RXCD		0x58
93d0a8785bSragge #define KA820_INT_IPINTR	0x80
94bef0af53Sragge 
955b099226Sragge /* what the heck */
965b099226Sragge #define KA820PORT_BITS \
975b099226Sragge "\20\40RSTHALT\37LCONS\36LCONSEN\35BIRESET\34BISTF\33ENBAPT\32STPASS\31RUN\
985b099226Sragge \30WWPE\27EVLCK\26WMEM\25EV4\24EV3\23EV2\22EV1\21EV\20WWPO\17PERH\16ENBPIPE\
995b099226Sragge \15TIMEOUT\13CONSEN\12CONSCLR\11CONSINTR\10RXIE\7RXCLR\6RXIRQ\5IPCLR\4IPINTR\
1005b099226Sragge \3CRDEN\2CLRCLR\1CRDINTR"
1015b099226Sragge 
1025b099226Sragge /* clock CSR bit values, per csr */
1035b099226Sragge #define KA820CLK_0_BUSY		0x01		/* busy (time changing) */
1045b099226Sragge #define KA820CLK_1_GO		0x0c		/* run */
1055b099226Sragge #define KA820CLK_1_SET		0x0d		/* set the time */
1065b099226Sragge #define KA820CLK_3_VALID	0x01		/* clock is valid */
1075b099226Sragge 
1085b099226Sragge #ifndef LOCORE
1095b099226Sragge struct ka820port {
1105b099226Sragge 	u_long	csr;
1115b099226Sragge 	/* that seems to be all.... */
1125b099226Sragge };
1135b099226Sragge 
1145b099226Sragge struct ka820clock {
1155b099226Sragge 	u_char	sec;
1165b099226Sragge 	u_char	pad0;
1175b099226Sragge 	u_char	secalrm;
1185b099226Sragge 	u_char	pad1;
1195b099226Sragge 	u_char	min;
1205b099226Sragge 	u_char	pad2;
1215b099226Sragge 	u_char	minalrm;
1225b099226Sragge 	u_char	pad3;
1235b099226Sragge 	u_char	hr;
1245b099226Sragge 	u_char	pad4;
1255b099226Sragge 	u_char	hralrm;
1265b099226Sragge 	u_char	pad5;
1275b099226Sragge 	u_char	dayofwk;
1285b099226Sragge 	u_char	pad6;
1295b099226Sragge 	u_char	day;
1305b099226Sragge 	u_char	pad7;
1315b099226Sragge 	u_char	mon;
1325b099226Sragge 	u_char	pad8;
1335b099226Sragge 	u_char	yr;
1345b099226Sragge 	u_char	pad9;
1355b099226Sragge 	u_short csr0;
1365b099226Sragge 	u_short csr1;
1375b099226Sragge 	u_short csr2;
1385b099226Sragge 	u_short csr3;
1395b099226Sragge };
1405b099226Sragge 
141*dfba8166Smatt void	crxintr(void *arg);
14256effcf2Smatt #endif /* _LOCORE */
14356effcf2Smatt 
14456effcf2Smatt #endif /* _VAX_KA820_H_ */
145