1 /* Constants and bitmasks for DS1287-based DEC 5000/200 clock chip emulation.
2    Copyright 2003 Brian R. Gaeke.
3 
4 This file is part of VMIPS.
5 
6 VMIPS is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 2 of the License, or (at your
9 option) any later version.
10 
11 VMIPS is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 for more details.
15 
16 You should have received a copy of the GNU General Public License along
17 with VMIPS; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
19 
20 #ifndef _DECRTCREG_H_
21 #define _DECRTCREG_H_
22 
23 /* Default physical address for the DEC RTC */
24 #define DECRTC_BASE 0x1fe80000
25 
26 #define RTC_SEC  0  /* Seconds; range 0 .. 59 */
27 #define RTC_ALMS 1  /* Alarm Seconds; range 0 .. 59 */
28 #define RTC_MIN  2  /* Minutes; range 0 .. 59 */
29 #define RTC_ALMM 3  /* Alarm Minutes; range 0 .. 59 */
30 #define RTC_HOUR 4  /* Hours; range 0 .. 23 */
31 #define RTC_ALMH 5  /* Alarm Hours; range 0 .. 23 */
32 #define RTC_DOW  6  /* Day of week; range 1 .. 7 */
33 #define RTC_DAY  7  /* Day of month; range 1 .. 31 */
34 #define RTC_MON  8  /* Month of year; range 1 .. 12 */
35 #define RTC_YEAR 9  /* Year; range 0 .. 99 (not y2k compliant!) */
36 #define RTC_REGA 10 /* Register A */
37 #define RTC_REGB 11 /* Register B */
38 #define RTC_REGC 12 /* Register C */
39 #define RTC_REGD 13 /* Register D */
40 #define RTC_RAM  14 /* Base of battery-backed-up RAM */
41 
42 #define REGA_UIP  0x80  /* Update in Progress */
43 #define REGA_DVX  0x70  /* Timebase Divisor */
44 #define REGA_RSX  0x0f  /* Rate Select */
45 
46 #define REGB_SET  0x80  /* Set Time */
47 #define REGB_PIE  0x40  /* Periodic Interrupt Enable */
48 #define REGB_AIE  0x20  /* Alarm Interrupt Enable */
49 #define REGB_UIE  0x10  /* Update Interrupt Enable */
50 #define REGB_SQWE 0x08  /* Square Wave Enable */
51 #define REGB_DM   0x04  /* Date Mode */
52 #define REGB_2412 0x02  /* Hours Format */
53 #define REGB_DSE  0x01  /* Daylight Savings Enable */
54 
55 #define REGC_IRQF 0x80  /* Interrupt Request */
56 #define REGC_PF   0x40  /* Periodic Interrupt Flag */
57 #define REGC_AF   0x20  /* Alarm Interrupt Flag */
58 #define REGC_UF   0x10  /* Update Interrupt Flag */
59 #define REGC_RAZ  0x0f  /* Not used; read as zero */
60 
61 #define REGD_VRT  0x80  /* Valid RAM/Time */
62 #define REGD_RAZ  0x7f  /* Not used; read as zero */
63 
64 #endif /* _DECRTCREG_H_ */
65