xref: /netbsd-src/sys/arch/hpcmips/vr/rtcreg.h (revision a95736d447c025f3478b8a08609e7b35482f65b7)
1*a95736d4Schristos /*	$NetBSD: rtcreg.h,v 1.10 2014/11/17 02:15:48 christos Exp $	*/
2db2b0adeStakemura 
3db2b0adeStakemura /*-
4db2b0adeStakemura  * Copyright (c) 1999 Shin Takemura. All rights reserved.
5e82d2d52Ssato  * Copyright (c) 1999-2001 SATO Kazumi. All rights reserved.
6db2b0adeStakemura  * Copyright (c) 1999 PocketBSD Project. All rights reserved.
7db2b0adeStakemura  *
8db2b0adeStakemura  * Redistribution and use in source and binary forms, with or without
9db2b0adeStakemura  * modification, are permitted provided that the following conditions
10db2b0adeStakemura  * are met:
11db2b0adeStakemura  * 1. Redistributions of source code must retain the above copyright
12db2b0adeStakemura  *    notice, this list of conditions and the following disclaimer.
13db2b0adeStakemura  * 2. Redistributions in binary form must reproduce the above copyright
14db2b0adeStakemura  *    notice, this list of conditions and the following disclaimer in the
15db2b0adeStakemura  *    documentation and/or other materials provided with the distribution.
16db2b0adeStakemura  * 3. All advertising materials mentioning features or use of this software
17db2b0adeStakemura  *    must display the following acknowledgement:
18db2b0adeStakemura  *	This product includes software developed by the PocketBSD project
19db2b0adeStakemura  *	and its contributors.
20db2b0adeStakemura  * 4. Neither the name of the project nor the names of its contributors
21db2b0adeStakemura  *    may be used to endorse or promote products derived from this software
22db2b0adeStakemura  *    without specific prior written permission.
23db2b0adeStakemura  *
24db2b0adeStakemura  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25db2b0adeStakemura  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26db2b0adeStakemura  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27db2b0adeStakemura  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28db2b0adeStakemura  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29db2b0adeStakemura  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30db2b0adeStakemura  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31db2b0adeStakemura  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32db2b0adeStakemura  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33db2b0adeStakemura  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34db2b0adeStakemura  * SUCH DAMAGE.
35db2b0adeStakemura  *
36db2b0adeStakemura  */
37db2b0adeStakemura 
3864ea5228Ssato #define EPOCHOFF	0			/* epoch offset */
393e560d97Sshin #ifndef EPOCHYEAR
4064ea5228Ssato #define EPOCHYEAR	1850	/* XXX */	/* WINCE epoch year */
413e560d97Sshin #endif
4264ea5228Ssato #define EPOCHMONTH	1			/* WINCE epoch month of year */
4364ea5228Ssato #define EPOCHDATE	1			/* WINCE epoch date of month */
4464ea5228Ssato 
45db2b0adeStakemura /*
46db2b0adeStakemura  *	RTC (Real Time Clock Unit) Registers definitions.
47e82d2d52Ssato  *		start 0x0B0000C0 (Vr4102-4121)
48b9049cf9Ssato  *		start 0x0F000100 (Vr4122-4131)
49b9049cf9Ssato  *		start 0x0B0000C0 (Vr4181)
50db2b0adeStakemura  */
51f13492fbSsato #define RTC_NO_REG_W		0xffffffff
52b9049cf9Ssato 
53db2b0adeStakemura #define ETIME_L_REG_W		0x000	/* Elapsed Time L */
54db2b0adeStakemura #define ETIME_M_REG_W		0x002	/* Elapsed Time M */
55db2b0adeStakemura #define ETIME_H_REG_W		0x004	/* Elapsed Time H */
56db2b0adeStakemura 
57db2b0adeStakemura #define		ETIME_L_HZ		0x8000	/* 1 HZ */
58db2b0adeStakemura 
59db2b0adeStakemura 
60db2b0adeStakemura #define ECMP_L_REG_W		0x008	/* Elapsed Compare L */
61db2b0adeStakemura #define ECMP_M_REG_W		0x00a	/* Elapsed Compare M */
62db2b0adeStakemura #define ECMP_H_REG_W		0x00c	/* Elapsed Compare H */
63db2b0adeStakemura 
64db2b0adeStakemura 
65db2b0adeStakemura #define RTCL1_L_REG_W		0x010	/* RTC Long 1 L */
66db2b0adeStakemura #define RTCL1_H_REG_W		0x012	/* RTC Long 1 H */
67db2b0adeStakemura 
68db2b0adeStakemura #define		RTCL1_L_HZ		0x8000	/* 1 HZ */
69db2b0adeStakemura 
70db2b0adeStakemura 
71db2b0adeStakemura #define RTCL1_CNT_L_REG_W	0x014	/* RTC Long 1 Count L */
72db2b0adeStakemura #define RTCL1_CNT_H_REG_W	0x016	/* RTC Long 1 Count H */
73db2b0adeStakemura 
74db2b0adeStakemura 
75db2b0adeStakemura #define RTCL2_L_REG_W		0x018	/* RTC Long 2 L */
76db2b0adeStakemura #define RTCL2_H_REG_W		0x01a	/* RTC Long 2 H */
77db2b0adeStakemura 
78db2b0adeStakemura #define		RTCL2_L_HZ		0x8000	/* 1 HZ */
79db2b0adeStakemura 
80db2b0adeStakemura 
81db2b0adeStakemura #define RTCL2_CNT_L_REG_W	0x01c	/* RTC Long 2 Count L */
82db2b0adeStakemura #define RTCL2_CNT_H_REG_W	0x01e	/* RTC Long 2 Count H */
83db2b0adeStakemura 
84db2b0adeStakemura 
85e82d2d52Ssato #define VR4102_TCLK_L_REG_W	0x100	/* TCLK L */
86e82d2d52Ssato #define VR4102_TCLK_H_REG_W	0x102	/* TCLK H */
87e82d2d52Ssato #define VR4122_TCLK_L_REG_W	0x020	/* TCLK L */
88e82d2d52Ssato #define VR4122_TCLK_H_REG_W	0x022	/* TCLK H */
89b9049cf9Ssato #if defined SINGLE_VRIP_BASE
90e82d2d52Ssato #if defined VRGROUP_4102_4121
91e82d2d52Ssato #define TCLK_L_REG_W		VR4102_TCLK_L_REG_W	/* TCLK L */
92e82d2d52Ssato #define TCLK_H_REG_W		VR4102_TCLK_H_REG_W	/* TCLK H */
93e82d2d52Ssato #endif /* VRGROUP_4102_4121 */
94b9049cf9Ssato #if defined VRGROUP_4122_4131
95e82d2d52Ssato #define TCLK_L_REG_W		VR4122_TCLK_L_REG_W	/* TCLK L */
96e82d2d52Ssato #define TCLK_H_REG_W		VR4122_TCLK_H_REG_W	/* TCLK H */
97b9049cf9Ssato #endif /* VRGROUP_4122_4131 */
98b9049cf9Ssato #if defined VRGROUP_4181
9924db74beSsato #define TCLK_L_REG_W		RTC_NO_REG_W
10024db74beSsato #define TCLK_H_REG_W		RTC_NO_REG_W
101b9049cf9Ssato #endif /* VRGROUP_4181 */
102b9049cf9Ssato #endif /* defined SINGLE_VRIP_BASE */
103db2b0adeStakemura 
104db2b0adeStakemura 
105e82d2d52Ssato #define VR4102_TCLK_CNT_L_REG_W	0x104	/* TCLK Count L */
106e82d2d52Ssato #define VR4102_TCLK_CNT_H_REG_W	0x106	/* TCLK Count H */
107e82d2d52Ssato #define VR4122_TCLK_CNT_L_REG_W	0x024	/* TCLK Count L */
108e82d2d52Ssato #define VR4122_TCLK_CNT_H_REG_W	0x026	/* TCLK Count H */
109b9049cf9Ssato #if defined SINGLE_VRIP_BASE
110e82d2d52Ssato #if defined VRGROUP_4102_4121
111e82d2d52Ssato #define TCLK_CNT_L_REG_W	VR4102_TCLK_CNT_L_REG_W	/* TCLK Count L */
112e82d2d52Ssato #define TCLK_CNT_H_REG_W	VR4102_TCLK_CNT_L_REG_W	/* TCLK Count H */
113e82d2d52Ssato #endif /* VRGROUP_4102_4121 */
114b9049cf9Ssato #if defined VRGROUP_4122_4131
115e82d2d52Ssato #define TCLK_CNT_L_REG_W	VR4122_TCLK_CNT_L_REG_W	/* TCLK Count L */
116e82d2d52Ssato #define TCLK_CNT_H_REG_W	VR4122_TCLK_CNT_H_REG_W	/* TCLK Count H */
117b9049cf9Ssato #endif /* VRGROUP_4122_4131 */
118b9049cf9Ssato #if defined VRGROUP_4181
11924db74beSsato #define TCLK_CNT_L_REG_W	RTC_NO_REG_W
12024db74beSsato #define TCLK_CNT_H_REG_W	RTC_NO_REG_W
121b9049cf9Ssato #endif /* VRGROUP_4181 */
122b9049cf9Ssato #endif /* defined SINGLE_VRIP_BASE */
123db2b0adeStakemura 
124db2b0adeStakemura 
125e82d2d52Ssato #define VR4102_RTCINT_REG_W		0x11e	/* RTC intr reg. */
126e82d2d52Ssato #define VR4122_RTCINT_REG_W		0x03e	/* RTC intr reg. */
127b9049cf9Ssato #define VR4181_RTCINT_REG_W		0x11e	/* RTC intr reg. */
128b9049cf9Ssato #if defined SINGLE_VRIP_BASE
129e82d2d52Ssato #if defined VRGROUP_4102_4121
130e82d2d52Ssato #define RTCINT_REG_W		VR4102_RTCINT_REG_W	/* RTC intr reg. */
131e82d2d52Ssato #endif /* VRGROUP_4102_4121 */
132b9049cf9Ssato #if defined VRGROUP_4122_4131
133e82d2d52Ssato #define RTCINT_REG_W		VR4122_RTCINT_REG_W	/* RTC intr reg. */
134e82d2d52Ssato #endif /* VRGROUP_4122 */
135b9049cf9Ssato #if defined VRGROUP_4181
136b9049cf9Ssato #define RTCINT_REG_W		VR4181_RTCINT_REG_W	/* RTC intr reg. */
137b9049cf9Ssato #endif /* VRGROUP_4181 */
138b9049cf9Ssato #endif /* defined SINGLE_VRIP_BASE */
139db2b0adeStakemura 
140db2b0adeStakemura #define		RTCINT_TCLOCK		(1<<3)	/* TClock */
141db2b0adeStakemura #define		RTCINT_RTCLONG2		(1<<2)	/* RTC Long 2 */
142db2b0adeStakemura #define		RTCINT_RTCLONG1		(1<<1)	/* RTC Long 1 */
143db2b0adeStakemura #define		RTCINT_ELAPSED		(1)	/* Elapsed time */
144db2b0adeStakemura #define		RTCINT_ALL		(RTCINT_TCLOCK|RTCINT_RTCLONG2|RTCINT_RTCLONG1|RTCINT_ELAPSED)
145db2b0adeStakemura 
146db2b0adeStakemura /* END rtcreg.h */
147