xref: /freebsd/sys/isa/rtc.h (revision 13c0dce6711cf4b55b6732080b00c9d0137dd4f6)
15b81b6b3SRodney W. Grimes /*-
25b81b6b3SRodney W. Grimes  * Copyright (c) 1990 The Regents of the University of California.
35b81b6b3SRodney W. Grimes  * All rights reserved.
45b81b6b3SRodney W. Grimes  *
55b81b6b3SRodney W. Grimes  * This code is derived from software contributed to Berkeley by
65b81b6b3SRodney W. Grimes  * William Jolitz.
75b81b6b3SRodney W. Grimes  *
85b81b6b3SRodney W. Grimes  * Redistribution and use in source and binary forms, with or without
95b81b6b3SRodney W. Grimes  * modification, are permitted provided that the following conditions
105b81b6b3SRodney W. Grimes  * are met:
115b81b6b3SRodney W. Grimes  * 1. Redistributions of source code must retain the above copyright
125b81b6b3SRodney W. Grimes  *    notice, this list of conditions and the following disclaimer.
135b81b6b3SRodney W. Grimes  * 2. Redistributions in binary form must reproduce the above copyright
145b81b6b3SRodney W. Grimes  *    notice, this list of conditions and the following disclaimer in the
155b81b6b3SRodney W. Grimes  *    documentation and/or other materials provided with the distribution.
165b81b6b3SRodney W. Grimes  * 3. All advertising materials mentioning features or use of this software
175b81b6b3SRodney W. Grimes  *    must display the following acknowledgement:
185b81b6b3SRodney W. Grimes  *	This product includes software developed by the University of
195b81b6b3SRodney W. Grimes  *	California, Berkeley and its contributors.
205b81b6b3SRodney W. Grimes  * 4. Neither the name of the University nor the names of its contributors
215b81b6b3SRodney W. Grimes  *    may be used to endorse or promote products derived from this software
225b81b6b3SRodney W. Grimes  *    without specific prior written permission.
235b81b6b3SRodney W. Grimes  *
245b81b6b3SRodney W. Grimes  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
255b81b6b3SRodney W. Grimes  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
265b81b6b3SRodney W. Grimes  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
275b81b6b3SRodney W. Grimes  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
285b81b6b3SRodney W. Grimes  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
295b81b6b3SRodney W. Grimes  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
305b81b6b3SRodney W. Grimes  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
315b81b6b3SRodney W. Grimes  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
325b81b6b3SRodney W. Grimes  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
335b81b6b3SRodney W. Grimes  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
345b81b6b3SRodney W. Grimes  * SUCH DAMAGE.
355b81b6b3SRodney W. Grimes  *
366f78ca60SRodney W. Grimes  *	from: @(#)rtc.h	7.1 (Berkeley) 5/12/91
3713c0dce6SGarrett Wollman  *	$Id: rtc.h,v 1.2 1993/10/16 13:46:16 rgrimes Exp $
385b81b6b3SRodney W. Grimes  */
395b81b6b3SRodney W. Grimes 
4013c0dce6SGarrett Wollman #ifndef _I386_ISA_RTC_H_
4113c0dce6SGarrett Wollman #define _I386_ISA_RTC_H_ 1
4213c0dce6SGarrett Wollman 
435b81b6b3SRodney W. Grimes /*
445b81b6b3SRodney W. Grimes  * RTC Register locations
455b81b6b3SRodney W. Grimes  */
465b81b6b3SRodney W. Grimes 
475b81b6b3SRodney W. Grimes #define RTC_SEC		0x00	/* seconds */
485b81b6b3SRodney W. Grimes #define RTC_SECALRM	0x01	/* seconds alarm */
495b81b6b3SRodney W. Grimes #define RTC_MIN		0x02	/* minutes */
505b81b6b3SRodney W. Grimes #define RTC_MINALRM	0x03	/* minutes alarm */
515b81b6b3SRodney W. Grimes #define RTC_HRS		0x04	/* hours */
525b81b6b3SRodney W. Grimes #define RTC_HRSALRM	0x05	/* hours alarm */
535b81b6b3SRodney W. Grimes #define RTC_WDAY	0x06	/* week day */
545b81b6b3SRodney W. Grimes #define RTC_DAY		0x07	/* day of month */
555b81b6b3SRodney W. Grimes #define RTC_MONTH	0x08	/* month of year */
565b81b6b3SRodney W. Grimes #define RTC_YEAR	0x09	/* month of year */
575b81b6b3SRodney W. Grimes #define RTC_STATUSA	0x0a	/* status register A */
585b81b6b3SRodney W. Grimes #define  RTCSA_TUP	 0x80	/* time update, don't look now */
595b81b6b3SRodney W. Grimes 
605b81b6b3SRodney W. Grimes #define RTC_STATUSB	0x0b	/* status register B */
615b81b6b3SRodney W. Grimes 
625b81b6b3SRodney W. Grimes #define RTC_INTR	0x0c	/* status register C (R) interrupt source */
635b81b6b3SRodney W. Grimes #define  RTCIR_UPDATE	 0x10	/* update intr */
645b81b6b3SRodney W. Grimes #define  RTCIR_ALARM	 0x20	/* alarm intr */
655b81b6b3SRodney W. Grimes #define  RTCIR_PERIOD	 0x40	/* periodic intr */
665b81b6b3SRodney W. Grimes #define  RTCIR_INT	 0x80	/* interrupt output signal */
675b81b6b3SRodney W. Grimes 
685b81b6b3SRodney W. Grimes #define RTC_STATUSD	0x0d	/* status register D (R) Lost Power */
695b81b6b3SRodney W. Grimes #define  RTCSD_PWR	 0x80	/* clock lost power */
705b81b6b3SRodney W. Grimes 
715b81b6b3SRodney W. Grimes #define RTC_DIAG	0x0e	/* status register E - bios diagnostic */
725b81b6b3SRodney W. Grimes #define RTCDG_BITS	"\020\010clock_battery\007ROM_cksum\006config_unit\005memory_size\004fixed_disk\003invalid_time"
735b81b6b3SRodney W. Grimes 
745b81b6b3SRodney W. Grimes #define RTC_RESET	0x0f	/* status register F - reset code byte */
755b81b6b3SRodney W. Grimes #define	 RTCRS_RST	 0x00		/* normal reset */
765b81b6b3SRodney W. Grimes #define	 RTCRS_LOAD	 0x04		/* load system */
775b81b6b3SRodney W. Grimes 
785b81b6b3SRodney W. Grimes #define RTC_FDISKETTE	0x10	/* diskette drive type in upper/lower nibble */
795b81b6b3SRodney W. Grimes #define	 RTCFDT_NONE	 0		/* none present */
805b81b6b3SRodney W. Grimes #define	 RTCFDT_360K	 0x10		/* 360K */
815b81b6b3SRodney W. Grimes #define	 RTCFDT_12M	 0x20		/* 1.2M */
825b81b6b3SRodney W. Grimes #define	 RTCFDT_144M	 0x40		/* 1.44M */
835b81b6b3SRodney W. Grimes 
845b81b6b3SRodney W. Grimes #define RTC_BASELO	0x15	/* low byte of basemem size */
855b81b6b3SRodney W. Grimes #define RTC_BASEHI	0x16	/* high byte of basemem size */
865b81b6b3SRodney W. Grimes #define RTC_EXTLO	0x17	/* low byte of extended mem size */
875b81b6b3SRodney W. Grimes #define RTC_EXTHI	0x18	/* low byte of extended mem size */
885b81b6b3SRodney W. Grimes 
895b81b6b3SRodney W. Grimes #define RTC_CENTURY	0x32	/* current century - please increment in Dec99*/
9013c0dce6SGarrett Wollman #endif /* _I386_ISA_RTC_H_ */
91