xref: /netbsd/sys/arch/next68k/next68k/nextrom.h (revision c4a72b64)
1 /*	$NetBSD: nextrom.h,v 1.8 2002/09/11 01:46:35 mycroft Exp $	*/
2 /*
3  * Copyright (c) 1998 Darrin B. Jewell
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  * 3. All advertising materials mentioning features or use of this software
15  *    must display the following acknowledgement:
16  *      This product includes software developed by Darrin B. Jewell
17  * 4. The name of the author may not be used to endorse or promote products
18  *    derived from this software without specific prior written permission
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30  */
31 
32 #ifndef NEXTROM_H_INCLUDED
33 #define NEXTROM_H_INCLUDED
34 
35 #define MG_simm 0
36 #define MG_flags 4
37 #define MG_sid 6
38 #define MG_pagesize 10
39 #define MG_mon_stack 14
40 #define MG_vbr 18
41 #define MG_nvram 22
42 #define MG_inetntoa 54
43 #define MG_inputline 72
44 #define MG_region 200
45 #define MG_alloc_base 232
46 #define MG_alloc_brk 236
47 #define MG_boot_dev 240
48 #define MG_boot_arg 244
49 #define MG_boot_info 248
50 #define MG_boot_file 252
51 #define MG_bootfile 256
52 #define MG_boot_how 320
53 #define MG_km 324
54 #define MG_km_flags 368
55 #define MG_mon_init 370
56 #define MG_si 374
57 #define MG_time 378
58 #define MG_sddp 382
59 #define MG_dgp 386
60 #define MG_s5cp 390
61 #define MG_odc 394
62 #define MG_odd 398
63 #define MG_radix 402
64 #define MG_dmachip 404
65 #define MG_diskchip 408
66 #define MG_intrstat 412
67 #define MG_intrmask 416
68 #define MG_nofault 420
69 #define MG_fmt 424
70 #define MG_addr 426
71 #define MG_na 458
72 #define MG_mx 462
73 #define MG_my 466
74 #define MG_cursor_save 470
75 #define MG_getc 726
76 #define MG_try_getc 730
77 #define MG_putc 734
78 #define MG_alert 738
79 #define MG_alert_confirm 742
80 #define MG_alloc 746
81 #define MG_boot_slider 750
82 #define MG_eventc 754
83 #define MG_event_high 758
84 #define MG_animate 762
85 #define MG_anim_time 766
86 #define MG_scsi_intr 770
87 #define MG_scsi_intrarg 774
88 #define MG_minor 778
89 #define MG_seq 780
90 #define MG_anim_run 782
91 #define MG_major 786
92 #define MG_con_slot 844
93 #define MG_con_fbnum 845
94 #define MG_con_map_vaddr0 860
95 #define MG_con_map_vaddr1 872
96 #define MG_con_map_vaddr2 884
97 #define MG_con_map_vaddr3 896
98 #define MG_con_map_vaddr4 908
99 #define MG_con_map_vaddr5 920
100 
101 
102 /*
103  * Darrin B Jewell <jewell@mit.edu>  Mon Jan 19 13:17:20 1998
104  * I made up these:
105  */
106 #define MG_clientetheraddr 788
107 #define MG_machine_type    936
108 #define MG_board_rev       937
109 
110 #if 0
111 
112 /*
113  *  The ROM monitor uses the old structure alignment for backward
114  *  compatibility with previous ROMs.  The old alignment is enabled
115  *  with the following pragma.  The kernel uses the "MG" macro to
116  *  construct an old alignment offset into the mon_global structure.
117  *  The kernel file <mon/assym.h> should be copied from the "assym.h"
118  *  found in the build directory of the current ROM release.
119  *  It will contain the proper old alignment offset constants.
120  */
121 #if	MONITOR
122 #pragma	CC_OLD_STORAGE_LAYOUT_ON
123 #else	MONITOR
124 #import <mon/assym.h>
125 #define	MG(type, off) \
126 	((type) ((u_int) (mg) + off))
127 #endif	/* MONITOR */
128 
129 #import <mon/nvram.h>
130 #import <mon/region.h>
131 #import <mon/tftp.h>
132 #import <mon/sio.h>
133 #import <mon/animate.h>
134 #import <mon/kmreg.h>
135 #import <next/cpu.h>
136 #import <next/machparam.h>
137 
138 #define	LMAX		128
139 #define	NBOOTFILE	64
140 #define	NADDR		8
141 
142 struct mon_global {
143 	char mg_simm[N_SIMM];	/* MUST BE FIRST (accesed early by locore) */
144 	char mg_flags;		/* MUST BE SECOND */
145 #define	MGF_LOGINWINDOW		0x80
146 #define	MGF_UART_SETUP		0x40
147 #define	MGF_UART_STOP		0x20
148 #define	MGF_UART_TYPE_AHEAD	0x10
149 #define	MGF_ANIM_RUN		0x08
150 #define	MGF_SCSI_INTR		0x04
151 #define	MGF_KM_EVENT		0x02
152 #define	MGF_KM_TYPE_AHEAD	0x01
153 	u_int mg_sid, mg_pagesize, mg_mon_stack, mg_vbr;
154 	struct nvram_info mg_nvram;
155 	char mg_inetntoa[18];
156 	char mg_inputline[LMAX];
157 	struct mon_region mg_region[N_SIMM];
158 	caddr_t mg_alloc_base, mg_alloc_brk;
159 	char *mg_boot_dev, *mg_boot_arg, *mg_boot_info, *mg_boot_file;
160 	char mg_bootfile[NBOOTFILE];
161 	enum SIO_ARGS mg_boot_how;
162 	struct km_mon km;
163 	int mon_init;
164 	struct sio *mg_si;
165 	int mg_time;
166 	char *mg_sddp;
167 	char *mg_dgp;
168 	char *mg_s5cp;
169 	char *mg_odc, *mg_odd;
170 	char mg_radix;
171 	int mg_dmachip;
172 	int mg_diskchip;
173 	volatile int *mg_intrstat;
174 	volatile int *mg_intrmask;
175 	void (*mg_nofault)();
176 	char fmt;
177 	int addr[NADDR], na;
178 	int	mx, my;			/* mouse location */
179 	u_int	cursor_save[2][32];
180 	int (*mg_getc)(), (*mg_try_getc)(), (*mg_putc)();
181 	int (*mg_alert)(), (*mg_alert_confirm)();
182 	caddr_t (*mg_alloc)();
183 	int (*mg_boot_slider)();
184 	volatile u_char *eventc_latch;
185 	volatile u_int event_high;
186 	struct animation *mg_animate;
187 	int mg_anim_time;
188 	void (*mg_scsi_intr)();
189 	int mg_scsi_intrarg;
190 	short mg_minor, mg_seq;
191 	int (*mg_anim_run)();
192 	short mg_major;
193 	char *mg_clientetheraddr;
194 	int mg_console_i;
195 	int mg_console_o;
196 #define	CONS_I_KBD	0
197 #define	CONS_I_SCC_A	1
198 #define	CONS_I_SCC_B	2
199 #define	CONS_I_NET	3
200 #define	CONS_O_BITMAP	0
201 #define	CONS_O_SCC_A	1
202 #define	CONS_O_SCC_B	2
203 #define	CONS_O_NET	3
204 	char *test_msg;
205 	/* Next entry should be km_coni. Mach depends on this! */
206 	struct km_console_info km_coni;	/* Console configuration info. See kmreg.h */
207 	char *mg_fdgp;
208 	char mg_machine_type, mg_board_rev;
209 	int (*mg_as_tune)();
210 	int mg_flags2;
211 #define	MGF2_PARITY	0x80000000
212 };
213 
214 struct mon_global *restore_mg();
215 caddr_t mon_alloc();
216 
217 #endif /* if 0 */
218 
219 #define	N_SIMM		4		/* number of SIMMs in machine */
220 
221 /* SIMM types */
222 #define SIMM_SIZE       0x03
223 #define	SIMM_SIZE_EMPTY	0x00
224 #define	SIMM_SIZE_16MB	0x01
225 #define	SIMM_SIZE_4MB	0x02
226 #define	SIMM_SIZE_1MB	0x03
227 #define	SIMM_PAGE_MODE	0x04
228 #define	SIMM_PARITY	0x08 /* ?? */
229 
230 /* Space for onboard RAM
231  */
232 #define	MAX_PHYS_SEGS	N_SIMM+1
233 
234 /* Machine types, used in both assembler and C sources. */
235 #define	NeXT_CUBE	0
236 #define	NeXT_WARP9	1
237 #define	NeXT_X15	2
238 #define	NeXT_WARP9C	3
239 #define NeXT_TURBO_MONO	4
240 #define NeXT_TURBO_COLOR 5			/* probed witnessed */
241 
242 #define	ROM_STACK_SIZE	(8192 - 2048)
243 
244 extern u_char rom_enetaddr[];
245 extern u_char rom_boot_dev[];
246 extern u_char rom_boot_arg[];
247 extern u_char rom_boot_info[];
248 extern u_char rom_boot_file[];
249 extern u_char rom_bootfile[];
250 extern char rom_machine_type;
251 
252 extern u_int  monbootflag;
253 
254 #endif /* NEXTROM_H_INCLUDED */
255