change source file mode to 0644 instead of 0755
[profile/mobile/platform/kernel/u-boot-tm1.git] / arch / arm / include / asm / arch-sc8810 / sc8810_reg_global.h
1 /******************************************************************************
2  ** File Name:    sc8810_reg_global.h                                        *
3  ** Author:       Daniel.Ding                                                 *
4  ** DATE:         11/13/2005                                                  *
5  ** Copyright:    2005 Spreatrum, Incoporated. All Rights Reserved.           *
6  ** Description:                                                              *
7  ******************************************************************************/
8 /******************************************************************************
9  **                   Edit    History                                         *
10  **---------------------------------------------------------------------------*
11  ** DATE          NAME            DESCRIPTION                                 *
12  ** 11/13/2005    Daniel.Ding     Create.                                     *
13  ** 05/05/2010    Mingwei.Zhang   Modified for SC8800G                        *
14  ******************************************************************************/
15 #ifndef _SC8810_REG_GLOBAL_H_
16 #define _SC8810_REG_GLOBAL_H_
17 /*----------------------------------------------------------------------------*
18  **                         Dependencies                                      *
19  **-------------------------------------------------------------------------- */
20
21 /**---------------------------------------------------------------------------*
22  **                             Compiler Flag                                 *
23  **---------------------------------------------------------------------------*/
24 #ifdef   __cplusplus
25 extern   "C"
26 {
27 #endif
28 /**----------------------------------------------------------------------------*
29 **                               Micro Define                                 **
30 **----------------------------------------------------------------------------*/
31
32
33 /*----------Global Registers----------*/
34 //GREG_BASE     0x8B000000
35 #define GR_GEN0                         (GREG_BASE + 0x0008)
36 #define GR_PCTL                         (GREG_BASE + 0x000C)
37 #define GR_IRQ                          (GREG_BASE + 0x0010)
38 #define GR_ICLR                         (GREG_BASE + 0x0014)
39 #define GR_GEN1                         (GREG_BASE + 0x0018)
40 #define GR_GEN3                         (GREG_BASE + 0x001C)
41 //#define   GR_HWRST                        (GREG_BASE + 0x0020)
42 #define BOOT_FLAG                       (GREG_BASE + 0x0020)   //It's called GR_HWRST in other chip define
43 #define GR_MPLL_MN                      (GREG_BASE + 0x0024)
44 #define GR_PIN_CTL                      (GREG_BASE + 0x0028)
45 #define GR_GEN2                         (GREG_BASE + 0x002C)
46 #define GR_ARM_BOOT_ADDR                (GREG_BASE + 0x0030)
47 #define GR_STC_STATE                    (GREG_BASE + 0x0034)
48 //reserved
49 #define GR_DPLL_CTL                      (GREG_BASE + 0x0040)
50
51 #define GR_BUSCLK                       (GREG_BASE + 0x0044)    ////GR_BUSCLK_ALM
52 #define GR_ARCH_CTL                     (GREG_BASE + 0x0048)
53 #define GR_SOFT_RST                     (GREG_BASE + 0x004C)
54 //reserved
55 #define GR_NFC_MEM_DLY                  (GREG_BASE + 0x0058)
56 #define GR_CLK_DLY                      (GREG_BASE + 0x005C)
57 #define GR_GEN4                         (GREG_BASE + 0x0060)
58 //reserved
59 #define GR_POWCTL0                  (GREG_BASE + 0x0068)
60 #define GR_POWCTL1                  (GREG_BASE + 0x006C)
61 #define GR_PLL_SCR                      (GREG_BASE + 0x0070)
62 #define GR_CLK_EN                       (GREG_BASE + 0x0074)
63 //reserved
64 #define GR_CLK_GEN5                     (GREG_BASE + 0x007C)
65 //reserved
66 #define GR_SWRST                        GR_SOFT_RST             ////mingweiflag GR_SOFT_RST or GR_SWRST?
67 #define GR_BUSCLK_ALM                   GR_BUSCLK
68 #define LDO_USB_PD BIT_9
69
70 #ifdef CONFIG_SC7710G2
71 #define GR_CLK_GEN7                     (GREG_BASE + 0x00B4)
72 #endif
73
74 /*
75   the GEN0 register bit
76 */
77 //reserved
78 #define GEN0_TIMER_EN                   BIT_2
79 #define GEN0_SIM0_EN                    BIT_3
80 #define GEN0_I2C_EN                     BIT_4
81 #define GEN0_GPIO_EN                    BIT_5
82 #define GEN0_ADI_EN                     BIT_6
83 #define GEN0_EFUSE_EN                   BIT_7
84 #define GEN0_KPD_EN                     BIT_8
85 //reserved
86 #define GEN0_MCU_DSP_RST                BIT_10
87 #define GEN0_MCU_SOFT_RST               BIT_11
88 #define GEN0_I2S_EN                     BIT_12
89 #define GEN0_PIN_EN                     BIT_13
90 #define GEN0_CCIR_MCLK_EN               BIT_14
91 #define GEN0_EPT_EN                     BIT_15
92 #define GEN0_SIM1_EN                    BIT_16
93 #define GEN0_SPI_EN                     BIT_17
94 #ifdef CONFIG_SC7710G2
95 #define GEN0_SPI0_EN                    BIT_17
96 #define GEN0_SPI1_EN                    BIT_18
97 #endif
98 //reserved
99 #define GEN0_SYST_EN                    BIT_19
100 #define GEN0_UART0_EN                   BIT_20
101 #define GEN0_UART1_EN                   BIT_21
102 #define GEN0_UART2_EN                   BIT_22
103 #define GEN0_VB_EN                      BIT_23
104 #define GEN0_GPIO_RTC_EN                BIT_24
105 //reserved
106 #define GEN0_KPD_RTC_EN                 BIT_26
107 #define GEN0_SYST_RTC_EN                BIT_27
108 #define GEN0_TMR_RTC_EN                 BIT_28
109 //reserved
110
111 /*
112   the GEN1 register bit
113 */
114 #define GEN1_MPLL_MN_EN                 BIT_9
115 #define GEN1_CLK_AUX0_EN                BIT_10
116 #define GEN1_CLK_AUX1_EN                BIT_11
117 //reserved
118 #define GEN1_RTC_ARCH_EN                BIT_18
119 //reserved
120
121 #define  MISC0_UART1_MUX_SEL         BIT_8
122
123 /*
124   the APB Soft Reset register bit
125 */
126 #define SWRST_I2C_RST                   BIT_0
127 #define SWRST_KPD_RST                   BIT_1
128 //reserved
129 #define SWRST_SIM0_RST                  BIT_5
130 #define SWRST_SIM1_RST                  BIT_6
131 //reserved
132 #define SWRST_TIMER_RST                 BIT_8
133 //reserved
134 #define SWRST_EPT_RST                   BIT_10
135 #define SWRST_UART0_RST                 BIT_11
136 #define SWRST_UART1_RST                 BIT_12
137 #define SWRST_UART2_RST                 BIT_13
138 #define SWRST_SPI_RST                   BIT_14
139 //reserved
140 #define SWRST_IIS_RST                   BIT_16
141 //reserved
142 #define SWRST_SYST_RST                  BIT_19
143 #define SWRST_PINREG_RST                BIT_20
144 #define SWRST_GPIO_RST                  BIT_21
145 #define ADI_SOFT_RST                    BIT_22
146 #define SWRST_VBC_RST                   BIT_23
147 #define SWRST_PWM0_RST                  BIT_24
148 #define SWRST_PWM1_RST                  BIT_25
149 #define SWRST_PWM2_RST                  BIT_26
150 #define SWRST_PWM3_RST                  BIT_27
151 #define SWRST_EFUSE_RST                 BIT_28
152 //reserved
153
154 /*
155   the ARM VB CTRL register bit
156 */
157 #define ARM_VB_IIS_SEL                  BIT_0
158 #define ARM_VB_MCLKON                   BIT_1
159 #define ARM_VB_DA0ON                    BIT_2
160 #define ARM_VB_DA1ON                    BIT_3
161 #define ARM_VB_AD0ON                    BIT_4
162 #define ARM_VB_AD1ON                    BIT_5
163 #define ARM_VB_ANAON                    BIT_6
164 #define ARM_VB_ACC                      BIT_7
165
166 #define ARM_VB_ADCON                    ARM_VB_AD0ON
167 //reserved
168
169 /*
170   the Interrupt control register bit
171 */
172 #define IRQ_MCU_IRQ0                    BIT_0
173 #define IRQ_MCU_FRQ0                    BIT_1
174 #define IRQ_MCU_IRQ1                    BIT_2
175 #define IRQ_MCU_FRQ1                    BIT_3
176 //reserved
177 #define IRQ_VBCAD_IRQ                   BIT_5
178 #define IRQ_VBCDA_IRQ                   BIT_6
179 //reserved
180 #define IRQ_RFT_INT                     BIT_12
181 //reserved
182 /*
183   the Interrupt clear register bit
184 */
185 #define ICLR_DSP_IRQ0_CLR               BIT_0
186 #define ICLR_DSP_FRQ0_CLR               BIT_1
187 #define ICLR_DSP_IRQ1_CLR               BIT_2
188 #define ICLR_DSP_FIQ1_CLR               BIT_3
189 //reserved
190 #define ICLR_VBCAD_IRQ_CLR              BIT_5
191 #define ICLR_VBCDA_IRQ_CLR              BIT_6
192 //reserved
193 #define ICLR_RFT_INT_CLR                BIT_12
194 //reserved
195
196 /*
197   the Clock enable register bit
198 */
199
200 #define CLK_PWM0_EN                     BIT_21
201 #define CLK_PWM1_EN                     BIT_22
202 #define CLK_PWM2_EN                     BIT_23
203 #define CLK_PWM3_EN                     BIT_24
204 #define CLK_PWM0_SEL                        BIT_25
205 #define CLK_PWM1_SEL                        BIT_26
206 #define CLK_PWM2_SEL                        BIT_27
207 #define CLK_PWM3_SEL                        BIT_28
208
209 // POWER CTL1
210 #define POWCTL1_CONFIG                  0x7FFFF91E  // isolation number 1ms:30cycles
211
212
213 /**----------------------------------------------------------------------------*
214 **                             Data Prototype                                 **
215 **----------------------------------------------------------------------------*/
216 #ifdef CHIP_ENDIAN_LITTLE
217 typedef union _gr_anatst_ctl_tag
218 {
219     struct _gr_anatst_ctl_map
220     {
221         volatile unsigned int   start_en1u          :1;
222         volatile unsigned int   start_en1u_rst      :1;
223         volatile unsigned int   start_en2u          :1;
224         volatile unsigned int   start_en2u_rst      :1;
225         volatile unsigned int   start_en3u          :1;
226         volatile unsigned int   start_en3u_rst      :1;
227         volatile unsigned int   start_en6u          :1;
228         volatile unsigned int   start_en6u_rst      :1;
229         volatile unsigned int   Ldo_bpnf            :1;
230         volatile unsigned int   Ldo_bpnf_rst        :1;
231         volatile unsigned int   Ldo_bprf2           :1;
232         volatile unsigned int   Ldo_bprf2_rst       :1;
233         volatile unsigned int   Ldo_bpusb           :2; //USB
234         volatile unsigned int   recharge            :1;
235         volatile unsigned int   standby             :1;
236         volatile unsigned int   Slp_usb_en          :1;
237         volatile unsigned int   Reserved            :1;
238         volatile unsigned int   Ldo_ldo3_b0         :1;
239         volatile unsigned int   Ldo_ldo3_b0_rst     :1;
240         volatile unsigned int   Ldo_ldo3_b1         :1;
241         volatile unsigned int   Ldo_ldo3_b1_rst     :1;
242         volatile unsigned int   Ldo_ldo2_b0         :1;
243         volatile unsigned int   Ldo_ldo2_b0_rst     :1;
244         volatile unsigned int   Adapter_en          :2;
245         volatile unsigned int   Usb_500ma_en        :2;
246         volatile unsigned int   Charger_ctl         :4;
247     } mBits ;
248     volatile unsigned int dwValue ;
249 } GR_ANATST_CTL_U;
250
251
252 typedef union _gr_nfc_mem_dly_tag
253 {
254     struct _gr_nfc_mem_dly_map
255     {
256         volatile unsigned int nefc_cen_dly_sel      :3;
257         volatile unsigned int nfc_cle_dly_sel       :3;
258         volatile unsigned int nfc_ale_dly_sel       :3;
259         volatile unsigned int nfc_wen_dly_sel       :3;
260         volatile unsigned int nfc_ren_dly_sel       :3;
261         volatile unsigned int nfc_wpn_dly_sel       :3;
262         volatile unsigned int nfc_data0_dly_sel     :3;
263         volatile unsigned int nfc_data8_dly_sel     :3;
264         volatile unsigned int reserved              :8;//Reserved
265     } mBits;
266     volatile unsigned int dwValue;
267 } GR_NFC_MEM_DLY_U;
268
269 typedef union _gr_gen1_reg_tag
270 {
271     struct _gr_gen1_reg_map
272     {
273         volatile unsigned int vlk_aux0_div          :7;
274         volatile unsigned int reserved_2            :1;
275         volatile unsigned int gea_eb2               :1;
276         volatile unsigned int m_pllmn_we            :1;
277         volatile unsigned int clk_aux0_en           :1;
278         volatile unsigned int clk_aux1_en           :1;
279         volatile unsigned int testmodep_mcu2        :1;
280         volatile unsigned int syst_en3              :1;
281         volatile unsigned int serclk_eb3            :1;
282         volatile unsigned int clk_26mhz_en          :1;
283         volatile unsigned int clk_aux0_sel          :2;
284         volatile unsigned int clk_aux1_sel          :2;
285         volatile unsigned int v_pllmn_we            :1;
286         volatile unsigned int a_pllmn_we            :1;
287         volatile unsigned int serclk_eb0            :1;
288         volatile unsigned int serclk_eb1            :1;
289         volatile unsigned int serclk_eb2            :1;
290         volatile unsigned int arm_boot_md0          :1;
291         volatile unsigned int arm_boot_md1          :1;
292         volatile unsigned int arm_boot_md2          :1;
293         volatile unsigned int arm_boot_md3          :1;
294         volatile unsigned int arm_boot_md4          :1;
295         volatile unsigned int arm_boot_md5          :1;
296         volatile unsigned int reserved_1            :1;//Reserved
297     } mBits;
298     volatile unsigned int dwValue;
299 } GR_GEN1_REG_U;
300
301 typedef union _gr_glb_gen4_reg_tag
302 {
303     struct _gr_glb_gen4_reg_map
304     {
305         volatile unsigned int clk_lcdc_div          :7;
306         volatile unsigned int reserved_2            :1;
307         volatile unsigned int clk_pll_source_sel    :8;
308         volatile unsigned int reserved_1            :16;
309     } mBits;
310     volatile unsigned int dwValue;
311 } GR_GLB_GEN4_REG_U;
312 #else
313 typedef union _gr_anatst_ctl_tag
314 {
315     struct _gr_anatst_ctl_map
316     {
317         volatile unsigned int   Charger_ctl         :4;
318         volatile unsigned int   Usb_500ma_en        :2;
319         volatile unsigned int   Adapter_en          :2;
320         volatile unsigned int   Ldo_ldo2_b0_rst     :1;
321         volatile unsigned int   Ldo_ldo2_b0         :1;
322         volatile unsigned int   Ldo_ldo3_b1_rst     :1;
323         volatile unsigned int   Ldo_ldo3_b1         :1;
324         volatile unsigned int   Ldo_ldo3_b0_rst     :1;
325         volatile unsigned int   Ldo_ldo3_b0         :1;
326         volatile unsigned int   Reserved            :1;
327         volatile unsigned int   Slp_usb_en          :1;
328         volatile unsigned int   standby             :1;
329         volatile unsigned int   recharge            :1;
330         volatile unsigned int   Ldo_bpusb           :2; //USB
331         volatile unsigned int   Ldo_bprf2_rst       :1;
332         volatile unsigned int   Ldo_bprf2           :1;
333         volatile unsigned int   Ldo_bpnf_rst        :1;
334         volatile unsigned int   Ldo_bpnf            :1;
335         volatile unsigned int   start_en6u_rst      :1;
336         volatile unsigned int   start_en6u          :1;
337         volatile unsigned int   start_en3u_rst      :1;
338         volatile unsigned int   start_en3u          :1;
339         volatile unsigned int   start_en2u_rst      :1;
340         volatile unsigned int   start_en2u          :1;
341         volatile unsigned int   start_en1u_rst      :1;
342         volatile unsigned int   start_en1u          :1;
343     } mBits ;
344     volatile unsigned int dwValue ;
345 } GR_ANATST_CTL_U;
346
347
348 typedef union _gr_nfc_mem_dly_tag
349 {
350     struct _gr_nfc_mem_dly_map
351     {
352         volatile unsigned int reserved              :8;//Reserved
353         volatile unsigned int nfc_data8_dly_sel     :3;
354         volatile unsigned int nfc_data0_dly_sel     :3;
355         volatile unsigned int nfc_wpn_dly_sel       :3;
356         volatile unsigned int nfc_ren_dly_sel       :3;
357         volatile unsigned int nfc_wen_dly_sel       :3;
358         volatile unsigned int nfc_ale_dly_sel       :3;
359         volatile unsigned int nfc_cle_dly_sel       :3;
360         volatile unsigned int nefc_cen_dly_sel      :3;
361     } mBits;
362     volatile unsigned int dwValue;
363 } GR_NFC_MEM_DLY_U;
364
365 typedef union _gr_gen1_reg_tag
366 {
367     struct _gr_gen1_reg_map
368     {
369         volatile unsigned int reserved_1            :1;//Reserved
370         volatile unsigned int arm_boot_md5          :1;
371         volatile unsigned int arm_boot_md4          :1;
372         volatile unsigned int arm_boot_md3          :1;
373         volatile unsigned int arm_boot_md2          :1;
374         volatile unsigned int arm_boot_md1          :1;
375         volatile unsigned int arm_boot_md0          :1;
376         volatile unsigned int serclk_eb2            :1;
377         volatile unsigned int serclk_eb1            :1;
378         volatile unsigned int serclk_eb0            :1;
379         volatile unsigned int a_pllmn_we            :1;
380         volatile unsigned int v_pllmn_we            :1;
381         volatile unsigned int clk_aux1_sel          :2;
382         volatile unsigned int clk_aux0_sel          :2;
383         volatile unsigned int clk_26mhz_en          :1;
384         volatile unsigned int serclk_eb3            :1;
385         volatile unsigned int syst_en3              :1;
386         volatile unsigned int testmodep_mcu2        :1;
387         volatile unsigned int clk_aux1_en           :1;
388         volatile unsigned int clk_aux0_en           :1;
389         volatile unsigned int m_pllmn_we            :1;
390         volatile unsigned int gea_eb2               :1;
391         volatile unsigned int reserved_2            :1;
392         volatile unsigned int vlk_aux0_div          :7;
393     } mBits;
394     volatile unsigned int dwValue;
395 } GR_GEN1_REG_U;
396
397 typedef union _gr_glb_gen4_reg_tag
398 {
399     struct _gr_glb_gen4_reg_map
400     {
401         volatile unsigned int reserved_1            :16;
402         volatile unsigned int clk_pll_source_sel    :8;
403         volatile unsigned int reserved_2            :1;
404         volatile unsigned int clk_lcdc_div          :7;
405     } mBits;
406     volatile unsigned int dwValue;
407 } GR_GLB_GEN4_REG_U;
408 #endif
409 /**----------------------------------------------------------------------------*
410 **                         Local Function Prototype                           **
411 **----------------------------------------------------------------------------*/
412
413 /**----------------------------------------------------------------------------*
414 **                           Function Prototype                               **
415 **----------------------------------------------------------------------------*/
416
417
418 /**----------------------------------------------------------------------------*
419 **                         Compiler Flag                                      **
420 **----------------------------------------------------------------------------*/
421 #ifdef   __cplusplus
422 }
423 #endif
424 /**---------------------------------------------------------------------------*/
425 #endif //_SC8810_REG_GLOBAL_H_
426 // End
427
428