xref: /netbsd/sys/arch/sun2/sun2/tod.h (revision bf9ec67e)
1 /*	$NetBSD: tod.h,v 1.2 2001/06/11 21:33:47 fredette Exp $	*/
2 
3 /*
4  * Structures and macros des accessing the National Semiconductor
5  * MM58167 time-of-day chip as wired in the Sun2.  See
6  * http://www.national.com/ds/MM/MM58167B.pdf for data sheets,
7  * and sys/dev/ic/mm58167var.h.
8  */
9 
10 #if __for_reference_only__
11 struct mm58167regs {
12 
13   /* the various timers.  all of these values are in BCD: */
14 
15   /* the most significant digit of this value is the milliseconds
16      unit; least significant digit of this value is undefined: */
17   u_int8_t mm58167_msec_xxx;
18   u_int8_t mm58167_unused0;
19   /* both digits of this value make up centiseconds: */
20   u_int8_t mm58167_csec;
21   u_int8_t mm58167_unused1;
22   u_int8_t mm58167_sec;
23   u_int8_t mm58167_unused2;
24   u_int8_t mm58167_min;
25   u_int8_t mm58167_unused3;
26   u_int8_t mm58167_hour;
27   u_int8_t mm58167_unused4;
28   u_int8_t mm58167_wday;
29   u_int8_t mm58167_unused5;
30   u_int8_t mm58167_day;
31   u_int8_t mm58167_unused6;
32   u_int8_t mm58167_mon;
33   u_int8_t mm58167_unused7;
34 
35   /* the compare latches.  these line up with the timers above, but
36      since we don't use them, we don't go through the trouble of
37      defining real members for them: */
38   struct {
39     u_int8_t _mm58167_latch_val;
40     u_int8_t _mm58167_latch_unused;
41   } _mm58167_latches[8];
42 
43   u_int8_t mm58167_isr;		/* interrupt status - not used */
44   u_int8_t _mm58167_unused8;
45   u_int8_t mm58167_icr;		/* interrupt control - not used */
46   u_int8_t _mm58167_unused9;
47   u_int8_t mm58167_creset;	/* counter reset mask */
48   u_int8_t _mm58167_unused10;
49   u_int8_t mm58167_lreset;	/* latch reset mask */
50   u_int8_t _mm58167_unused11;
51   u_int8_t mm58167_status;	/* bad counter read status */
52   u_int8_t _mm58167_unused12;
53   u_int8_t mm58167_go;		/* GO - start at integral seconds */
54   u_int8_t _mm58167_unused13;
55   u_int8_t mm58167_stby;	/* standby mode - not used */
56   u_int8_t _mm58167_unused14;
57   u_int8_t mm58167_test;	/* test mode - ??? */
58   u_int8_t _mm58167_unused15;
59 };
60 #endif
61 
62 /*
63  * Register offsets.
64  */
65 #define	MM58167REG_MSEC_XXX	0
66 #define	MM58167REG_CSEC		2
67 #define	MM58167REG_SEC		4
68 #define	MM58167REG_MIN		6
69 #define	MM58167REG_HOUR		8
70 #define	MM58167REG_WDAY		10
71 #define	MM58167REG_DAY		12
72 #define	MM58167REG_MON		14
73 #define	MM58167REG_STATUS	40
74 #define	MM58167REG_GO		42
75 #define	MM58167REG_BANK_SZ	48
76