Home | History | Annotate | Line # | Download | only in include
rtcreg.h revision 1.9.2.1
      1  1.9.2.1    yamt /*	$NetBSD: rtcreg.h,v 1.9.2.1 2006/09/14 12:31:17 yamt Exp $	*/
      2      1.1  itojun 
      3      1.1  itojun /*-
      4      1.1  itojun  * Copyright (C) 1999 SAITOH Masanobu.  All rights reserved.
      5      1.1  itojun  *
      6      1.1  itojun  * Redistribution and use in source and binary forms, with or without
      7      1.1  itojun  * modification, are permitted provided that the following conditions
      8      1.1  itojun  * are met:
      9      1.1  itojun  * 1. Redistributions of source code must retain the above copyright
     10      1.1  itojun  *    notice, this list of conditions and the following disclaimer.
     11      1.1  itojun  * 2. Redistributions in binary form must reproduce the above copyright
     12      1.1  itojun  *    notice, this list of conditions and the following disclaimer in the
     13      1.1  itojun  *    documentation and/or other materials provided with the distribution.
     14      1.1  itojun  * 3. The name of the author may not be used to endorse or promote products
     15      1.1  itojun  *    derived from this software without specific prior written permission.
     16      1.1  itojun  *
     17      1.1  itojun  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     18      1.1  itojun  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     19      1.1  itojun  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     20      1.1  itojun  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     21      1.1  itojun  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     22      1.1  itojun  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     23      1.1  itojun  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     24      1.1  itojun  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     25      1.1  itojun  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     26      1.1  itojun  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     27      1.1  itojun  */
     28      1.1  itojun 
     29      1.7     uch #ifndef _SH3_RTCREG_H_
     30      1.8     uch #define	_SH3_RTCREG_H_
     31      1.6     uch #include <sh3/devreg.h>
     32      1.1  itojun 
     33      1.1  itojun /*
     34      1.5     uch  * RTC
     35      1.1  itojun  */
     36      1.8     uch #define	SH3_R64CNT			0xfffffec0
     37      1.8     uch #define	SH3_RSECCNT			0xfffffec2
     38      1.8     uch #define	SH3_RMINCNT			0xfffffec4
     39      1.8     uch #define	SH3_RHRCNT			0xfffffec6
     40      1.8     uch #define	SH3_RWKCNT			0xfffffec8
     41      1.8     uch #define	SH3_RDAYCNT			0xfffffeca
     42      1.8     uch #define	SH3_RMONCNT			0xfffffecc
     43      1.8     uch #define	SH3_RYRCNT			0xfffffece
     44      1.8     uch #define	SH3_RSECAR			0xfffffed0
     45      1.8     uch #define	SH3_RMINAR			0xfffffed2
     46      1.8     uch #define	SH3_RHRAR			0xfffffed4
     47      1.8     uch #define	SH3_RWKAR			0xfffffed6
     48      1.8     uch #define	SH3_RDAYAR			0xfffffed8
     49      1.8     uch #define	SH3_RMONAR			0xfffffeda
     50      1.8     uch #define	SH3_RCR1			0xfffffedc
     51      1.8     uch #define	SH3_RCR2			0xfffffede
     52      1.5     uch 
     53      1.8     uch #define	SH4_R64CNT			0xffc80000
     54      1.8     uch #define	SH4_RSECCNT			0xffc80004
     55      1.8     uch #define	SH4_RMINCNT			0xffc80008
     56      1.8     uch #define	SH4_RHRCNT			0xffc8000c
     57      1.8     uch #define	SH4_RWKCNT			0xffc80010
     58      1.8     uch #define	SH4_RDAYCNT			0xffc80014
     59      1.8     uch #define	SH4_RMONCNT			0xffc80018
     60      1.8     uch #define	SH4_RYRCNT			0xffc8001c	/* 16 bit */
     61      1.8     uch #define	SH4_RSECAR			0xffc80020
     62      1.8     uch #define	SH4_RMINAR			0xffc80024
     63      1.8     uch #define	SH4_RHRAR			0xffc80028
     64      1.8     uch #define	SH4_RWKAR			0xffc8002c
     65      1.8     uch #define	SH4_RDAYAR			0xffc80030
     66      1.8     uch #define	SH4_RMONAR			0xffc80034
     67      1.8     uch #define	SH4_RCR1			0xffc80038
     68      1.8     uch #define	SH4_RCR2			0xffc8003c
     69      1.5     uch 
     70  1.9.2.1    yamt #define	  SH_RCR1_CF			  0x80 /* carry flag */
     71  1.9.2.1    yamt #define	  SH_RCR1_CIE			  0x10 /* carry interrupt enable */
     72  1.9.2.1    yamt #define	  SH_RCR1_AIE			  0x08 /* alarm interrupt enable */
     73  1.9.2.1    yamt #define	  SH_RCR1_AF			  0x01 /* alarm flag */
     74  1.9.2.1    yamt 
     75  1.9.2.1    yamt #define	  SH_RCR2_PEF			  0x80 /* periodic interrupt flag */
     76  1.9.2.1    yamt #define	  SH_RCR2_PES2			  0x40 /* periodic interrupt freq */
     77  1.9.2.1    yamt #define	  SH_RCR2_PES1			  0x20 /* -//- */
     78  1.9.2.1    yamt #define	  SH_RCR2_PES0			  0x10 /* -//- */
     79      1.8     uch #define	  SH_RCR2_ENABLE		  0x08
     80  1.9.2.1    yamt #define	  SH_RCR2_ADJ			  0x04 /* second adjustment */
     81      1.8     uch #define	  SH_RCR2_RESET			  0x02
     82      1.8     uch #define	  SH_RCR2_START			  0x01
     83      1.6     uch 
     84      1.6     uch #ifndef _LOCORE
     85      1.6     uch #if defined(SH3) && defined(SH4)
     86      1.9     uwe extern uint32_t __sh_R64CNT;
     87      1.9     uwe extern uint32_t __sh_RSECCNT;
     88      1.9     uwe extern uint32_t __sh_RMINCNT;
     89      1.9     uwe extern uint32_t __sh_RHRCNT;
     90      1.9     uwe extern uint32_t __sh_RWKCNT;
     91      1.9     uwe extern uint32_t __sh_RDAYCNT;
     92      1.9     uwe extern uint32_t __sh_RMONCNT;
     93      1.9     uwe extern uint32_t __sh_RYRCNT;
     94      1.9     uwe extern uint32_t __sh_RSECAR;
     95      1.9     uwe extern uint32_t __sh_RMINAR;
     96      1.9     uwe extern uint32_t __sh_RHRAR;
     97      1.9     uwe extern uint32_t __sh_RWKAR;
     98      1.9     uwe extern uint32_t __sh_RDAYAR;
     99      1.9     uwe extern uint32_t __sh_RMONAR;
    100      1.9     uwe extern uint32_t __sh_RCR1;
    101      1.9     uwe extern uint32_t __sh_RCR2;
    102      1.6     uch #endif /* SH3 && SH4 */
    103      1.6     uch #endif /* !_LOCORE */
    104      1.1  itojun 
    105      1.7     uch #endif /* !_SH3_RTCREG_H_ */
    106