Home | History | Annotate | Line # | Download | only in include
uvax.h revision 1.3
      1 /*	$NetBSD: uvax.h,v 1.3 1998/05/22 09:49:08 ragge Exp $ */
      2 /*
      3  * Copyright (c) 1996 Ludd, University of Lule}, Sweden.
      4  * All rights reserved.
      5  *
      6  * This code is derived from software contributed to Ludd by Bertram Barth.
      7  *
      8  * Redistribution and use in source and binary forms, with or without
      9  * modification, are permitted provided that the following conditions
     10  * are met:
     11  * 1. Redistributions of source code must retain the above copyright
     12  *    notice, this list of conditions and the following disclaimer.
     13  * 2. Redistributions in binary form must reproduce the above copyright
     14  *    notice, this list of conditions and the following disclaimer in the
     15  *    documentation and/or other materials provided with the distribution.
     16  * 3. All advertising materials mentioning features or use of this software
     17  *    must display the following acknowledgement:
     18  *      This product includes software developed at Ludd, University of
     19  *      Lule}, Sweden and its contributors.
     20  * 4. The name of the author may not be used to endorse or promote products
     21  *    derived from this software without specific prior written permission
     22  *
     23  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     24  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     25  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     26  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     27  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     28  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     29  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     30  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     31  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     32  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     33  */
     34 
     35 #ifndef _VAX_UVAX_H_
     36 #define _VAX_UVAX_H_
     37 
     38 /*
     39  * generic(?) MicroVAX and VAXstation support
     40  *
     41  * There are similarities to struct cpu_calls[] in autoconf.c
     42  */
     43 
     44 /*
     45  * Prototypes for autoconf.c
     46  */
     47 struct	device;
     48 void	uvax_conf __P((struct device*, struct device*, void*));
     49 int	uvax_clock __P((void));
     50 void	uvax_memerr __P((void));
     51 int	uvax_mchk __P((caddr_t));
     52 void	uvax_steal_pages __P((void));
     53 
     54 int	uvax_setup __P((int mapen));
     55 
     56 struct uvax_calls {
     57 	u_long	(*uc_memsize) __P((void));
     58 
     59 	char	*uc_name;
     60 
     61 	void	*le_iomem;		/* base addr of RAM -- CPU's view */
     62 	u_long	*le_ioaddr;		/* base addr of RAM -- LANCE's view */
     63 	int	*le_memsize;		/* size of RAM reserved for LANCE */
     64 
     65 	void	*uc_physmap;
     66 	int	uc_vups;		/* used by delay() */
     67 
     68 	int	uv_flags;
     69 	int	vs_flags;
     70 };
     71 
     72 extern struct uvax_calls guc;		/* Generic uVAX Calls */
     73 extern struct uvax_calls *ucp;
     74 
     75 struct uc_map {
     76 	u_long	um_base;
     77 	u_long	um_end;
     78 	u_long	um_size;
     79 	u_long	um_virt;
     80 };
     81 extern struct uc_map *uc_physmap;
     82 /*
     83  * Generic definitions common on all MicroVAXen clock chip.
     84  */
     85 #define	uVAX_CLKVRT	0200
     86 #define	uVAX_CLKUIP	0200
     87 #define	uVAX_CLKRATE	040
     88 #define	uVAX_CLKENABLE	06
     89 #define	uVAX_CLKSET	0206
     90 
     91 /* cpmbx bits  */
     92 #define	uVAX_CLKHLTACT	03
     93 
     94 /* halt action values */
     95 #define	uVAX_CLKRESTRT	01
     96 #define	uVAX_CLKREBOOT	02
     97 #define	uVAX_CLKHALT	03
     98 
     99 /* in progress flags */
    100 #define	uVAX_CLKBOOT	04
    101 #define	uVAX_CLKRSTRT	010
    102 #define	uVAX_CLKLANG	0360
    103 
    104 /*
    105  * Miscellaneous registers common on most VAXststions.
    106  */
    107 struct vs_cpu {
    108         u_long  vc_hltcod;      /* Halt Code Register */
    109         u_long  vc_410mser;	/* VS2K */
    110         u_long  vc_410cear;	/* VS2K */
    111 	u_char	vc_intmsk;	/* Interrupt mask register */
    112 	u_char	vc_vdcorg;	/* Mono display origin */
    113 	u_char	vc_vdcsel;	/* Video interrupt select */
    114 	u_char	vc_intreq;	/* Interrupt request register */
    115 #define	vc_intclr vc_intreq
    116         u_short vc_diagdsp;     /* Diagnostic display register */
    117         u_short pad4;
    118         u_long  vc_parctl;      /* Parity Control Register */
    119         u_short pad5;
    120         u_short pad6;
    121         u_short pad7;
    122         u_short vc_diagtme;     /* Diagnostic time register */
    123 };
    124 #define	PARCTL_DMA	0x1000000
    125 #define	PARCTL_CPEN	2
    126 #define	PARCTL_DPEN	1
    127 
    128 /* Prototypes */
    129 int	uvax_clkread __P((time_t));
    130 void	uvax_clkwrite __P((void));
    131 void	uvax_fillmap __P((void));
    132 u_long	uvax_phys2virt __P((u_long));
    133 #endif
    134