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