• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef __HISOC_TIMER_H__
17 #define __HISOC_TIMER_H__
18 
19 #include "asm/platform.h"
20 #include "los_bitmap.h"
21 
22 #ifdef __cplusplus
23 #if __cplusplus
24 extern "C" {
25 #endif /* __cplusplus */
26 #endif /* __cplusplus */
27 
28 #define TIMER_LOAD              0x0
29 #define TIMER_VALUE             0x4
30 #define TIMER_CONTROL           0x8
31 #define TIMER_INT_CLR           0xc
32 #define TIMER_RIS               0x10
33 #define TIMER_MIS               0x14
34 #define TIMER_BGLOAD            0x18
35 
36 #define TIMER0_ENABLE   BIT(16)
37 #define TIMER1_ENABLE   BIT(17)
38 #define TIMER2_ENABLE   BIT(18)
39 #define TIMER3_ENABLE   BIT(19)
40 #define TIMER4_ENABLE   BIT(20)
41 #define TIMER5_ENABLE   BIT(21)
42 #define TIMER6_ENABLE   BIT(22)
43 #define TIMER7_ENABLE   BIT(23)
44 #define TIMER8_ENABLE   BIT(24)
45 #define TIMER9_ENABLE   BIT(25)
46 #define TIMER10_ENABLE   BIT(26)
47 #define TIMER11_ENABLE   BIT(27)
48 
49 unsigned int arch_timer_rollback(void);
50 VOID LOS_Udelay(UINT32 usecs);
51 VOID LOS_Mdelay(UINT32 msecs);
52 VOID reset_timer_masked(VOID);
53 
54 #ifdef __cplusplus
55 #if __cplusplus
56 }
57 #endif /* __cplusplus */
58 #endif /* __cplusplus */
59 #endif
60 
61