Home | History | Annotate | Line # | Download | only in include
ka820.h revision 1.3
      1  1.3   matt /*	$NetBSD: ka820.h,v 1.3 2000/01/24 02:40:32 matt Exp $	*/
      2  1.1  ragge /*
      3  1.1  ragge  * Copyright (c) 1988 Regents of the University of California.
      4  1.1  ragge  * All rights reserved.
      5  1.1  ragge  *
      6  1.1  ragge  * This code is derived from software contributed to Berkeley by
      7  1.1  ragge  * Chris Torek.
      8  1.1  ragge  *
      9  1.1  ragge  * Redistribution and use in source and binary forms, with or without
     10  1.1  ragge  * modification, are permitted provided that the following conditions
     11  1.1  ragge  * are met:
     12  1.1  ragge  * 1. Redistributions of source code must retain the above copyright
     13  1.1  ragge  *    notice, this list of conditions and the following disclaimer.
     14  1.1  ragge  * 2. Redistributions in binary form must reproduce the above copyright
     15  1.1  ragge  *    notice, this list of conditions and the following disclaimer in the
     16  1.1  ragge  *    documentation and/or other materials provided with the distribution.
     17  1.1  ragge  * 3. All advertising materials mentioning features or use of this software
     18  1.1  ragge  *    must display the following acknowledgement:
     19  1.1  ragge  *	This product includes software developed by the University of
     20  1.1  ragge  *	California, Berkeley and its contributors.
     21  1.1  ragge  * 4. Neither the name of the University nor the names of its contributors
     22  1.1  ragge  *    may be used to endorse or promote products derived from this software
     23  1.1  ragge  *    without specific prior written permission.
     24  1.1  ragge  *
     25  1.1  ragge  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     26  1.1  ragge  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     27  1.1  ragge  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     28  1.1  ragge  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     29  1.1  ragge  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     30  1.1  ragge  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     31  1.1  ragge  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     32  1.1  ragge  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     33  1.1  ragge  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     34  1.1  ragge  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     35  1.1  ragge  * SUCH DAMAGE.
     36  1.1  ragge  *
     37  1.1  ragge  *	@(#)ka820.h	7.3 (Berkeley) 6/28/90
     38  1.1  ragge  */
     39  1.1  ragge 
     40  1.1  ragge /*
     41  1.1  ragge  * Definitions specific to the ka820 cpu.
     42  1.1  ragge  */
     43  1.1  ragge 
     44  1.1  ragge /*
     45  1.1  ragge  * Device addresses.
     46  1.1  ragge  */
     47  1.1  ragge #define KA820_PORTADDR		0x20088000	/* port controller */
     48  1.1  ragge #define KA820_BRAMADDR		0x20090000	/* boot ram */
     49  1.1  ragge #define KA820_EEPROMADDR	0x20098000	/* eeprom */
     50  1.1  ragge #define KA820_RX50ADDR		0x200b0000	/* rcx50 */
     51  1.1  ragge #define KA820_CLOCKADDR		0x200b8000	/* watch chip */
     52  1.1  ragge 
     53  1.1  ragge /*
     54  1.1  ragge  * Sizes.  The port controller, RCX50, and watch chip are all one page.
     55  1.1  ragge  */
     56  1.1  ragge #define KA820_BRPAGES		16		/* 8K */
     57  1.1  ragge #define KA820_EEPAGES		64		/* 32K */
     58  1.1  ragge 
     59  1.1  ragge /* port controller CSR bit values */
     60  1.1  ragge #define KA820PORT_RSTHALT	0x80000000	/* restart halt */
     61  1.1  ragge #define KA820PORT_LCONS		0x40000000	/* logical console */
     62  1.1  ragge #define KA820PORT_LCONSEN	0x20000000	/* logical console enable */
     63  1.1  ragge #define KA820PORT_BIRESET	0x10000000	/* BI reset */
     64  1.1  ragge #define KA820PORT_BISTF		0x08000000	/* ??? */
     65  1.1  ragge #define KA820PORT_ENBAPT	0x04000000	/* ??? */
     66  1.1  ragge #define KA820PORT_STPASS	0x02000000	/* self test pass */
     67  1.1  ragge #define KA820PORT_RUN		0x01000000	/* run */
     68  1.1  ragge #define KA820PORT_WWPE		0x00800000	/* ??? parity even? */
     69  1.1  ragge #define KA820PORT_EVLCK		0x00400000	/* event lock */
     70  1.1  ragge #define KA820PORT_WMEM		0x00200000	/* write mem */
     71  1.1  ragge #define KA820PORT_EV4		0x00100000	/* event 4 */
     72  1.1  ragge #define KA820PORT_EV3		0x00080000	/* event 3 */
     73  1.1  ragge #define KA820PORT_EV2		0x00040000	/* event 2 */
     74  1.1  ragge #define KA820PORT_EV1		0x00020000	/* event 1 */
     75  1.1  ragge #define KA820PORT_EV0		0x00010000	/* event 0 */
     76  1.1  ragge #define KA820PORT_WWPO		0x00008000	/* ??? parity odd? */
     77  1.1  ragge #define KA820PORT_PERH		0x00004000	/* parity error H */
     78  1.1  ragge #define KA820PORT_ENBPIPE	0x00002000	/* enable? pipe */
     79  1.1  ragge #define KA820PORT_TIMEOUT	0x00001000	/* timeout */
     80  1.1  ragge #define KA820PORT_RSVD		0x00000800	/* reserved */
     81  1.1  ragge #define KA820PORT_CONSEN	0x00000400	/* console interrupt enable */
     82  1.1  ragge #define KA820PORT_CONSCLR	0x00000200	/* clear console interrupt */
     83  1.1  ragge #define KA820PORT_CONSINTR	0x00000100	/* console interrupt req */
     84  1.1  ragge #define KA820PORT_RXIE		0x00000080	/* RX50 interrupt enable */
     85  1.1  ragge #define KA820PORT_RXCLR		0x00000040	/* clear RX50 interrupt */
     86  1.1  ragge #define KA820PORT_RXIRQ		0x00000020	/* RX50 interrupt request */
     87  1.1  ragge #define KA820PORT_IPCLR		0x00000010	/* clear IP interrupt */
     88  1.1  ragge #define KA820PORT_IPINTR	0x00000008	/* IP interrupt request */
     89  1.1  ragge #define KA820PORT_CRDEN		0x00000004	/* enable CRD interrupts */
     90  1.1  ragge #define KA820PORT_CRDCLR	0x00000002	/* clear CRD interrupt */
     91  1.1  ragge #define KA820PORT_CRDINTR	0x00000001	/* CRD interrupt request */
     92  1.2  ragge 
     93  1.2  ragge /* interrupt vectors unique for this CPU */
     94  1.2  ragge #define	KA820_INT_RXCD		0x58
     95  1.1  ragge 
     96  1.1  ragge /* what the heck */
     97  1.1  ragge #define KA820PORT_BITS \
     98  1.1  ragge "\20\40RSTHALT\37LCONS\36LCONSEN\35BIRESET\34BISTF\33ENBAPT\32STPASS\31RUN\
     99  1.1  ragge \30WWPE\27EVLCK\26WMEM\25EV4\24EV3\23EV2\22EV1\21EV\20WWPO\17PERH\16ENBPIPE\
    100  1.1  ragge \15TIMEOUT\13CONSEN\12CONSCLR\11CONSINTR\10RXIE\7RXCLR\6RXIRQ\5IPCLR\4IPINTR\
    101  1.1  ragge \3CRDEN\2CLRCLR\1CRDINTR"
    102  1.1  ragge 
    103  1.1  ragge /* clock CSR bit values, per csr */
    104  1.1  ragge #define KA820CLK_0_BUSY		0x01		/* busy (time changing) */
    105  1.1  ragge #define KA820CLK_1_GO		0x0c		/* run */
    106  1.1  ragge #define KA820CLK_1_SET		0x0d		/* set the time */
    107  1.1  ragge #define KA820CLK_3_VALID	0x01		/* clock is valid */
    108  1.1  ragge 
    109  1.1  ragge #ifndef LOCORE
    110  1.1  ragge struct ka820port {
    111  1.1  ragge 	u_long	csr;
    112  1.1  ragge 	/* that seems to be all.... */
    113  1.1  ragge };
    114  1.1  ragge 
    115  1.1  ragge struct ka820clock {
    116  1.1  ragge 	u_char	sec;
    117  1.1  ragge 	u_char	pad0;
    118  1.1  ragge 	u_char	secalrm;
    119  1.1  ragge 	u_char	pad1;
    120  1.1  ragge 	u_char	min;
    121  1.1  ragge 	u_char	pad2;
    122  1.1  ragge 	u_char	minalrm;
    123  1.1  ragge 	u_char	pad3;
    124  1.1  ragge 	u_char	hr;
    125  1.1  ragge 	u_char	pad4;
    126  1.1  ragge 	u_char	hralrm;
    127  1.1  ragge 	u_char	pad5;
    128  1.1  ragge 	u_char	dayofwk;
    129  1.1  ragge 	u_char	pad6;
    130  1.1  ragge 	u_char	day;
    131  1.1  ragge 	u_char	pad7;
    132  1.1  ragge 	u_char	mon;
    133  1.1  ragge 	u_char	pad8;
    134  1.1  ragge 	u_char	yr;
    135  1.1  ragge 	u_char	pad9;
    136  1.1  ragge 	u_short csr0;
    137  1.1  ragge 	u_short csr1;
    138  1.1  ragge 	u_short csr2;
    139  1.1  ragge 	u_short csr3;
    140  1.1  ragge };
    141  1.1  ragge 
    142  1.3   matt void	crxintr __P((void *arg));
    143  1.1  ragge #endif
    144