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