1 /******************************************************************************
2 ** File Name: emc_reg_v3.h *
3 ** Author: haiyang.hu *
5 ** Copyright: 2009 Spreatrum, Incoporated. All Rights Reserved. *
7 ******************************************************************************/
8 /******************************************************************************
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 /*----------------------------------------------------------------------------*
19 **-------------------------------------------------------------------------- */
21 /**---------------------------------------------------------------------------*
23 **---------------------------------------------------------------------------*/
28 /**----------------------------------------------------------------------------*
30 **----------------------------------------------------------------------------*/
31 #define EMC_T_REF_CLK 6500 //t_ref reference clk, freqency = 6.5mhz
32 #define EMC_DLL_ON_OFF FALSE
34 #define EXT_MEM_CTL_BASE 0x20000000
37 #define EXT_MEM_CFG0 (EXT_MEM_CTL_BASE + 0x0000)
38 #define EXT_MEM_CFG1 (EXT_MEM_CTL_BASE + 0x0004)
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)
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)
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)
87 #define EXT_MEM_CFG0_DLL (EXT_MEM_CTL_BASE + 0x0170)
88 #define EXT_MEM_CFG0_DLL_STS (EXT_MEM_CTL_BASE + 0x0174)
90 #define EXT_MEM_STS3 (EXT_MEM_CTL_BASE + 0x00AC)
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)
103 #define EXT_MEM_CFG0_CH0_BASE (EXT_MEM_CFG0_ACH0)
104 #define EXT_MEM_CFG1_CH0_BASE (EXT_MEM_CFG1_ACH0)
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)
114 #define HCH_CHL_PRI_MASK (0x3)
115 #define HCH_CHL_PRI(level) ((level) & 0x3)
117 #define ACH_CHL_PRI_WR_MASK (0x3)
118 #define ACH_CHL_PRI_WR(level) ((level) & 0x3)
120 #define ACH_CHL_PRI_RD_MASK (0x3)
121 #define ACH_CHL_PRI_RD(level) ((level) & 0x3)
124 /**----------------------------------------------------------------------------*
126 **----------------------------------------------------------------------------*/
127 //External Memory Control.
128 typedef struct EMC_CFG_REG_TAG
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;
153 EMC_CFG_REG_T, *EMC_CFG_REG_T_PTR;
155 typedef struct EMC_DCFG_REG_TAG
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;
166 EMC_DCFG_REG_T, *EMC_DCFG_REG_T_PTR;
167 /**----------------------------------------------------------------------------*
168 ** Function Prototype **
169 **----------------------------------------------------------------------------*/
172 /**----------------------------------------------------------------------------*
174 **----------------------------------------------------------------------------*/
178 /**---------------------------------------------------------------------------*/
179 #endif //_EMC_REG_V3_H_