tizen 2.4 release
[profile/mobile/platform/kernel/u-boot-tm1.git] / arch / arm / include / asm / arch-tiger / sc8810_int_cfg.h
1 /******************************************************************************
2  ** File Name:    sc8810_int_cfg.h                                            *
3  ** Author:       steve.zhan                                                 *
4  ** DATE:         11/13/2005                                                  *
5  ** Copyright:    2010  Spreatrum, Incoporated. All Rights Reserved.           *
6  ** Description:                                                              *
7  ******************************************************************************/
8 /******************************************************************************
9  **                   Edit    History                                         *
10  **---------------------------------------------------------------------------*
11  ** DATE          NAME            DESCRIPTION                                 *
12  ** 06/05/2010    Steve.zhan      Create.                                     *
13  ******************************************************************************/
14 #ifndef __SC8810_INT_CFG_H__
15 #define __SC8810_INT_CFG_H__
16
17 #include "sci_types.h"
18 /*----------------------------------------------------------------------------*
19  **                         Dependencies                                      *
20  **------------------------------------------------------------------------- */
21 /**---------------------------------------------------------------------------*
22  **                             Compiler Flag                                 *
23  **--------------------------------------------------------------------------*/
24 #ifdef   __cplusplus
25 extern   "C"
26 {
27 #endif
28
29 /**---------------------------------------------------------------------------*
30 **                               Macro Define for int                        **
31 **---------------------------------------------------------------------------*/
32
33 //#define TB_MAX_INT_NUM          0x20 // last int num
34 //#define FIQ_MAX_INT_NUM             0x20
35
36
37 #define TB_UINT                 0x00
38 #define TB_SOFT_INT             0x01
39 #define TB_UART0_INT                0x02
40 #define TB_UART1_INT                0x03
41 #define TB_UART2_INT                0x04
42 #define TB_TIMER0_INT               0x05
43 #define TB_TIMER1_INT               0x06
44 #define TB_TIMER2_INT               0x07
45 #define TB_GPIO_INT             0x08
46 #define TB_SPI_INT              0x09
47 #define TB_KPD_INT              0x0a
48 #define TB_I2C_INT              0x0b
49 #define TB_SIM0_INT             0x0c
50 #define TB_SIM1_INT             0x0c
51 #define TB_CX_SEM_INT               0x0d
52 #define TB_CX_CR_INT                0x0e
53 #define TB_DSP_INT              0x0f
54 #define TB_DSP_INT1             0x10
55 #define TB_SYST_INT             0x11
56 #define TB_EPT_INT              0x12
57 #define TB_IIS_INT                      0x13
58 #define TB_DSP_OR_INT               0x14
59 #define TB_DMA_INT                      0x15
60 #define TB_VBC_INT                      0x16
61 #define TB_VSP_INT                      0x17
62 #define TB_ANA_DIE_INT                  0x18
63 #define TB_ADI_INT                      0x19
64 #define TB_USB_INT                      0x1A
65 #define TB_DCAM_INT                     0x1B
66 #define TB_NLC_INT                      0x1C
67 #define TB_LCDC_INT                     0x1D
68 #define TB_SDIO_INT                     0x1E
69 #define TB_BM_INT                   0x1F
70 #define TB_SDIO1_INT                     0x1F
71
72 #define PCM_IRQ_INT              TB_IIS_INT
73 #define TB_ADC_INT              0x20
74 #define TB_ANA_GPIO_INT         0x21
75 #define TB_RTC_INT              0x22
76 #define TB_WDG_INT              0x23
77 #define TB_TPC_INT              0x24
78
79
80 #define TB_TIMER0               TB_TIMER0_INT
81 #define TB_TIMER1               TB_TIMER1_INT
82 #define TB_TIMER2               TB_TIMER2_INT
83 #define TB_SIM_INT              TB_SIM0_INT
84
85 #define ISR_UNIT_0  0 //root
86 #define ISR_UNIT_1  1
87 #define ISR_UNIT_2  2
88 #define ISR_UNIT_3  3
89
90 typedef void (* CALLBACK_T) (void *);
91
92 typedef struct
93 {
94     uint32 intLogicNum;
95     uint32 IntRegValueIndex;
96     uint32 IntRegBitMask;
97
98     uint32 (*Handlefunc) (uint32);
99     CALLBACK_T callback;
100     uint32 (*isrDefaultFunc) (uint32);
101 } PRI_INDEX_GET_STATUS_T;
102
103 //interrupt module configuration datas.
104 #define ONE_UNIT_MAX_NUMBER (32)
105 #define ISR_UNIT_NUM        (2)
106
107 #define ISR_UNIT_0_NUMBER   (32)
108 #define ISR_UNIT_1_NUMBER   (5)
109 #define ISR_UNIT_2_NUMBER   (0)
110 #define ISR_UNIT_3_NUMBER   (0)
111
112 #define MAX_ISR_NUM (ISR_UNIT_0_NUMBER + ISR_UNIT_1_NUMBER + ISR_UNIT_2_NUMBER + ISR_UNIT_3_NUMBER)
113
114 PUBLIC void INT_HAL_IRQEnable (uint32 logic_num);
115 PUBLIC void INT_HAL_IRQDisable (uint32 logic_num);
116 PUBLIC void INT_HAL_IRQDisableAll(void);
117 PUBLIC uint32 INT_HAL_IRQGetUint1Status(void);
118 PUBLIC void INT_HAL_FIQEnable (uint32 logicNum);
119 PUBLIC void INT_HAL_FIQDisable (uint32 logicNum);
120 PUBLIC void INT_HAL_FIQDisableAll(void);
121 PUBLIC void INT_HAL_DisableINT (void);
122
123 #define _CHIPDRV_EnableIRQINT(int_num) do { \
124         INT_HAL_IRQEnable(int_num); \
125     } while(0)
126
127 #define _CHIPDRV_DisableIRQINT(int_num) do { \
128         INT_HAL_IRQDisable(int_num); \
129     } while(0)
130
131 #define _CHIPDRV_DisableIRQINTALL() do { \
132         INT_HAL_IRQDisableAll(); \
133     } while(0)
134
135 #define _CHIPDRV_GetIRQStatus() INT_HAL_IRQGetUint1Status()
136
137
138 #define _CHIPDRV_EnableFIQINT(int_num) do { \
139         INT_HAL_FIQEnable(int_num); \
140     } while(0)
141
142 #define _CHIPDRV_DisableFIQINT(int_num) do { \
143         INT_HAL_FIQDisable(int_num); \
144     } while(0)
145
146 #define _CHIPDRV_DisableFIQINTALL() do { \
147         INT_HAL_FIQDisableAll(); \
148     } while(0)
149
150 #define _CHIPDRV_DisableINT() do { \
151         INT_HAL_DisableINT(); \
152     } while(0)
153 //end
154
155 extern uint32 MAP_TO_BIT_UNIT[ISR_UNIT_NUM][ONE_UNIT_MAX_NUMBER];
156
157
158 /**----------------------------------------------------------------------------*
159 **                         Local Function Prototype                           **
160 **----------------------------------------------------------------------------*/
161
162 /**----------------------------------------------------------------------------*
163 **                           Function Prototype                                                                               **
164 **----------------------------------------------------------------------------*/
165
166 /*****************************************************************************/
167 //  Description:    This function's source code in interrupt module/v0(x)/,
168 //  for process default  interrupt, this function is related chip type(platform).
169 //  Dependency:
170 //  Author:         Steve.Zhan
171 //  Note:
172 /*****************************************************************************/
173 PUBLIC uint32 INT_PHY_IrqHandleDefaultFunc (uint32 bit);
174
175
176 /*****************************************************************************/
177 //  Description:    This function's source code in interrupt module/v0(x)/,
178 //  for process default  interrupt, this function is related chip type(platform).
179 //  Dependency:
180 //  Author:         Steve.Zhan
181 //  Note:
182 /*****************************************************************************/
183 PUBLIC uint32 INT_PHY_FiqHandleDefaultFunc (uint32 bit);
184
185 /**----------------------------------------------------------------------------*
186 **                         Compiler Flag                                      **
187 **----------------------------------------------------------------------------*/
188 #ifdef   __cplusplus
189 }
190 #endif
191 /**---------------------------------------------------------------------------*/
192 #endif //__SC8800G_INT_CFG_H__
193 // End