xref: /openbsd/sys/arch/sh/include/tmureg.h (revision 95c7671f)
1*95c7671fSmiod /*	$OpenBSD: tmureg.h,v 1.1.1.1 2006/10/06 21:02:55 miod Exp $	*/
2*95c7671fSmiod /*	$NetBSD: tmureg.h,v 1.11 2006/03/04 01:55:03 uwe Exp $	*/
3*95c7671fSmiod 
4*95c7671fSmiod /*-
5*95c7671fSmiod  * Copyright (C) 1999 SAITOH Masanobu.  All rights reserved.
6*95c7671fSmiod  *
7*95c7671fSmiod  * Redistribution and use in source and binary forms, with or without
8*95c7671fSmiod  * modification, are permitted provided that the following conditions
9*95c7671fSmiod  * are met:
10*95c7671fSmiod  * 1. Redistributions of source code must retain the above copyright
11*95c7671fSmiod  *    notice, this list of conditions and the following disclaimer.
12*95c7671fSmiod  * 2. Redistributions in binary form must reproduce the above copyright
13*95c7671fSmiod  *    notice, this list of conditions and the following disclaimer in the
14*95c7671fSmiod  *    documentation and/or other materials provided with the distribution.
15*95c7671fSmiod  * 3. The name of the author may not be used to endorse or promote products
16*95c7671fSmiod  *    derived from this software without specific prior written permission.
17*95c7671fSmiod  *
18*95c7671fSmiod  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19*95c7671fSmiod  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20*95c7671fSmiod  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21*95c7671fSmiod  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22*95c7671fSmiod  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23*95c7671fSmiod  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24*95c7671fSmiod  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25*95c7671fSmiod  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26*95c7671fSmiod  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27*95c7671fSmiod  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28*95c7671fSmiod  */
29*95c7671fSmiod 
30*95c7671fSmiod #ifndef _SH_TMUREG_H_
31*95c7671fSmiod #define	_SH_TMUREG_H_
32*95c7671fSmiod #include <sh/devreg.h>
33*95c7671fSmiod 
34*95c7671fSmiod /*
35*95c7671fSmiod  * TMU
36*95c7671fSmiod  */
37*95c7671fSmiod #define	SH3_TOCR			0xfffffe90
38*95c7671fSmiod #define	SH3_TSTR			0xfffffe92
39*95c7671fSmiod #define	SH3_TCOR0			0xfffffe94
40*95c7671fSmiod #define	SH3_TCNT0			0xfffffe98
41*95c7671fSmiod #define	SH3_TCR0			0xfffffe9c
42*95c7671fSmiod #define	SH3_TCOR1			0xfffffea0
43*95c7671fSmiod #define	SH3_TCNT1			0xfffffea4
44*95c7671fSmiod #define	SH3_TCR1			0xfffffea8
45*95c7671fSmiod #define	SH3_TCOR2			0xfffffeac
46*95c7671fSmiod #define	SH3_TCNT2			0xfffffeb0
47*95c7671fSmiod #define	SH3_TCR2			0xfffffeb4
48*95c7671fSmiod #define	SH3_TCPR2			0xfffffeb8
49*95c7671fSmiod 
50*95c7671fSmiod #define	SH4_TOCR			0xffd80000
51*95c7671fSmiod #define	SH4_TSTR			0xffd80004
52*95c7671fSmiod #define	SH4_TCOR0			0xffd80008
53*95c7671fSmiod #define	SH4_TCNT0			0xffd8000c
54*95c7671fSmiod #define	SH4_TCR0			0xffd80010
55*95c7671fSmiod #define	SH4_TCOR1			0xffd80014
56*95c7671fSmiod #define	SH4_TCNT1			0xffd80018
57*95c7671fSmiod #define	SH4_TCR1			0xffd8001c
58*95c7671fSmiod #define	SH4_TCOR2			0xffd80020
59*95c7671fSmiod #define	SH4_TCNT2			0xffd80024
60*95c7671fSmiod #define	SH4_TCR2			0xffd80028
61*95c7671fSmiod #define	SH4_TCPR2			0xffd8002c
62*95c7671fSmiod #define	SH4_TSTR2			0xfe100004
63*95c7671fSmiod #define	SH4_TCOR3			0xfe100008
64*95c7671fSmiod #define	SH4_TCNT3			0xfe10000c
65*95c7671fSmiod #define	SH4_TCR3			0xfe100010
66*95c7671fSmiod #define	SH4_TCOR4			0xfe100014
67*95c7671fSmiod #define	SH4_TCNT4			0xfe100018
68*95c7671fSmiod #define	SH4_TCR4			0xfe10001c
69*95c7671fSmiod 
70*95c7671fSmiod 
71*95c7671fSmiod #define	TOCR_TCOE			0x01
72*95c7671fSmiod #define	TSTR_STR2			0x04
73*95c7671fSmiod #define	TSTR_STR1			0x02
74*95c7671fSmiod #define	TSTR_STR0			0x01
75*95c7671fSmiod #define	TCR_ICPF			0x0200
76*95c7671fSmiod #define	TCR_UNF				0x0100
77*95c7671fSmiod #define	TCR_ICPE1			0x0080
78*95c7671fSmiod #define	TCR_ICPE0			0x0040
79*95c7671fSmiod #define	TCR_UNIE			0x0020
80*95c7671fSmiod #define	TCR_CKEG1			0x0010
81*95c7671fSmiod #define	TCR_CKEG0			0x0008
82*95c7671fSmiod #define	TCR_TPSC2			0x0004
83*95c7671fSmiod #define	TCR_TPSC1			0x0002
84*95c7671fSmiod #define	TCR_TPSC0			0x0001
85*95c7671fSmiod #define	TCR_TPSC_P4			0x0000
86*95c7671fSmiod #define	TCR_TPSC_P16			0x0001
87*95c7671fSmiod #define	TCR_TPSC_P64			0x0002
88*95c7671fSmiod #define	TCR_TPSC_P256			0x0003
89*95c7671fSmiod #define	SH3_TCR_TPSC_RTC		0x0004
90*95c7671fSmiod #define	SH3_TCR_TPSC_TCLK		0x0005
91*95c7671fSmiod #define	SH4_TCR_TPSC_P1024		0x0004
92*95c7671fSmiod #define	SH4_TCR_TPSC_RTC		0x0006
93*95c7671fSmiod #define	SH4_TCR_TPSC_TCLK		0x0007
94*95c7671fSmiod #define	SH4_TSTR2_STR4			0x02
95*95c7671fSmiod #define	SH4_TSTR2_STR3			0x01
96*95c7671fSmiod 
97*95c7671fSmiod 
98*95c7671fSmiod #ifndef _LOCORE
99*95c7671fSmiod #if defined(SH3) && defined(SH4)
100*95c7671fSmiod extern uint32_t __sh_TOCR;
101*95c7671fSmiod extern uint32_t __sh_TSTR;
102*95c7671fSmiod extern uint32_t __sh_TCOR0;
103*95c7671fSmiod extern uint32_t __sh_TCNT0;
104*95c7671fSmiod extern uint32_t __sh_TCR0;
105*95c7671fSmiod extern uint32_t __sh_TCOR1;
106*95c7671fSmiod extern uint32_t __sh_TCNT1;
107*95c7671fSmiod extern uint32_t __sh_TCR1;
108*95c7671fSmiod extern uint32_t __sh_TCOR2;
109*95c7671fSmiod extern uint32_t __sh_TCNT2;
110*95c7671fSmiod extern uint32_t __sh_TCR2;
111*95c7671fSmiod extern uint32_t __sh_TCPR2;
112*95c7671fSmiod #endif /* SH3 && SH4 */
113*95c7671fSmiod #endif /* !_LOCORE */
114*95c7671fSmiod 
115*95c7671fSmiod #endif	/* !_SH_TMUREG_H_ */
116