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