xref: /netbsd-src/sys/arch/vax/include/uvax.h (revision 2a399c6883d870daece976daec6ffa7bb7f934ce)
1 /*	$NetBSD: uvax.h,v 1.2 1997/02/19 10:06:07 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 /*
84  * Generic definitions common on all MicroVAXen clock chip.
85  */
86 #define	uVAX_CLKVRT	0200
87 #define	uVAX_CLKUIP	0200
88 #define	uVAX_CLKRATE	040
89 #define	uVAX_CLKENABLE	06
90 #define	uVAX_CLKSET	0206
91 
92 /* cpmbx bits  */
93 #define	uVAX_CLKHLTACT	03
94 
95 /* halt action values */
96 #define	uVAX_CLKRESTRT	01
97 #define	uVAX_CLKREBOOT	02
98 #define	uVAX_CLKHALT	03
99 
100 /* in progress flags */
101 #define	uVAX_CLKBOOT	04
102 #define	uVAX_CLKRSTRT	010
103 #define	uVAX_CLKLANG	0360
104 
105 /* Prototypes */
106 int	uvax_clkread __P((time_t));
107 void	uvax_clkwrite __P((void));
108 void	uvax_fillmap __P((void));
109 u_long	uvax_phys2virt __P((u_long));
110 #endif
111