tizen 2.4 release
[profile/mobile/platform/kernel/u-boot-tm1.git] / arch / arm / include / asm / arch-tiger / sc8810_timer_cfg.h
1 /*******************************************************************************
2  ** File Name:      sc8810_timer_cfg.h                                        *
3  ** Author:         ji.ding                                                    *
4  ** Date:           08/20/2010                                                 *
5  ** Copyright:      Copyright 2001-xxxx by Spreadtrum Communications,Inc.      *
6  *                  All Rights Reserved.                                       *
7  **                 This software is supplied under the terms of a license     *
8  **                 agreement or non-disclosure agreement with Spreadtrum.     *
9  **                 Passing on and copying of this document,and communication  *
10  **                 of its contents is not permitted without prior written     *
11  **                 authorization.                                             *
12  ** Description:    This is the header file of defines signals of the sim      *
13  **                 application layer                                          *
14  *******************************************************************************
15
16  *******************************************************************************
17  **                        Edit History                                        *
18  ** ---------------------------------------------------------------------------*
19  ** Date           Name             Description                                *
20  **----------------------------------------------------------------------------*
21  ** 2010.11.1      Ji.Ding          Create                                     *
22  ******************************************************************************/
23
24
25 #ifndef __SC8810_TIMER_CFG_H__
26 #define __SC8810_TIMER_CFG_H__
27
28 /*******************************************************************************
29  **                        Dependencies                                        *
30  ******************************************************************************/
31
32 /*******************************************************************************
33  **                        Compiler Flag                                       *
34  ******************************************************************************/
35
36 #ifdef   __cplusplus
37 extern   "C"
38 {
39 #endif
40
41 /*******************************************************************************
42  **                        Mcaro Definitions                                   *
43  ******************************************************************************/
44 /* this is depend on the SOC timer resource */
45 #define TIMER_PHY_NUMBER 3
46
47 /*******************************************************************************
48  **                        Structures Definitions                              *
49  ******************************************************************************/
50 /* the timer support mode */
51 typedef enum
52 {
53     TIMER_MODE_FREE,
54     TIMER_MODE_PERIOD,
55 }
56 TIMER_PHY_MODE_E;
57
58 /* the desciption of timer phy capability */
59 typedef struct
60 {
61     TIMER_PHY_MODE_E mode; //work mode
62
63     uint32 clk_freq; //frequency of timer
64     uint32 max_count; //max load count
65     uint32 max_us; // max load count transfer to max us
66     uint32 cnt_per_timeunit; // how many count for one time unit
67
68     uint32 current_value; //current count
69     uint32 running_status; //running or stop
70     uint32 irq_status; //irq be enabled or disabled
71 } TIMER_PHY_STATUS_T;
72
73 /*******************************************************************************
74  **                        data prototype                                      *
75  ******************************************************************************/
76
77 /*******************************************************************************
78  **                        Function prototype                                  *
79  ******************************************************************************/
80 /******************************************************************************/
81 //  Description:    get timer number
82 //  Global resource dependence:
83 //  Author:         Ji.Ding
84 //  Note:           
85 //  Return value:   number of phy timer
86 /******************************************************************************/
87 #define TIMER_CFG_get_number() (TIMER_PHY_NUMBER)
88
89 /******************************************************************************/
90 //  Description:    get appointed timer's capability
91 //  Global resource dependence:
92 //  Author:         Ji.Ding
93 //  Note:           
94 //  Return value:   TIMER_PHY_STATUS_T *
95 /******************************************************************************/
96 PUBLIC TIMER_PHY_STATUS_T *TIMER_CFG_get_status (uint32 timer_id);
97
98 /*******************************************************************************
99  **                        Compiler Flag                                       *
100  ******************************************************************************/
101 #ifdef   __cplusplus
102 }
103 #endif
104 /**---------------------------------------------------------------------------*/
105 #endif  //__SC8810_TIMER_CFG_H__
106 // End
107