Home | History | Annotate | Line # | Download | only in include
uvax.h revision 1.7
      1 /*	$NetBSD: uvax.h,v 1.7 2002/09/28 09:53:07 ragge Exp $ */
      2 /*
      3  * Copyright (c) 2002 Hugh Graham.
      4  * Copyright (c) 1996 Ludd, University of Lule}, Sweden.
      5  * All rights reserved.
      6  *
      7  * This code is derived from software contributed to Ludd by Bertram Barth.
      8  *
      9  * Redistribution and use in source and binary forms, with or without
     10  * modification, are permitted provided that the following conditions
     11  * are met:
     12  * 1. Redistributions of source code must retain the above copyright
     13  *    notice, this list of conditions and the following disclaimer.
     14  * 2. Redistributions in binary form must reproduce the above copyright
     15  *    notice, this list of conditions and the following disclaimer in the
     16  *    documentation and/or other materials provided with the distribution.
     17  * 3. All advertising materials mentioning features or use of this software
     18  *    must display the following acknowledgement:
     19  *	This product includes software developed at Ludd, University of
     20  *	Lule}, Sweden and its contributors.
     21  * 4. The name of the author may not be used to endorse or promote products
     22  *    derived from this software without specific prior written permission
     23  *
     24  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     25  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     26  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     27  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     28  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     29  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     30  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     31  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     32  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     33  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     34  */
     35 
     36 #ifndef _VAX_UVAX_H_
     37 #define _VAX_UVAX_H_
     38 
     39 /*
     40  * Generic definitions common on all MicroVAXen clock chip.
     41  */
     42 #define uVAX_CLKVRT	0200
     43 #define uVAX_CLKUIP	0200
     44 #define uVAX_CLKRATE	040
     45 #define uVAX_CLKENABLE	06
     46 #define uVAX_CLKSET	0206
     47 
     48 /* cpmbx bits  */
     49 #define uVAX_CLKHLTACT	03
     50 
     51 /* halt action values */
     52 #define uVAX_CLKRESTRT	01
     53 #define uVAX_CLKREBOOT	02
     54 #define uVAX_CLKHALT	03
     55 
     56 /* in progress flags */
     57 #define uVAX_CLKBOOT	04
     58 #define uVAX_CLKRSTRT	010
     59 #define uVAX_CLKLANG	0360
     60 
     61 /*
     62  * Miscellaneous registers common on most VAXststions.
     63  */
     64 struct vs_cpu {
     65 	u_long	vc_hltcod;	/* 00 - Halt Code Register */
     66 	u_long	vc_410mser;	/* 04 - VS2K */
     67 	u_long	vc_410cear;	/* 08 - VS2K */
     68 	u_char	vc_intmsk;	/* 0c - Interrupt mask register */
     69 	u_char	vc_vdcorg;	/* 0d - Mono display origin */
     70 	u_char	vc_vdcsel;	/* 0e - Video interrupt select */
     71 	u_char	vc_intreq;	/* 0f - Interrupt request register */
     72 #define vc_intclr vc_intreq
     73 	u_short vc_diagdsp;	/* 10 - Diagnostic display register */
     74 	u_short pad4;		/* 12 */
     75 	u_long	vc_parctl;	/* 14 - Parity Control Register */
     76 #define vc_bwf0 vc_parctl
     77 	u_short pad5;		/* 16 */
     78 	u_short pad6;		/* 18 */
     79 	u_short vc_diagtimu;	/* 1a - usecond timer KA46 */
     80 	u_short vc_diagtme;	/* 1c - Diagnostic time register */
     81 #define vc_diagtimm vc_diagtme	/* msecond time KA46 */
     82 };
     83 #define PARCTL_DMA	0x1000000
     84 #define PARCTL_CPEN	2
     85 #define PARCTL_DPEN	1
     86 
     87 
     88 /*
     89  * Console Mailbox layout common to several models.
     90  */
     91 
     92 struct cpmbx {
     93 	unsigned int mbox_halt:2;	/* mailbox halt action */
     94 	unsigned int mbox_bip:1;	/* bootstrap in progress */
     95 	unsigned int mbox_rip:1;	/* restart in progress */
     96 	unsigned int mbox_lang:4;	/* language info */
     97 	unsigned int terminal:8;	/* terminal info */
     98 	unsigned int keyboard:8;	/* keyboard info */
     99 	unsigned int user_four:4;	/* unknown */
    100 	unsigned int user_halt:3;	/* user halt action */
    101 	unsigned int user_one:1;	/* unknown */
    102 };
    103 
    104 extern struct cpmbx *cpmbx;
    105 
    106 void   generic_halt(void);
    107 void   generic_reboot(int);
    108 
    109 #define	MHALT_RESTART_REBOOT	0
    110 #define	MHALT_RESTART		1
    111 #define	MHALT_REBOOT		2
    112 #define	MHALT_HALT		3
    113 
    114 #define	UHALT_DEFAULT		0
    115 #define	UHALT_RESTART		1
    116 #define	UHALT_REBOOT		2
    117 #define	UHALT_HALT		3
    118 #define	UHALT_RESTART_REBOOT	4
    119 
    120 #endif
    121