My Project
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
sp804_timer.h
Go to the documentation of this file.
1 /*
2  * OpenVirtualization:
3  * For additional details and support contact developer@sierraware.com.
4  * Additional documentation can be found at www.openvirtualization.org
5  *
6  * Copyright (C) 2010-2014 SierraWare
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21  *
22  */
23 /*
24  * SP804 timer declarations.
25  */
26 
27 #ifndef __SP804_TIMER_H__
28 #define __SP804_TIMER_H__
29 
30 #include <sw_types.h>
31 
32 #define SCCTRL 0x000
33 #define SCCTRL_TIMEREN0SEL_TIMCLK (1 << 15)
34 #define SCCTRL_TIMEREN1SEL_TIMCLK (1 << 17)
35 #define SCCTRL_TIMEREN2SEL_TIMCLK (1 << 19)
36 #define SCCTRL_TIMEREN3SEL_TIMCLK (1 << 21)
37 
38 #define TIMER_LOAD 0x00
39 #define TIMER_VALUE 0x04
40 #define TIMER_CTRL 0x08
41 #define TIMER_CTRL_ONESHOT (1 << 0)
42 #define TIMER_CTRL_32BIT (1 << 1)
43 #define TIMER_CTRL_DIV1 (0 << 2)
44 #define TIMER_CTRL_DIV16 (1 << 2)
45 #define TIMER_CTRL_DIV256 (2 << 2)
46 #define TIMER_CTRL_IE (1 << 5) /* Interrupt Enable (versatile only) */
47 #define TIMER_CTRL_PERIODIC (1 << 6)
48 #define TIMER_CTRL_ENABLE (1 << 7)
49 
50 #define TIMER_INTCLR 0x0c
51 #define TIMER_RIS 0x10
52 #define TIMER_MIS 0x14
53 #define TIMER_BGLOAD 0x18
54 
55 #define TIMER_PERIOD_US 1
56 
57 #endif /* __VE_RS1_TIMER_H__ */
58