change source file mode to 0644 instead of 0755
[profile/mobile/platform/kernel/u-boot-tm1.git] / arch / arm / include / asm / arch-sc8825 / sc8810_reg_ahb.h
1 /******************************************************************************
2  ** File Name:    sc8810_reg_ahb.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/07/2010    Mingwei.zhang   Modify it for SC8800G.                      *
14  ******************************************************************************/
15 #ifndef _SC8810_REG_AHB_H_
16 #define _SC8810_REG_AHB_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 #define AHB_REG_BASE            0x20900200
32 #define CHIP_TYPE               0x209003FC
33
34 #define AHB_CTL0                (AHB_REG_BASE + 0x00)
35 #define AHB_CTL1                (AHB_REG_BASE + 0x04)
36 #define AHB_CTL2                (AHB_REG_BASE + 0x08)
37 #define AHB_CTL3                (AHB_REG_BASE + 0x0C)
38 #define AHB_SOFT_RST            (AHB_REG_BASE + 0x10)
39 #define AHB_PAUSE               (AHB_REG_BASE + 0x14)
40 #define AHB_REMAP               (AHB_REG_BASE + 0x18)
41 #define AHB_DISPC_CLK       (AHB_REG_BASE + 0x20)
42 #define AHB_ARM_CLK             (AHB_REG_BASE + 0x24)
43 #define AHB_SDIO_CTL            (AHB_REG_BASE + 0x28)
44 #define AHB_CTL4                (AHB_REG_BASE + 0x2C)
45 #define AHB_ENDIAN_SEL          (AHB_REG_BASE + 0x30)
46 #define AHB_STS                 (AHB_REG_BASE + 0x34)
47 #define AHB_CA5_CFG             (AHB_REG_BASE + 0x38)
48 #define DSP_BOOT_EN             (AHB_REG_BASE + 0x84)
49 #define DSP_BOOT_VEC            (AHB_REG_BASE + 0x88)
50 #define DSP_RST                 (AHB_REG_BASE + 0x8C)
51 #define AHB_ENDIAN_EN           (AHB_REG_BASE + 0x90)
52 #define USB_PHY_CTRL            (AHB_REG_BASE + 0xA0)
53
54 #define CHIP_ID                 (AHB_REG_BASE + 0x1FC)
55
56 #define AHB_DSP_BOOT_EN             (AHB_REG_BASE + 0x84)
57 #define AHB_DSP_BOOT_VECTOR         (AHB_REG_BASE + 0x88)
58 #define AHB_DSP_RESET               (AHB_REG_BASE + 0x8C)
59 #define AHB_BIGEND_PROT_REG    (AHB_REG_BASE + 0x90)
60
61 #define AHB_CTL0_DCAM_EN   BIT_1
62 #define AHB_CTL0_CCIR_EN    BIT_2
63 #define AHB_CTL0_LCDC_EN    BIT_3
64 #define AHB_CTL0_SDIO_EN    BIT_4
65 #define AHB_CTL0_USBD_EN    BIT_5
66 #define AHB_CTL0_DMA_EN     BIT_6
67 #define AHB_CTL0_BM0_EN     (BIT_7)
68 #define AHB_CTL0_NFC_EN      BIT_8
69 #define AHB_CTL0_BM1_EN     (BIT_11)
70 #define AHB_CTL0_VSP_EN      BIT_13
71 #define AHB_CTL0_ROT_EN      BIT_14
72 #define AHB_CTL0_DRM_EN     BIT_18
73 #define AHB_CTL0_AHB_ARCH_EB   BIT_15
74 #define AHB_CTL0_EMC_EN   BIT_28
75
76 #define AHB_BIGENDIAN_DMA           BIT_0
77 #define AHB_BIGENDIAN_NFC                                               BIT_1
78 #define AHB_BIGENDIAN_LCDC                                      BIT_2
79 #define AHB_BIGENDIAN_SDIO                                      BIT_3
80 #define AHB_BIGENDIAN_DCAM                                      BIT_4
81 #define AHB_BIGENDIAN_VSP                                               BIT_5
82 #define AHB_BIGENDIAN_ROT                                               BIT_6
83 #define AHB_BIGENDIAN_BM0                                               BIT_7
84 #define AHB_BIGENDIAN_BM1                                               BIT_8
85 #define AHB_BIGENDIAN_SHARM                                     BIT_9
86
87 #define AHB_ENDIAN_OPEN             0xC3D4
88 // Bit define AHB_CTRL1
89 #define AHB_CTRL1_EMC_AUTO_GATE_EN BIT_8
90 #define AHB_CTRL1_EMC_CH_AUTO_GATE_EN  BIT_9
91 #define AHB_CTRL1_ARM_AUTO_GATE_EN  BIT_11
92 #define AHB_CTRL1_AHB_AUTO_GATE_EN  BIT_12
93 #define AHB_CTRL1_MCU_AUTO_GATE_EN  BIT_13
94 #define AHB_CTRL1_MSTMTX_AUTO_GATE_EN  BIT_14
95 #define AHB_CTRL1_ARMMTX_AUTO_GATE_EN  BIT_15
96 #define AHB_CTRL1_ARM_DAHB_SLEEP_EN  BIT_16
97
98 ///USB_PHY_CTRL
99 #define USB_DM_PULLUP_BIT       BIT_19
100 #define USB_DP_PULLDOWN_BIT     BIT_20
101 #define USB_DM_PULLDOWN_BIT     BIT_21
102
103 #define AHB_SDIO_SOFT_RST BIT_12
104
105 #define AHB_SDIO_CTRL_SLOT0 0
106 #define AHB_SDIO_CTRL_SLOT1 1
107 #define AHB_SDIO_CTRL_SLAVE 2
108
109
110 /**----------------------------------------------------------------------------*
111 **                             Data Prototype                                 **
112 **----------------------------------------------------------------------------*/
113 #ifdef CHIP_ENDIAN_LITTLE
114 typedef union _ahb_ctl0_reg_tag
115 {
116     struct _ahb_ctl0_reg_map
117     {
118         volatile unsigned int    reserved               :1; ////apb_eb            :1;
119         volatile unsigned int    dcam_eb                :1; //BIT_1
120         volatile unsigned int    ccir_eb                :1; //BIT_2
121         volatile unsigned int    lcdc_eb                :1; //BIT_3
122         volatile unsigned int    sdio_eb                :1; //BIT_4
123         volatile unsigned int    usbd_eb                :1; //BIT_5
124         volatile unsigned int    dma_eb                 :1; //BIT_6
125         volatile unsigned int    bm0_eb                 :1; //BIT_7
126         volatile unsigned int    nfc_eb                 :1; //BIT_8
127         volatile unsigned int    reserved0              :2; //BIT_9-10
128         volatile unsigned int    bm1_eb                 :1; //BIT_11
129         volatile unsigned int    reserved1              :1; //BIT_12
130         volatile unsigned int    vsp_eb                 :1; //BIT_13
131         volatile unsigned int    rot_eb                 :1; //BIT_14
132         volatile unsigned int    reserved2              :3; //BIT_15-17
133         volatile unsigned int    drm_eb                 :1; //BIT_18
134         volatile unsigned int    reserved3              :8; //BIT_19-26
135         volatile unsigned int    ahb_arch_en            :1; //BIT_27
136         volatile unsigned int    emc_en                 :1; //BIT_28
137         volatile unsigned int    reserved4              :3; //BIT_29-31
138     } mBits ;
139     volatile unsigned int dwValue ;
140 } AHB_CTL0_U;
141
142 typedef union _ahb_ctl1_reg_tag
143 {
144     struct _ahb_ctl1_reg_map
145     {
146         volatile unsigned int    dcam_buf_sw            :1; //BIT_0
147         volatile unsigned int    dcam_buf_status        :1; //BIT_1
148         volatile unsigned int    reserved0              :6; //BIT_2-7
149         volatile unsigned int    emc_auto_gate_en       :1; //BIT_8
150         volatile unsigned int    emc_ch_auto_gate_en    :1; //BIT_9
151         volatile unsigned int    reserved1              :1; //BIT_10
152         volatile unsigned int    arm_auto_gate_en       :1; //BIT_11
153         volatile unsigned int    ahb_auto_gate_en       :1; //BIT_12
154         volatile unsigned int    mcu_auto_gate_en       :1; //BIT_13
155         volatile unsigned int    mstmtx_auto_gate_en    :1; //BIT_14
156         volatile unsigned int    armmtx_auto_gate_en    :1; //BIT_15
157         volatile unsigned int    arm_dahb_sleep_en      :1; //BIT_16
158         volatile unsigned int    reserved2              :15; //BIT_17-31
159     } mBits ;
160     volatile unsigned int dwValue ;
161 } AHB_CTL1_U;
162
163 typedef union _ahb_ctl2_reg_tag
164 {
165     struct _ahb_ctl2_reg_map
166     {
167         volatile unsigned int    Reserved0              :3; //BIT_0-2
168         volatile unsigned int    mcu_shm_ctrl           :2; //BIT_3-4
169         volatile unsigned int    reserved1              :27; //BIT_5-31
170     } mBits ;
171     volatile unsigned int dwValue ;
172 } AHB_CTL2_U;
173
174 typedef union _ahb_ctl3_reg_tag
175 {
176     struct _ahb_ctl3_reg_map
177     {
178         volatile unsigned int    clk_usb_ref_sel        :1; //BIT_0
179         volatile unsigned int    usb_s_hbigendian       :1; //BIT_1
180         volatile unsigned int    usb_m_hbigendian       :1; //BIT_2
181         volatile unsigned int    reserved0              :1; //BIT_3
182         volatile unsigned int    busmon_sel0            :1; //BIT_4
183         volatile unsigned int    busmon_sel1            :1; //BIT_5
184         volatile unsigned int    clk_usb_ref_en         :1; //BIT_6
185         volatile unsigned int    clk_utmifs_en          :1; //BIT_7
186         volatile unsigned int    utmifs_tx_en_inv       :1; //BIT_8
187         volatile unsigned int    utmi_suspend_inv       :1; //BIT_9
188         volatile unsigned int    clk_ulpi_en            :1; //BIT_10
189         volatile unsigned int    reserved1              :21; //BIT_11-31
190     } mBits ;
191     volatile unsigned int dwValue ;
192 } AHB_CTL3_U;
193
194
195 typedef union _ahb_soft_rst_reg_tag
196 {
197     struct _ahb_soft_rst_reg_map
198     {
199         volatile unsigned int    dma_rst                :1; //BIT_0
200         volatile unsigned int    dcam_rst               :1; //BIT_1
201         volatile unsigned int    ccir_rst               :1;//BIT_2
202         volatile unsigned int    lcdc_rst               :1;//BIT_3
203         volatile unsigned int    reserved0              :1;//Reserved
204         volatile unsigned int    nfc_rst                :1;//BIT_5
205         volatile unsigned int    usbd_utmi_rst          :1;//BIT_6
206         volatile unsigned int    usbphy_rst             :1;//BIT_7
207         volatile unsigned int    reserved1              :2;//Reserved
208         volatile unsigned int    rot_rst                :1;//BIT_10
209         volatile unsigned int    emc_rst                :1;//BIT_11
210         volatile unsigned int    sd_rst                 :1;//BIT_12
211         volatile unsigned int    drm_rst                :1;//BIT_13
212         volatile unsigned int    adc_rst                :1;//BIT_14
213         volatile unsigned int    vsp_rst                :1;//BIT_15
214         volatile unsigned int    reserved2              :16;//Reserved
215     } mBits;
216     volatile unsigned int dwValue;
217 } AHB_SOFT_RST_U;
218 #else
219 typedef union _ahb_ctl0_reg_tag
220 {
221     struct _ahb_ctl0_reg_map
222     {
223         volatile unsigned int    reserved4              :3; //BIT_29-31
224         volatile unsigned int    emc_en                 :1; //BIT_28
225         volatile unsigned int    ahb_arch_en            :1; //BIT_27
226         volatile unsigned int    reserved3              :8; //BIT_19-26
227         volatile unsigned int    drm_eb                 :1; //BIT_18
228         volatile unsigned int    reserved2              :3; //BIT_15-17
229         volatile unsigned int    rot_eb                 :1; //BIT_14
230         volatile unsigned int    vsp_eb                 :1; //BIT_13
231         volatile unsigned int    reserved1              :1; //BIT_12
232         volatile unsigned int    bm1_eb                 :1; //BIT_11
233         volatile unsigned int    reserved0              :2; //BIT_9-10
234         volatile unsigned int    nfc_eb                 :1; //BIT_8
235         volatile unsigned int    bm0_eb                 :1; //BIT_7
236         volatile unsigned int    dma_eb                 :1; //BIT_6
237         volatile unsigned int    usbd_eb                :1; //BIT_5
238         volatile unsigned int    sdio_eb                :1; //BIT_4
239         volatile unsigned int    lcdc_eb                :1; //BIT_3
240         volatile unsigned int    ccir_eb                :1; //BIT_2
241         volatile unsigned int    dcam_eb                :1; //BIT_1
242         volatile unsigned int    reserved               :1; ////apb_eb            :1;
243     } mBits ;
244     volatile unsigned int dwValue ;
245 } AHB_CTL0_U;
246
247 typedef union _ahb_ctl1_reg_tag
248 {
249     struct _ahb_ctl1_reg_map
250     {
251         volatile unsigned int    reserved2              :15; //BIT_17-31
252         volatile unsigned int    arm_dahb_sleep_en      :1; //BIT_16
253         volatile unsigned int    armmtx_auto_gate_en    :1; //BIT_15
254         volatile unsigned int    mstmtx_auto_gate_en    :1; //BIT_14
255         volatile unsigned int    mcu_auto_gate_en       :1; //BIT_13
256         volatile unsigned int    ahb_auto_gate_en       :1; //BIT_12
257         volatile unsigned int    arm_auto_gate_en       :1; //BIT_11
258         volatile unsigned int    reserved1              :1; //BIT_10
259         volatile unsigned int    emc_ch_auto_gate_en    :1; //BIT_9
260         volatile unsigned int    emc_auto_gate_en       :1; //BIT_8
261         volatile unsigned int    reserved0              :6; //BIT_2-7
262         volatile unsigned int    dcam_buf_status        :1; //BIT_1
263         volatile unsigned int    dcam_buf_sw            :1; //BIT_0
264     } mBits ;
265     volatile unsigned int dwValue ;
266 } AHB_CTL1_U;
267
268 typedef union _ahb_ctl2_reg_tag
269 {
270     struct _ahb_ctl2_reg_map
271     {
272         volatile unsigned int    reserved1              :27; //BIT_5-31
273         volatile unsigned int    mcu_shm_ctrl           :2; //BIT_3-4
274         volatile unsigned int    Reserved0              :3; //BIT_0-2
275     } mBits ;
276     volatile unsigned int dwValue ;
277 } AHB_CTL2_U;
278
279 typedef union _ahb_ctl3_reg_tag
280 {
281     struct _ahb_ctl3_reg_map
282     {
283         volatile unsigned int    reserved1              :21; //BIT_11-31
284         volatile unsigned int    clk_ulpi_en            :1; //BIT_10
285         volatile unsigned int    utmi_suspend_inv       :1; //BIT_9
286         volatile unsigned int    utmifs_tx_en_inv       :1; //BIT_8
287         volatile unsigned int    clk_utmifs_en          :1; //BIT_7
288         volatile unsigned int    clk_usb_ref_en         :1; //BIT_6
289         volatile unsigned int    busmon_sel1            :1; //BIT_5
290         volatile unsigned int    busmon_sel0            :1; //BIT_4
291         volatile unsigned int    reserved0              :1; //BIT_3
292         volatile unsigned int    usb_m_hbigendian       :1; //BIT_2
293         volatile unsigned int    usb_s_hbigendian       :1; //BIT_1
294         volatile unsigned int    clk_usb_ref_sel        :1; //BIT_0
295     } mBits ;
296     volatile unsigned int dwValue ;
297 } AHB_CTL3_U;
298
299
300 typedef union _ahb_soft_rst_reg_tag
301 {
302     struct _ahb_soft_rst_reg_map
303     {
304         volatile unsigned int    reserved2              :16;//Reserved
305         volatile unsigned int    vsp_rst                :1;//BIT_15
306         volatile unsigned int    adc_rst                :1;//BIT_14
307         volatile unsigned int    drm_rst                :1;//BIT_13
308         volatile unsigned int    sd_rst                 :1;//BIT_12
309         volatile unsigned int    emc_rst                :1;//BIT_11
310         volatile unsigned int    rot_rst                :1;//BIT_10
311         volatile unsigned int    reserved1              :2;//Reserved
312         volatile unsigned int    usbphy_rst             :1;//BIT_7
313         volatile unsigned int    usbd_utmi_rst          :1;//BIT_6
314         volatile unsigned int    nfc_rst                :1;//BIT_5
315         volatile unsigned int    reserved0              :1;//Reserved
316         volatile unsigned int    lcdc_rst               :1;//BIT_3
317         volatile unsigned int    ccir_rst               :1;//BIT_2
318         volatile unsigned int    dcam_rst               :1; //BIT_1
319         volatile unsigned int    dma_rst                :1; //BIT_0
320     } mBits;
321     volatile unsigned int dwValue;
322 } AHB_SOFT_RST_U;
323 #endif
324
325 /**----------------------------------------------------------------------------*
326 **                         Local Function Prototype                           **
327 **----------------------------------------------------------------------------*/
328
329 /**----------------------------------------------------------------------------*
330 **                           Function Prototype                               **
331 **----------------------------------------------------------------------------*/
332
333
334 /**----------------------------------------------------------------------------*
335 **                         Compiler Flag                                      **
336 **----------------------------------------------------------------------------*/
337 #ifdef   __cplusplus
338 }
339 #endif
340 /**---------------------------------------------------------------------------*/
341 #endif
342 // End