xref: /titanic_50/usr/src/uts/sun4/sys/eeprom.h (revision 1bdd6c0e3710e91cb1f31aa78de33cb638494480)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 1991-1998 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #ifndef _SYS_EEPROM_H
28 #define	_SYS_EEPROM_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 /*
37  * The EEPROM is part of the Mostek MK48T02 clock chip. The EEPROM
38  * is 2K, but the last 8 bytes are used as the clock, and the 32 bytes
39  * before that emulate the ID prom. There is no
40  * recovery time necessary after writes to the chip.
41  */
42 #ifndef _ASM
43 #include <sys/types.h>
44 struct ee_soft {
45 	ushort_t ees_wrcnt[3];		/* write count (3 copies) */
46 	ushort_t ees_nu1;		/* not used */
47 	uchar_t	ees_chksum[3];		/* software area checksum (3 copies) */
48 	uchar_t	ees_nu2;		/* not used */
49 	uchar_t	ees_resv[0xd8-0xc];	/* XXX - figure this out sometime */
50 };
51 
52 extern caddr_t v_eeprom_addr;
53 #define	EEPROM		((struct eeprom *)v_eeprom_addr)
54 #define	IDPROM_ADDR	(v_eeprom_addr+EEPROM_SIZE) /* virt addr of idprom */
55 #endif /* !_ASM */
56 
57 #define	EEPROM_SIZE	0x1fd8		/* size of eeprom in bytes */
58 
59 /*
60  * ID prom constants. They are included here because the ID prom is
61  * emulated by stealing 20 bytes of the eeprom.
62  */
63 #define	IDPROMSIZE	0x20			/* size of ID prom, in bytes */
64 
65 #ifdef	__cplusplus
66 }
67 #endif
68 
69 #endif	/* _SYS_EEPROM_H */
70