1 /* $NetBSD: eeprom.h,v 1.14 1998/02/05 04:56:51 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 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 /* 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 /* 0x19 */ 85 /* Stored boot device spec. i.e.: "sd(Ctlr,Unit,Part)" */ 86 u_char eeBootDevName[2]; /* xy,xd,sd,ie,le,st,xt,mt,... */ 87 u_char eeBootDevCtlr; 88 u_char eeBootDevUnit; 89 u_char eeBootDevPart; 90 91 /* 0x1E */ 92 u_char eeKeyboardType; /* zero for sun keyboards */ 93 94 /* 0x1F */ 95 u_char eeConsole; /* What to use for the console */ 96 #define EE_CONS_BW 0x00 /* - On-board B&W / keyboard */ 97 #define EE_CONS_TTYA 0x10 /* - serial port A */ 98 #define EE_CONS_TTYB 0x11 /* - serial port B */ 99 #define EE_CONS_COLOR 0x12 /* - Color FB / keyboard */ 100 #define EE_CONS_P4OPT 0x20 /* - Option board on P4 */ 101 102 /* 0x20 */ 103 u_char eeCustomBanner; /* Is there a custom banner: 104 * true: use text at 0x68 105 * false: use Sun banner 106 */ 107 108 u_char eeKeyClick; /* true/false */ 109 110 /* 0x22 */ 111 /* Boot device with "Diag" switch in Diagnostic mode: */ 112 u_char eeDiagDevName[2]; 113 u_char eeDiagDevCtlr; 114 u_char eeDiagDevUnit; 115 u_char eeDiagDevPart; 116 117 /* Video white-on-black (not implemented) */ 118 u_char eeWhiteOnBlack; /* true/false */ 119 120 /* 0x28 */ 121 char eeDiagPath[40]; /* path name of diag program */ 122 123 /* 0x50 */ 124 u_char eeTtyCols; /* normally 80 (0x50) */ 125 u_char eeTtyRows; /* normally 34 (0x22) */ 126 u_char ee_x52[6]; /* unused */ 127 128 /* 0x58 */ 129 /* Default parameters for tty A and tty B: */ 130 struct eeTtyDef { 131 u_char eetBaudSet; /* Is the baud rate set? 132 * true: use values here 133 * false: use default (9600) 134 */ 135 u_char eetBaudHi; /* i.e. 96.. */ 136 u_char eetBaudLo; /* ..00 */ 137 u_char eetNoRtsDtr; /* true: disable H/W flow 138 * false: enable H/W flow */ 139 u_char eet_pad[4]; 140 } eeTtyDefA, eeTtyDefB; 141 142 /* 0x68 */ 143 char eeBannerString[80]; /* see eeCustomBanner above */ 144 145 /* 0xB8 */ 146 u_short eeTestPattern; /* must be 0xAA55 */ 147 u_short ee_xBA; /* unused */ 148 149 /* 0xBC */ 150 /* Configuration data. Hopefully we don't need it. */ 151 struct eeConf { 152 u_char eecData[16]; 153 } eeConf[12+1]; 154 155 /* 0x18c */ 156 u_char eeAltKeyTable; /* What Key table to use: 157 * 0x58: EEPROM tables 158 * else: PROM key tables 159 */ 160 u_char eeKeyboardLocale; /* extended keyboard type */ 161 u_char eeKeyboardID; /* for EEPROM key tables */ 162 u_char eeCustomLogo; /* true: use eeLogoBitmap */ 163 164 /* 0x190 */ 165 u_char eeKeymapLC[0x80]; 166 u_char eeKeymapUC[0x80]; 167 168 /* 0x290 */ 169 u_char eeLogoBitmap[64][8]; /* 64x64 bit custom logo */ 170 171 /* 0x490 */ 172 u_char ee_x490[2]; /* unused */ 173 174 /* 0x492 */ 175 u_char ee_passwd_mode; /* Only (ROM rev > 2.7.0) 176 * 0x5E = fully secure mode 177 * 0x01 = command secure mode 178 * Rest = non-secure mode 179 */ 180 u_char ee_password[8]; 181 u_char ee_x49b[0x500-0x49b]; /* unused */ 182 183 /* 0x500 */ 184 u_char eeReserved[0x100]; 185 186 /* 0x600 */ 187 u_char eeROM_Area[0x100]; 188 189 /* 0x700 */ 190 /* "Unix area" (hah!) */ 191 u_char ee_x700[0xb]; /* unused */ 192 /* 0x70b */ 193 u_char ee_diag_mode; /* 3/80 diag switch: 194 * 0x06 = normal boot 195 * 0x12 = diagnostic mode 196 * Rest = full diagnostic boot 197 */ 198 /* 0x70c */ 199 u_char ee_x70c[0x7d8-0x70c]; /* unused */ 200 201 /* 0x7d8 */ 202 u_char ee_80_IDPROM[32]; /* 3/80 IDPROM */ 203 /* 0x7f8 */ 204 u_char ee_80_CLOCK[8]; /* 3/80 clock */ 205 }; 206 207 #ifdef _KERNEL 208 extern struct eeprom *eeprom_copy; 209 int eeprom_uio __P((struct uio *)); 210 #endif /* _KERNEL */ 211