eeprom.h revision 1.14 1 1.14 gwr /* $NetBSD: eeprom.h,v 1.14 1998/02/05 04:56:51 gwr Exp $ */
2 1.5 cgd
3 1.10 gwr /*-
4 1.10 gwr * Copyright (c) 1996 The NetBSD Foundation, Inc.
5 1.1 glass * All rights reserved.
6 1.1 glass *
7 1.10 gwr * This code is derived from software contributed to The NetBSD Foundation
8 1.10 gwr * by Gordon W. Ross.
9 1.10 gwr *
10 1.1 glass * Redistribution and use in source and binary forms, with or without
11 1.1 glass * modification, are permitted provided that the following conditions
12 1.1 glass * are met:
13 1.1 glass * 1. Redistributions of source code must retain the above copyright
14 1.1 glass * notice, this list of conditions and the following disclaimer.
15 1.1 glass * 2. Redistributions in binary form must reproduce the above copyright
16 1.1 glass * notice, this list of conditions and the following disclaimer in the
17 1.1 glass * documentation and/or other materials provided with the distribution.
18 1.10 gwr * 3. All advertising materials mentioning features or use of this software
19 1.10 gwr * must display the following acknowledgement:
20 1.10 gwr * This product includes software developed by the NetBSD
21 1.10 gwr * Foundation, Inc. and its contributors.
22 1.10 gwr * 4. Neither the name of The NetBSD Foundation nor the names of its
23 1.10 gwr * contributors may be used to endorse or promote products derived
24 1.10 gwr * from this software without specific prior written permission.
25 1.1 glass *
26 1.10 gwr * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 1.10 gwr * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 1.10 gwr * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 1.12 gwr * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 1.12 gwr * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 1.10 gwr * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 1.10 gwr * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 1.10 gwr * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 1.10 gwr * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 1.10 gwr * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 1.10 gwr * POSSIBILITY OF SUCH DAMAGE.
37 1.1 glass */
38 1.1 glass
39 1.1 glass /*
40 1.1 glass * Structure/definitions for the Sun3 EEPROM.
41 1.1 glass *
42 1.1 glass * This information is published in the Sun document:
43 1.1 glass * "PROM User's Manual", part number 800-1736010.
44 1.1 glass */
45 1.1 glass
46 1.1 glass
47 1.1 glass /*
48 1.1 glass * Note that most places where the PROM stores a "true/false" flag,
49 1.1 glass * the true value is 0x12 and false is the usual zero. Such flags
50 1.1 glass * all take the values EE_TRUE or EE_FALSE so this file does not
51 1.1 glass * need to define so many value macros.
52 1.1 glass */
53 1.1 glass #define EE_TRUE 0x12
54 1.1 glass #define EE_FALSE 0
55 1.1 glass
56 1.1 glass struct eeprom {
57 1.1 glass
58 1.1 glass /* 0x00 */
59 1.1 glass u_char eeTestArea[4]; /* Factory Defined */
60 1.1 glass u_short eeWriteCount[4]; /* || || */
61 1.1 glass u_char eeChecksum[4]; /* || || */
62 1.1 glass time_t eeLastHwUpdate; /* || || */
63 1.1 glass
64 1.1 glass /* 0x14 */
65 1.1 glass u_char eeInstalledMem; /* Megabytes */
66 1.1 glass u_char eeMemTestSize; /* || */
67 1.1 glass
68 1.1 glass /* 0x16 */
69 1.1 glass u_char eeScreenSize;
70 1.1 glass #define EE_SCR_1152X900 0x00
71 1.1 glass #define EE_SCR_1024X1024 0x12
72 1.1 glass #define EE_SCR_1600X1280 0x13
73 1.1 glass #define EE_SCR_1440X1440 0x14
74 1.1 glass
75 1.1 glass u_char eeWatchDogDoesReset; /* Watchdog timeout action:
76 1.1 glass * true: reset/reboot
77 1.1 glass * false: return to monitor
78 1.1 glass */
79 1.1 glass /* 0x18 */
80 1.1 glass u_char eeBootDevStored; /* Is the boot device stored:
81 1.1 glass * true: use stored device spec.
82 1.1 glass * false: use default (try all)
83 1.1 glass */
84 1.14 gwr /* 0x19 */
85 1.1 glass /* Stored boot device spec. i.e.: "sd(Ctlr,Unit,Part)" */
86 1.1 glass u_char eeBootDevName[2]; /* xy,xd,sd,ie,le,st,xt,mt,... */
87 1.1 glass u_char eeBootDevCtlr;
88 1.1 glass u_char eeBootDevUnit;
89 1.1 glass u_char eeBootDevPart;
90 1.1 glass
91 1.1 glass /* 0x1E */
92 1.1 glass u_char eeKeyboardType; /* zero for sun keyboards */
93 1.14 gwr
94 1.14 gwr /* 0x1F */
95 1.1 glass u_char eeConsole; /* What to use for the console */
96 1.1 glass #define EE_CONS_BW 0x00 /* - On-board B&W / keyboard */
97 1.1 glass #define EE_CONS_TTYA 0x10 /* - serial port A */
98 1.1 glass #define EE_CONS_TTYB 0x11 /* - serial port B */
99 1.1 glass #define EE_CONS_COLOR 0x12 /* - Color FB / keyboard */
100 1.3 gwr #define EE_CONS_P4OPT 0x20 /* - Option board on P4 */
101 1.1 glass
102 1.1 glass /* 0x20 */
103 1.1 glass u_char eeCustomBanner; /* Is there a custom banner:
104 1.1 glass * true: use text at 0x68
105 1.1 glass * false: use Sun banner
106 1.1 glass */
107 1.1 glass
108 1.1 glass u_char eeKeyClick; /* true/false */
109 1.1 glass
110 1.14 gwr /* 0x22 */
111 1.1 glass /* Boot device with "Diag" switch in Diagnostic mode: */
112 1.1 glass u_char eeDiagDevName[2];
113 1.1 glass u_char eeDiagDevCtlr;
114 1.1 glass u_char eeDiagDevUnit;
115 1.1 glass u_char eeDiagDevPart;
116 1.1 glass
117 1.1 glass /* Video white-on-black (not implemented) */
118 1.1 glass u_char eeWhiteOnBlack; /* true/false */
119 1.1 glass
120 1.1 glass /* 0x28 */
121 1.1 glass char eeDiagPath[40]; /* path name of diag program */
122 1.1 glass
123 1.1 glass /* 0x50 */
124 1.14 gwr u_char eeTtyCols; /* normally 80 (0x50) */
125 1.14 gwr u_char eeTtyRows; /* normally 34 (0x22) */
126 1.1 glass u_char ee_x52[6]; /* unused */
127 1.1 glass
128 1.1 glass /* 0x58 */
129 1.1 glass /* Default parameters for tty A and tty B: */
130 1.1 glass struct eeTtyDef {
131 1.1 glass u_char eetBaudSet; /* Is the baud rate set?
132 1.1 glass * true: use values here
133 1.1 glass * false: use default (9600)
134 1.1 glass */
135 1.1 glass u_char eetBaudHi; /* i.e. 96.. */
136 1.1 glass u_char eetBaudLo; /* ..00 */
137 1.1 glass u_char eetNoRtsDtr; /* true: disable H/W flow
138 1.1 glass * false: enable H/W flow */
139 1.1 glass u_char eet_pad[4];
140 1.1 glass } eeTtyDefA, eeTtyDefB;
141 1.1 glass
142 1.1 glass /* 0x68 */
143 1.1 glass char eeBannerString[80]; /* see eeCustomBanner above */
144 1.1 glass
145 1.1 glass /* 0xB8 */
146 1.1 glass u_short eeTestPattern; /* must be 0xAA55 */
147 1.1 glass u_short ee_xBA; /* unused */
148 1.1 glass
149 1.1 glass /* 0xBC */
150 1.1 glass /* Configuration data. Hopefully we don't need it. */
151 1.1 glass struct eeConf {
152 1.1 glass u_char eecData[16];
153 1.1 glass } eeConf[12+1];
154 1.1 glass
155 1.1 glass /* 0x18c */
156 1.1 glass u_char eeAltKeyTable; /* What Key table to use:
157 1.1 glass * 0x58: EEPROM tables
158 1.1 glass * else: PROM key tables
159 1.1 glass */
160 1.1 glass u_char eeKeyboardLocale; /* extended keyboard type */
161 1.1 glass u_char eeKeyboardID; /* for EEPROM key tables */
162 1.1 glass u_char eeCustomLogo; /* true: use eeLogoBitmap */
163 1.1 glass
164 1.1 glass /* 0x190 */
165 1.1 glass u_char eeKeymapLC[0x80];
166 1.1 glass u_char eeKeymapUC[0x80];
167 1.1 glass
168 1.1 glass /* 0x290 */
169 1.1 glass u_char eeLogoBitmap[64][8]; /* 64x64 bit custom logo */
170 1.1 glass
171 1.1 glass /* 0x490 */
172 1.14 gwr u_char ee_x490[2]; /* unused */
173 1.14 gwr
174 1.14 gwr /* 0x492 */
175 1.14 gwr u_char ee_passwd_mode; /* Only (ROM rev > 2.7.0)
176 1.14 gwr * 0x5E = fully secure mode
177 1.14 gwr * 0x01 = command secure mode
178 1.14 gwr * Rest = non-secure mode
179 1.14 gwr */
180 1.14 gwr u_char ee_password[8];
181 1.14 gwr u_char ee_x49b[0x500-0x49b]; /* unused */
182 1.1 glass
183 1.1 glass /* 0x500 */
184 1.1 glass u_char eeReserved[0x100];
185 1.14 gwr
186 1.1 glass /* 0x600 */
187 1.1 glass u_char eeROM_Area[0x100];
188 1.14 gwr
189 1.1 glass /* 0x700 */
190 1.14 gwr /* "Unix area" (hah!) */
191 1.14 gwr u_char ee_x700[0xb]; /* unused */
192 1.14 gwr /* 0x70b */
193 1.14 gwr u_char ee_diag_mode; /* 3/80 diag switch:
194 1.14 gwr * 0x06 = normal boot
195 1.14 gwr * 0x12 = diagnostic mode
196 1.14 gwr * Rest = full diagnostic boot
197 1.14 gwr */
198 1.14 gwr /* 0x70c */
199 1.14 gwr u_char ee_x70c[0x7d8-0x70c]; /* unused */
200 1.14 gwr
201 1.14 gwr /* 0x7d8 */
202 1.14 gwr u_char ee_80_IDPROM[32]; /* 3/80 IDPROM */
203 1.14 gwr /* 0x7f8 */
204 1.14 gwr u_char ee_80_CLOCK[8]; /* 3/80 clock */
205 1.1 glass };
206 1.14 gwr
207 1.14 gwr #ifdef _KERNEL
208 1.14 gwr extern struct eeprom *eeprom_copy;
209 1.14 gwr int eeprom_uio __P((struct uio *));
210 1.14 gwr #endif /* _KERNEL */
211