1 /******************************************************************************
2 ** File Name: sc8810_reg_global.h *
3 ** Author: Daniel.Ding *
5 ** Copyright: 2005 Spreatrum, Incoporated. All Rights Reserved. *
7 ******************************************************************************/
8 /******************************************************************************
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 /*----------------------------------------------------------------------------*
19 **-------------------------------------------------------------------------- */
21 /**---------------------------------------------------------------------------*
23 **---------------------------------------------------------------------------*/
28 /**----------------------------------------------------------------------------*
30 **----------------------------------------------------------------------------*/
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)
49 #define GR_DPLL_CTL (GREG_BASE + 0x0040)
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)
55 #define GR_NFC_MEM_DLY (GREG_BASE + 0x0058)
56 #define GR_CLK_DLY (GREG_BASE + 0x005C)
57 #define GR_GEN4 (GREG_BASE + 0x0060)
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)
64 #define GR_CLK_GEN5 (GREG_BASE + 0x007C)
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
70 #ifdef CONFIG_SC7710G2
71 #define GR_CLK_GEN7 (GREG_BASE + 0x00B4)
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
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
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
106 #define GEN0_KPD_RTC_EN BIT_26
107 #define GEN0_SYST_RTC_EN BIT_27
108 #define GEN0_TMR_RTC_EN BIT_28
112 the GEN1 register bit
114 #define GEN1_MPLL_MN_EN BIT_9
115 #define GEN1_CLK_AUX0_EN BIT_10
116 #define GEN1_CLK_AUX1_EN BIT_11
118 #define GEN1_RTC_ARCH_EN BIT_18
121 #define MISC0_UART1_MUX_SEL BIT_8
124 the APB Soft Reset register bit
126 #define SWRST_I2C_RST BIT_0
127 #define SWRST_KPD_RST BIT_1
129 #define SWRST_SIM0_RST BIT_5
130 #define SWRST_SIM1_RST BIT_6
132 #define SWRST_TIMER_RST BIT_8
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
140 #define SWRST_IIS_RST BIT_16
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
155 the ARM VB CTRL register bit
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
166 #define ARM_VB_ADCON ARM_VB_AD0ON
170 the Interrupt control register bit
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
177 #define IRQ_VBCAD_IRQ BIT_5
178 #define IRQ_VBCDA_IRQ BIT_6
180 #define IRQ_RFT_INT BIT_12
183 the Interrupt clear register bit
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
190 #define ICLR_VBCAD_IRQ_CLR BIT_5
191 #define ICLR_VBCDA_IRQ_CLR BIT_6
193 #define ICLR_RFT_INT_CLR BIT_12
197 the Clock enable register bit
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
210 #define POWCTL1_CONFIG 0x7FFFF91E // isolation number 1ms:30cycles
213 /**----------------------------------------------------------------------------*
215 **----------------------------------------------------------------------------*/
216 #ifdef CHIP_ENDIAN_LITTLE
217 typedef union _gr_anatst_ctl_tag
219 struct _gr_anatst_ctl_map
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;
248 volatile unsigned int dwValue ;
252 typedef union _gr_nfc_mem_dly_tag
254 struct _gr_nfc_mem_dly_map
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
266 volatile unsigned int dwValue;
269 typedef union _gr_gen1_reg_tag
271 struct _gr_gen1_reg_map
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
298 volatile unsigned int dwValue;
301 typedef union _gr_glb_gen4_reg_tag
303 struct _gr_glb_gen4_reg_map
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;
310 volatile unsigned int dwValue;
313 typedef union _gr_anatst_ctl_tag
315 struct _gr_anatst_ctl_map
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;
344 volatile unsigned int dwValue ;
348 typedef union _gr_nfc_mem_dly_tag
350 struct _gr_nfc_mem_dly_map
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;
362 volatile unsigned int dwValue;
365 typedef union _gr_gen1_reg_tag
367 struct _gr_gen1_reg_map
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;
394 volatile unsigned int dwValue;
397 typedef union _gr_glb_gen4_reg_tag
399 struct _gr_glb_gen4_reg_map
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;
406 volatile unsigned int dwValue;
409 /**----------------------------------------------------------------------------*
410 ** Local Function Prototype **
411 **----------------------------------------------------------------------------*/
413 /**----------------------------------------------------------------------------*
414 ** Function Prototype **
415 **----------------------------------------------------------------------------*/
418 /**----------------------------------------------------------------------------*
420 **----------------------------------------------------------------------------*/
424 /**---------------------------------------------------------------------------*/
425 #endif //_SC8810_REG_GLOBAL_H_