tizen 2.4 release
[kernel/u-boot-tm1.git] / arch / arm / include / asm / arch-sc8810 / emc_reg_v3.h
1 /******************************************************************************
2  ** File Name:    emc_reg_v3.h                                           *
3  ** Author:       haiyang.hu                                                  *
4  ** DATE:         05/31/2009                                                  *
5  ** Copyright:    2009 Spreatrum, Incoporated. All Rights Reserved.           *
6  ** Description:                                                              *
7  ******************************************************************************/
8 /******************************************************************************
9  **                   Edit    History                                         *
10  **---------------------------------------------------------------------------*
11  ** DATE          NAME            DESCRIPTION                                 *
12  ** 06/15/2007    Daniel.Ding     Create.                                     *
13  ** 05/07/2010    Mingwei.zhang   Modify it for SC8800G.                      *
14  ******************************************************************************/
15 #ifndef _EMC_REG_V3_H_
16 #define _EMC_REG_V3_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 EMC_T_REF_CLK           6500 //t_ref reference clk, freqency = 6.5mhz
32 #define EMC_DLL_ON_OFF          FALSE
33
34 #define EXT_MEM_CTL_BASE                        0x20000000
35
36
37 #define EXT_MEM_CFG0                    (EXT_MEM_CTL_BASE + 0x0000)
38 #define EXT_MEM_CFG1                    (EXT_MEM_CTL_BASE + 0x0004)
39
40
41 #define EXT_MEM_CFG0_CS0               (EXT_MEM_CTL_BASE + 0x0010)
42 #define EXT_MEM_CFG0_CS1               (EXT_MEM_CTL_BASE + 0x0014)
43 #define EXT_MEM_CFG0_CS2               (EXT_MEM_CTL_BASE + 0x0018)
44 #define EXT_MEM_CFG0_CS3               (EXT_MEM_CTL_BASE + 0x001c)
45
46
47 #define EXT_MEM_CFG0_ACH0               (EXT_MEM_CTL_BASE + 0x0020)
48 #define EXT_MEM_CFG1_ACH0               (EXT_MEM_CTL_BASE + 0x0024)
49 #define EXT_MEM_CFG0_ACH1               (EXT_MEM_CTL_BASE + 0x0028)
50 #define EXT_MEM_CFG1_ACH1               (EXT_MEM_CTL_BASE + 0x002C)
51 #define EXT_MEM_CFG0_HCH2               (EXT_MEM_CTL_BASE + 0x0030)
52 #define EXT_MEM_CFG1_HCH2               (EXT_MEM_CTL_BASE + 0x0034)
53 #define EXT_MEM_CFG0_HCH3               (EXT_MEM_CTL_BASE + 0x0038)
54 #define EXT_MEM_CFG1_HCH3               (EXT_MEM_CTL_BASE + 0x003C)
55 #define EXT_MEM_CFG0_HCH4               (EXT_MEM_CTL_BASE + 0x0040)
56 #define EXT_MEM_CFG1_HCH4               (EXT_MEM_CTL_BASE + 0x0044)
57 #define EXT_MEM_CFG0_HCH5               (EXT_MEM_CTL_BASE + 0x0048)
58 #define EXT_MEM_CFG1_HCH5               (EXT_MEM_CTL_BASE + 0x004C)
59 #define EXT_MEM_CFG0_HCH6               (EXT_MEM_CTL_BASE + 0x0050)
60 #define EXT_MEM_CFG1_HCH6               (EXT_MEM_CTL_BASE + 0x0054)
61 #define EXT_MEM_CFG0_HCH7               (EXT_MEM_CTL_BASE + 0x0058)
62 #define EXT_MEM_CFG1_HCH7               (EXT_MEM_CTL_BASE + 0x005C)
63 #define EXT_MEM_CFG0_HCH8               (EXT_MEM_CTL_BASE + 0x0060)
64 #define EXT_MEM_CFG1_HCH8               (EXT_MEM_CTL_BASE + 0x0064)
65
66 #define EXT_MEM_DL0                     (EXT_MEM_CTL_BASE + 0x0100)
67 #define EXT_MEM_DL1                     (EXT_MEM_CTL_BASE + 0x0104)
68 #define EXT_MEM_DL2                     (EXT_MEM_CTL_BASE + 0x0108)
69 #define EXT_MEM_DL3                     (EXT_MEM_CTL_BASE + 0x010C)
70 #define EXT_MEM_DL4                     (EXT_MEM_CTL_BASE + 0x0110)
71 #define EXT_MEM_DL5                     (EXT_MEM_CTL_BASE + 0x0114)
72 #define EXT_MEM_DL6                     (EXT_MEM_CTL_BASE + 0x0118)
73 #define EXT_MEM_DL7                     (EXT_MEM_CTL_BASE + 0x011C)
74 #define EXT_MEM_DL8                     (EXT_MEM_CTL_BASE + 0x0120)
75 #define EXT_MEM_DL9                     (EXT_MEM_CTL_BASE + 0x0124)
76 #define EXT_MEM_DL10                    (EXT_MEM_CTL_BASE + 0x0128)     
77 #define EXT_MEM_DL11                    (EXT_MEM_CTL_BASE + 0x012c)
78 #define EXT_MEM_DL12                    (EXT_MEM_CTL_BASE + 0x0130)
79 #define EXT_MEM_DL13                    (EXT_MEM_CTL_BASE + 0x0134)
80 #define EXT_MEM_DL14                    (EXT_MEM_CTL_BASE + 0x0138)
81 #define EXT_MEM_DL15                    (EXT_MEM_CTL_BASE + 0x013c)
82 #define EXT_MEM_DL16                    (EXT_MEM_CTL_BASE + 0x0140)
83 #define EXT_MEM_DL17                    (EXT_MEM_CTL_BASE + 0x0144)
84 #define EXT_MEM_DL18                    (EXT_MEM_CTL_BASE + 0x0148)
85 #define EXT_MEM_DL19                    (EXT_MEM_CTL_BASE + 0x014c)     
86
87 #define EXT_MEM_CFG0_DLL            (EXT_MEM_CTL_BASE + 0x0170)         
88 #define EXT_MEM_CFG0_DLL_STS            (EXT_MEM_CTL_BASE + 0x0174) 
89
90 #define EXT_MEM_STS3                    (EXT_MEM_CTL_BASE + 0x00AC)
91
92 #define EXT_MEM_DCFG0                   (EXT_MEM_CTL_BASE + 0x0180)
93 #define EXT_MEM_DCFG1                   (EXT_MEM_CTL_BASE + 0x0184)
94 #define EXT_MEM_DCFG2                   (EXT_MEM_CTL_BASE + 0x0188)
95 #define EXT_MEM_DCFG3                   (EXT_MEM_CTL_BASE + 0x018c)
96 #define EXT_MEM_DCFG4                   (EXT_MEM_CTL_BASE + 0x0190)
97 #define EXT_MEM_DCFG5                   (EXT_MEM_CTL_BASE + 0x0194)
98 #define EXT_MEM_DCFG6                   (EXT_MEM_CTL_BASE + 0x0198)
99 #define EXT_MEM_DCFG7                   (EXT_MEM_CTL_BASE + 0x019c)
100 #define EXT_MEM_DCFG8                   (EXT_MEM_CTL_BASE + 0x01A0)
101
102
103 #define EXT_MEM_CFG0_CH0_BASE     (EXT_MEM_CFG0_ACH0)
104 #define EXT_MEM_CFG1_CH0_BASE     (EXT_MEM_CFG1_ACH0)
105
106
107 #define HCH_RF_AUTO_SLEEP_EN_CHX     (BIT_17)
108 #define ACH_RF_AUTO_SLEEP_EN_CHX   (BIT_7)
109 #define ACH_RF_CH_EN_CHX                     (BIT_6)
110 #define ACH_RF_ENDIAN_SWT_CHX        (3<<4)
111 #define ACH_RF_BRESP_MODE_CH           (BIT_6)
112 #define ACH_RF_SYNC_SEL_CHX                (BIT_4)
113
114 #define HCH_CHL_PRI_MASK     (0x3)
115 #define HCH_CHL_PRI(level)     ((level) & 0x3)
116
117 #define ACH_CHL_PRI_WR_MASK     (0x3)
118 #define ACH_CHL_PRI_WR(level)     ((level) & 0x3)
119
120 #define ACH_CHL_PRI_RD_MASK     (0x3)
121 #define ACH_CHL_PRI_RD(level)     ((level) & 0x3)
122
123
124 /**----------------------------------------------------------------------------*
125 **                             Data Prototype                                 **
126 **----------------------------------------------------------------------------*/
127 //External Memory Control.
128 typedef struct EMC_CFG_REG_TAG
129 {
130     VOLATILE uint32 cfg0;
131     VOLATILE uint32 cfg1;
132     VOLATILE uint32 cfg0_cs0;
133     VOLATILE uint32 cfg0_cs1;
134     VOLATILE uint32 cfg0_cs2;
135     VOLATILE uint32 cfg0_cs3;
136     VOLATILE uint32 cfg0_ch0;
137     VOLATILE uint32 cfg0_ch1;
138     VOLATILE uint32 cfg0_ch2;
139     VOLATILE uint32 cfg0_ch3;
140     VOLATILE uint32 cfg0_ch4;
141     VOLATILE uint32 cfg0_ch5;
142     VOLATILE uint32 cfg0_ch6;
143     VOLATILE uint32 cfg0_ch7;
144     VOLATILE uint32 cfg0_ch8;
145     VOLATILE uint32 cfg0_ch9;
146     VOLATILE uint32 cfg0_ch10;
147     VOLATILE uint32 cfg0_ch11;
148     VOLATILE uint32 cfg0_ch12;
149     VOLATILE uint32 cfg0_ch13;
150     VOLATILE uint32 cfg0_ch14;
151     VOLATILE uint32 cfg0_ch15;
152 }
153 EMC_CFG_REG_T, *EMC_CFG_REG_T_PTR;
154
155 typedef struct EMC_DCFG_REG_TAG
156 {
157     VOLATILE uint32 dcfg0;
158     VOLATILE uint32 dcfg1;
159     VOLATILE uint32 dcfg2;
160     VOLATILE uint32 dcfg3;
161     VOLATILE uint32 dcfg4;
162     VOLATILE uint32 dcfg5;
163     VOLATILE uint32 dcfg6;
164     VOLATILE uint32 dcfg7;
165 }
166 EMC_DCFG_REG_T, *EMC_DCFG_REG_T_PTR;
167 /**----------------------------------------------------------------------------*
168 **                           Function Prototype                               **
169 **----------------------------------------------------------------------------*/
170
171
172 /**----------------------------------------------------------------------------*
173 **                         Compiler Flag                                      **
174 **----------------------------------------------------------------------------*/
175 #ifdef   __cplusplus
176 }
177 #endif
178 /**---------------------------------------------------------------------------*/
179 #endif //_EMC_REG_V3_H_
180
181