uvax.h revision 1.1 1 /* $NetBSD: uvax.h,v 1.1 1996/07/20 17:58:24 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 /*
36 * generic(?) MicroVAX and VAXstation support
37 *
38 * There are similarities to struct cpu_calls[] in autoconf.c
39 */
40
41 /*
42 * Prototypes for autoconf.c
43 */
44 struct device;
45 void uvax_conf __P((struct device*, struct device*, void*));
46 int uvax_clock __P((void));
47 void uvax_memerr __P((void));
48 int uvax_mchk __P((caddr_t));
49 void uvax_steal_pages __P((void));
50
51 int uvax_setup __P((int mapen));
52
53 struct uvax_calls {
54 u_long (*uc_phys2virt) __P((u_long)); /* most often used! */
55 u_long (*uc_memsize) __P((void));
56 void (*uc_steal_pages) __P((void));
57 void (*uc_conf) __P((struct device*, struct device*, void*));
58 void (*uc_memerr) __P((void));
59 int (*uc_mchk) __P((caddr_t));
60 int (*uc_clkread) __P((time_t));
61 void (*uc_clkwrite) __P((void));
62
63 char *uc_name;
64 u_char *uc_intreq;
65 u_char *uc_intclr;
66 u_char *uc_intmsk;
67
68 void *le_iomem; /* base addr of RAM -- CPU's view */
69 u_long *le_ioaddr; /* base addr of RAM -- LANCE's view */
70 int *le_memsize; /* size of RAM reserved for LANCE */
71
72 void *uc_physmap;
73 int uc_busTypes;
74 int uc_vups; /* used by delay() */
75
76 int uv_flags;
77 int vs_flags;
78 };
79
80 extern struct uvax_calls guc; /* Generic uVAX Calls */
81 extern struct uvax_calls *ucp;
82
83 struct uc_map {
84 u_long um_base;
85 u_long um_end;
86 u_long um_size;
87 u_long um_virt;
88 };
89 extern struct uc_map *uc_physmap;
90
91 /*
92 * Generic definitions common on all MicroVAXen clock chip.
93 */
94 #define uVAX_CLKVRT 0200
95 #define uVAX_CLKUIP 0200
96 #define uVAX_CLKRATE 040
97 #define uVAX_CLKENABLE 06
98 #define uVAX_CLKSET 0206
99
100 /* cpmbx bits */
101 #define uVAX_CLKHLTACT 03
102
103 /* halt action values */
104 #define uVAX_CLKRESTRT 01
105 #define uVAX_CLKREBOOT 02
106 #define uVAX_CLKHALT 03
107
108 /* in progress flags */
109 #define uVAX_CLKBOOT 04
110 #define uVAX_CLKRSTRT 010
111 #define uVAX_CLKLANG 0360
112
113 /* Prototypes */
114 int uvax_clkread __P((time_t));
115 void uvax_clkwrite __P((void));
116