eeprom.h revision 1.1 1 /* $NetBSD: eeprom.h,v 1.1 2005/06/19 20:23:48 thorpej 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 FOUNDATION OR CONTRIBUTORS
30 * BE 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 #ifndef _DEV_SUN_EEPROM_H_
40 #define _DEV_SUN_EEPROM_H_
41
42 /*
43 * Structure/definitions for the Sun3/Sun4 EEPROM.
44 *
45 * This information is published in the Sun document:
46 * "PROM User's Manual", part number 800-1736010.
47 */
48
49 /*
50 * Note that most places where the PROM stores a "true/false" flag,
51 * the true value is 0x12 and false is the usual zero. Such flags
52 * all take the values EE_TRUE or EE_FALSE so this file does not
53 * need to define so many value macros.
54 */
55 #define EE_TRUE 0x12
56 #define EE_FALSE 0
57
58 struct eeprom {
59
60 /* 0x00 */
61 uint8_t eeTestArea[4]; /* Factory Defined */
62 uint16_t eeWriteCount[4]; /* || || */
63 uint8_t eeChecksum[4]; /* || || */
64 uint32_t eeLastHwUpdate; /* || || */
65
66 /* 0x14 */
67 uint8_t eeInstalledMem; /* Megabytes */
68 uint8_t eeMemTestSize; /* || */
69
70 /* 0x16 */
71 uint8_t eeScreenSize;
72 #define EE_SCR_1152X900 0x00
73 #define EE_SCR_1024X1024 0x12
74 #define EE_SCR_1600X1280 0x13
75 #define EE_SCR_1440X1440 0x14
76
77 uint8_t eeWatchDogDoesReset; /* Watchdog timeout action:
78 * true: reset/reboot
79 * false: return to monitor
80 */
81 /* 0x18 */
82 uint8_t eeBootDevStored; /* Is the boot device stored:
83 * true: use stored device spec.
84 * false: use default (try all)
85 */
86 /* 0x19 */
87 /* Stored boot device spec. i.e.: "sd(Ctlr,Unit,Part)" */
88 uint8_t eeBootDevName[2]; /* xy,xd,sd,ie,le,st,xt,mt,... */
89 uint8_t eeBootDevCtlr;
90 uint8_t eeBootDevUnit;
91 uint8_t eeBootDevPart;
92
93 /* 0x1E */
94 uint8_t eeKeyboardType; /* zero for sun keyboards */
95
96 /* 0x1F */
97 uint8_t eeConsole; /* What to use for the console */
98 #define EE_CONS_BW 0x00 /* - On-board B&W / keyboard */
99 #define EE_CONS_TTYA 0x10 /* - serial port A */
100 #define EE_CONS_TTYB 0x11 /* - serial port B */
101 #define EE_CONS_COLOR 0x12 /* - Color FB / keyboard */
102 #define EE_CONS_P4OPT 0x20 /* - Option board on P4 */
103
104 /* 0x20 */
105 uint8_t eeCustomBanner; /* Is there a custom banner:
106 * true: use text at 0x68
107 * false: use Sun banner
108 */
109
110 uint8_t eeKeyClick; /* true/false */
111
112 /* 0x22 */
113 /* Boot device with "Diag" switch in Diagnostic mode: */
114 uint8_t eeDiagDevName[2];
115 uint8_t eeDiagDevCtlr;
116 uint8_t eeDiagDevUnit;
117 uint8_t eeDiagDevPart;
118
119 /* Video white-on-black (not implemented) */
120 uint8_t eeWhiteOnBlack; /* true/false */
121
122 /* 0x28 */
123 char eeDiagPath[40]; /* path name of diag program */
124
125 /* 0x50 */
126 uint8_t eeTtyCols; /* normally 80 (0x50) */
127 uint8_t eeTtyRows; /* normally 34 (0x22) */
128 uint8_t ee_x52[6]; /* unused */
129
130 /* 0x58 */
131 /* Default parameters for tty A and tty B: */
132 struct eeTtyDef {
133 uint8_t eetBaudSet; /* Is the baud rate set?
134 * true: use values here
135 * false: use default (9600)
136 */
137 uint8_t eetBaudHi; /* i.e. 96.. */
138 uint8_t eetBaudLo; /* ..00 */
139 uint8_t eetNoRtsDtr; /* true: disable H/W flow
140 * false: enable H/W flow */
141 uint8_t eet_pad[4];
142 } eeTtyDefA, eeTtyDefB;
143
144 /* 0x68 */
145 char eeBannerString[80]; /* see eeCustomBanner above */
146
147 /* 0xB8 */
148 uint16_t eeTestPattern; /* must be 0xAA55 */
149 uint16_t ee_xBA; /* unused */
150
151 /* 0xBC */
152 /* Configuration data. Hopefully we don't need it. */
153 struct eeConf {
154 uint8_t eecData[16];
155 } eeConf[12+1];
156
157 /* 0x18c */
158 uint8_t eeAltKeyTable; /* What Key table to use:
159 * 0x58: EEPROM tables
160 * else: PROM key tables
161 */
162 uint8_t eeKeyboardLocale; /* extended keyboard type */
163 uint8_t eeKeyboardID; /* for EEPROM key tables */
164 uint8_t eeCustomLogo; /* true: use eeLogoBitmap */
165
166 /* 0x190 */
167 uint8_t eeKeymapLC[0x80];
168 uint8_t eeKeymapUC[0x80];
169
170 /* 0x290 */
171 uint8_t eeLogoBitmap[64][8]; /* 64x64 bit custom logo */
172
173 /* 0x490 */
174 uint8_t ee_x490[2]; /* unused */
175
176 /* 0x492 */
177 uint8_t ee_passwd_mode; /* Only (ROM rev > 2.7.0)
178 * 0x5E = fully secure mode
179 * 0x01 = command secure mode
180 * Rest = non-secure mode
181 */
182 uint8_t ee_password[8];
183 uint8_t ee_x49b[0x500-0x49b]; /* unused */
184
185 /* 0x500 */
186 uint8_t eeReserved[0x100];
187
188 /* 0x600 */
189 uint8_t eeROM_Area[0x100];
190
191 /* 0x700 */
192 /* "Unix area" (hah!) */
193 uint8_t ee_x700[0xb]; /* unused */
194 /* 0x70b */
195 uint8_t ee_diag_mode; /* 3/80 diag switch:
196 * 0x06 = normal boot
197 * 0x12 = diagnostic mode
198 * Rest = full diagnostic boot
199 */
200 /* 0x70c */
201 uint8_t ee_x70c[0x7d8-0x70c]; /* unused */
202
203 /* 0x7d8 */
204 uint8_t ee_80_IDPROM[32]; /* 3/80 IDPROM */
205 /* 0x7f8 */
206 uint8_t ee_80_CLOCK[8]; /* 3/80 clock */
207 };
208
209 #endif /* _DEV_SUN_EEPROM_H_ */
210