xref: /illumos-gate/usr/src/uts/i86pc/sys/cram.h (revision b4203d75)
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 /*	Copyright (c) 1990, 1991 UNIX System Laboratories, Inc.	*/
23 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T	*/
24 /*	  All Rights Reserved	*/
25 
26 #ifndef _SYS_CRAM_H
27 #define	_SYS_CRAM_H
28 
29 #include <sys/types.h>
30 #include <sys/ksynch.h>
31 #include <sys/kmem.h>
32 
33 #ifdef	__cplusplus
34 extern "C" {
35 #endif
36 
37 /*
38  * Defines for accessing the PC AT CMOS ram.
39  */
40 
41 #define	CMOS_ADDR	0x70	/* I/O port address for CMOS ram address */
42 #define	CMOS_DATA	0x71	/* I/O port address for CMOS ram data */
43 
44 #define	DSB		0x0e	/* Diagnostic status byte ram address */
45 #define	SSB		0x0f	/* Shutdown status byte ram address */
46 #define	DDTB		0x10	/* Diskette drive type byte ram address */
47 #define	FDTB		0x12	/* Fixed disk type byte ram address */
48 #define	EB		0x14	/* Equipment byte ram address */
49 #define	BMLOW		0x15	/* Base mem size low byte ram address */
50 #define	BMHIGH		0x16	/* Base mem size high byte ram address */
51 #define	EMLOW		0x17	/* Expansion mem size low byte ram address */
52 #define	EMHIGH		0x18	/* Expansion mem size high byte ram address */
53 #define	DCEB		0x19	/* Drive C Extended byte ram address */
54 #define	DDEB		0x1a	/* Drive D Extended byte ram address */
55 #define	CKSUMLOW	0x2e	/* Checksum low byte ram address */
56 #define	CKSUMHIGH	0x2f	/* Checksum high byte ram address */
57 #define	EMLOW2		0x30	/* Expansion mem size low byte ram address */
58 #define	EMHIGH2		0x31	/* Expansion mem size high byte ram address */
59 #define	DCB		0x32	/* Date century byte ram address */
60 #define	IF		0x33	/* Information flag ram address */
61 
62 /*
63  * ioctls for accessing CMOS ram.
64  */
65 #define	CMOSIOC	('C' << 8)
66 
67 #define	CMOSREAD	(CMOSIOC | 0x01)
68 #define	CMOSWRITE	(CMOSIOC | 0x02)
69 
70 extern unsigned char	CMOSread();
71 
72 /* Ports for interacting with chip at */
73 
74 #define	CMOSADDR	0x70 	/* Use to select RAM address */
75 #define	CMOSDATA	0x71	/* R/W data */
76 
77 /* Number of cmos bytes */
78 
79 #define	CMOSSIZE	0x40	/* 64 addressable bytes in chip */
80 
81 /* Addresses of interest */
82 
83 #define	CMOSDIAG	0x0e	/* Diagnostic Status */
84 #define	CMOSFDT		0x10	/* Floppy Disk Type */
85 #define	CMOSHDT		0x12	/* Hard Disk Type; bits 7-4 are 1st drive */
86 #define	CMOSEQP		0x14	/* Diskette, Video, and CoProcessor info */
87 #define	CMOSADF		0x2d	/* Additional flags - Compaq VDU info */
88 
89 /* Shifts of interest */
90 
91 #define	VID_SHFT	4	/* Shift display type bits into 0-3 */
92 
93 /* masks of interest */
94 #define	CMPQVDU		0x04	/* Compaq VDU bit */
95 #define	CMPQDMM		0x01	/* Compaq Dual Mode Monitor bit */
96 
97 #ifdef	__cplusplus
98 }
99 #endif
100 
101 #endif	/* _SYS_CRAM_H */
102