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