removed volatile register derefs from amazon setup code
[librecmc/librecmc.git] / target / linux / amazon-2.6 / files / include / asm-mips / amazon / amazon.h
1 #ifndef AMAZON_H
2 #define AMAZON_H
3 /******************************************************************************
4        Copyright (c) 2002, Infineon Technologies.  All rights reserved.
5
6                                No Warranty
7    Because the program is licensed free of charge, there is no warranty for 
8    the program, to the extent permitted by applicable law.  Except when     
9    otherwise stated in writing the copyright holders and/or other parties   
10    provide the program "as is" without warranty of any kind, either         
11    expressed or implied, including, but not limited to, the implied         
12    warranties of merchantability and fitness for a particular purpose. The  
13    entire risk as to the quality and performance of the program is with     
14    you.  should the program prove defective, you assume the cost of all     
15    necessary servicing, repair or correction.                               
16                                                                             
17    In no event unless required by applicable law or agreed to in writing    
18    will any copyright holder, or any other party who may modify and/or      
19    redistribute the program as permitted above, be liable to you for        
20    damages, including any general, special, incidental or consequential     
21    damages arising out of the use or inability to use the program           
22    (including but not limited to loss of data or data being rendered        
23    inaccurate or losses sustained by you or third parties or a failure of   
24    the program to operate with any other programs), even if such holder or  
25    other party has been advised of the possibility of such damages. 
26 ******************************************************************************/
27
28 #define amazon_readl(a)                 readl(((u32*)(a)))
29 #define amazon_writel(a,b)              writel(a, ((u32*)(b)))
30
31 /* check ADSL link status */
32 #define AMAZON_CHECK_LINK
33          
34 /***********************************************************************/
35 /*  Module      :  WDT register address and bits                       */
36 /***********************************************************************/
37          
38 #define AMAZON_WDT                          (KSEG1+0x10100900)
39 /***********************************************************************/   
40     
41 /***Reset Request Register***/ 
42 #define AMAZON_RST_REQ                      ((volatile u32*)(AMAZON_WDT+ 0x0010))
43 #define AMAZON_RST_REQ_PLL                              (1 << 31)
44 #define AMAZON_RST_REQ_PCI_CORE                         (1 << 13) 
45 #define AMAZON_RST_REQ_TPE                              (1 << 12)
46 #define AMAZON_RST_REQ_AFE                              (1 << 11)
47 #define AMAZON_RST_REQ_DMA                              (1 << 9)
48 #define AMAZON_RST_REQ_SWITCH                           (1 << 8)
49 #define AMAZON_RST_REQ_DFE                              (1 << 7)
50 #define AMAZON_RST_REQ_PHY                              (1 << 5)
51 #define AMAZON_RST_REQ_PCI                              (1 << 4)
52 #define AMAZON_RST_REQ_FPI                              (1 << 2)
53 #define AMAZON_RST_REQ_CPU                              (1 << 1)
54 #define AMAZON_RST_REQ_HRST                             (1 << 0)
55 #define AMAZON_RST_ALL                          (AMAZON_RST_REQ_PLL     \
56                                                 |AMAZON_RST_REQ_PCI_CORE \
57                                                 |AMAZON_RST_REQ_TPE     \
58                                                 |AMAZON_RST_REQ_AFE     \
59                                                 |AMAZON_RST_REQ_DMA     \
60                                                 |AMAZON_RST_REQ_SWITCH  \
61                                                 |AMAZON_RST_REQ_DFE     \
62                                                 |AMAZON_RST_REQ_PHY     \
63                                                 |AMAZON_RST_REQ_PCI     \
64                                                 |AMAZON_RST_REQ_FPI     \
65                                                 |AMAZON_RST_REQ_CPU     \
66                                                 |AMAZON_RST_REQ_HRST)
67       
68 /***Reset Status Register Power On***/ 
69 #define AMAZON_RST_SR                       ((volatile u32*)(AMAZON_WDT+ 0x0014))
70
71 /***Watchdog Timer Control Register 0***/ 
72 #define AMAZON_WDT_CON0                    ((volatile u32*)(AMAZON_WDT+ 0x0020))
73       
74 /***Watchdog Timer Control Register 1***/ 
75 #define AMAZON_WDT_CON1                    ((volatile u32*)(AMAZON_WDT+ 0x0024))
76 #define AMAZON_WDT_CON1_WDTDR                          (1 << 3)
77 #define AMAZON_WDT_CON1_WDTIR                          (1 << 2)
78       
79 /***Watchdog Timer Status Register***/ 
80 #define AMAZON_WDT_SR                       ((volatile u32*)(AMAZON_WDT+ 0x0028))
81 #define AMAZON_WDT_SR_WDTTIM(value)             (((( 1 << 16) - 1) & (value)) << 16)
82 #define AMAZON_WDT_SR_WDTPR                          (1 << 5)
83 #define AMAZON_WDT_SR_WDTTO                          (1 << 4)
84 #define AMAZON_WDT_SR_WDTDS                          (1 << 3)
85 #define AMAZON_WDT_SR_WDTIS                          (1 << 2)
86 #define AMAZON_WDT_SR_WDTOE                          (1 << 1)
87 #define AMAZON_WDT_SR_WDTAE                          (1 << 0)           
88
89 /***NMI Status Register***/ 
90 #define AMAZON_WDT_NMISR                                ((volatile u32*)(AMAZON_WDT+ 0x002C))
91 #define AMAZON_WDT_NMISR_NMIWDT                        (1 << 2)
92 #define AMAZON_WDT_NMISR_NMIPLL                        (1 << 1)
93 #define AMAZON_WDT_NMISR_NMIEXT                        (1 << 0)
94       
95 #define AMAZON_WDT_RST_MON                              ((volatile u32*)(AMAZON_WDT+ 0x0030))
96
97 /***********************************************************************/
98 /*  Module      :  MCD register address and bits                       */
99 /***********************************************************************/
100 #define AMAZON_MCD                                      (KSEG1+0x1F106000)
101
102 /***Manufacturer Identification Register***/ 
103 #define AMAZON_MCD_MANID                                ((volatile u32*)(AMAZON_MCD+ 0x0024))
104 #define AMAZON_MCD_MANID_MANUF(value)                   (((( 1 << 11) - 1) & (value)) << 5)
105
106 /***Chip Identification Register***/ 
107 #define AMAZON_MCD_CHIPID                               ((volatile u32*)(AMAZON_MCD+ 0x0028))
108 #define AMAZON_MCD_CHIPID_VERSION_GET(value)             (((value) >> 28) & ((1 << 4) - 1))
109 #define AMAZON_MCD_CHIPID_VERSION_SET(value)             (((( 1 << 4) - 1) & (value)) << 28)
110 #define AMAZON_MCD_CHIPID_PART_NUMBER_GET(value)         (((value) >> 12) & ((1 << 16) - 1))
111 #define AMAZON_MCD_CHIPID_PART_NUMBER_SET(value)         (((( 1 << 16) - 1) & (value)) << 12)
112 #define AMAZON_MCD_CHIPID_MANID_GET(value)               (((value) >> 1) & ((1 << 11) - 1))
113 #define AMAZON_MCD_CHIPID_MANID_SET(value)               (((( 1 << 11) - 1) & (value)) << 1)
114
115 #define AMAZON_CHIPID_STANDARD                          0x00EB
116 #define AMAZON_CHIPID_YANGTSE                           0x00ED
117
118 /***Redesign Tracing Identification Register***/ 
119 #define AMAZON_MCD_RTID                                 ((volatile u32*)(AMAZON_MCD+ 0x002C))
120 #define AMAZON_MCD_RTID_LC                              (1 << 15)
121 #define AMAZON_MCD_RTID_RIX(value)                      (((( 1 << 3) - 1) & (value)) << 0)
122
123                   
124 /***********************************************************************/
125 /*  Module      :  CGU register address and bits                       */
126 /***********************************************************************/
127          
128 #define AMAZON_CGU                          (KSEG1+0x1F103000)
129 /***********************************************************************/   
130
131 /***CGU Clock Divider Select Register***/
132 #define AMAZON_CGU_DIV                                                  (AMAZON_CGU + 0x0000)                   
133 /***CGU PLL0 Status Register***/ 
134 #define AMAZON_CGU_PLL0SR                                               (AMAZON_CGU + 0x0004)
135 /***CGU PLL1 Status Register***/ 
136 #define AMAZON_CGU_PLL1SR                                               (AMAZON_CGU + 0x0008)
137 /***CGU Interface Clock Control Register***/ 
138 #define AMAZON_CGU_IFCCR                                                (AMAZON_CGU + 0x000c)
139 /***CGU Oscillator Control Register***/ 
140 #define AMAZON_CGU_OSCCR                                                (AMAZON_CGU + 0x0010)
141 /***CGU Memory Clock Delay Register***/ 
142 #define AMAZON_CGU_MCDEL                                                (AMAZON_CGU + 0x0014)
143 /***CGU CPU Clock Reduction Register***/ 
144 #define AMAZON_CGU_CPUCRD                                               (AMAZON_CGU + 0x0018)
145 /***CGU Test Register**/
146 #define AMAZON_CGU_TST                                                  (AMAZON_CGU + 0x003c)
147
148 /***********************************************************************/
149 /*  Module      :  PMU register address and bits                       */
150 /***********************************************************************/
151          
152 #define AMAZON_PMU                                                              AMAZON_CGU
153 /***********************************************************************/   
154
155       
156 /***PMU Power Down Control Register***/ 
157 #define AMAZON_PMU_PWDCR                       ((volatile u32*)(AMAZON_PMU+ 0x001c))
158 #define AMAZON_PMU_PWDCR_TPE                            (1 << 13)
159 #define AMAZON_PMU_PWDCR_PLL                            (1 << 12)
160 #define AMAZON_PMU_PWDCR_XTAL                           (1 << 11)
161 #define AMAZON_PMU_PWDCR_EBU                            (1 << 10)
162 #define AMAZON_PMU_PWDCR_DFE                            (1 << 9)
163 #define AMAZON_PMU_PWDCR_SPI                            (1 << 8)
164 #define AMAZON_PMU_PWDCR_UART                           (1 << 7)
165 #define AMAZON_PMU_PWDCR_GPT                            (1 << 6)
166 #define AMAZON_PMU_PWDCR_DMA                            (1 << 5)
167 #define AMAZON_PMU_PWDCR_PCI                            (1 << 4)
168 #define AMAZON_PMU_PWDCR_SW                             (1 << 3)
169 #define AMAZON_PMU_PWDCR_IOR                            (1 << 2)
170 #define AMAZON_PMU_PWDCR_FPI                            (1 << 1)
171 #define AMAZON_PMU_PWDCR_EPHY                           (1 << 0)
172       
173 /***PMU Status Register***/ 
174 #define AMAZON_PMU_SR                         ((volatile u32*)(AMAZON_PMU+ 0x0020))
175 #define AMAZON_PMU_SR_TPE                               (1 << 13)
176 #define AMAZON_PMU_SR_PLL                               (1 << 12)
177 #define AMAZON_PMU_SR_XTAL                              (1 << 11)
178 #define AMAZON_PMU_SR_EBU                               (1 << 10)
179 #define AMAZON_PMU_SR_DFE                               (1 << 9)
180 #define AMAZON_PMU_SR_SPI                               (1 << 8)
181 #define AMAZON_PMU_SR_UART                              (1 << 7)
182 #define AMAZON_PMU_SR_GPT                               (1 << 6)
183 #define AMAZON_PMU_SR_DMA                               (1 << 5)
184 #define AMAZON_PMU_SR_PCI                               (1 << 4)
185 #define AMAZON_PMU_SR_SW                                (1 << 3)
186 #define AMAZON_PMU_SR_IOR                               (1 << 2)
187 #define AMAZON_PMU_SR_FPI                               (1 << 1)
188 #define AMAZON_PMU_SR_EPHY                              (1 << 0)
189          
190 /***********************************************************************/
191 /*  Module      :  BCU register address and bits                       */
192 /***********************************************************************/
193          
194 #define AMAZON_BCU                          (KSEG1+0x10100000)
195 /***********************************************************************/   
196
197       
198 /***BCU Control Register (0010H)***/ 
199 #define AMAZON_BCU_CON                      ((volatile u32*)(AMAZON_BCU+ 0x0010))
200 #define AMAZON_BCU_CON_SPC(value)                (((( 1 << 8) - 1) & (value)) << 24)
201 #define AMAZON_BCU_CON_SPE                              (1 << 19)
202 #define AMAZON_BCU_CON_PSE                              (1 << 18)
203 #define AMAZON_BCU_CON_DBG                              (1 << 16)
204 #define AMAZON_BCU_CON_TOUT(value)               (((( 1 << 16) - 1) & (value)) << 0)
205       
206 /***BCU Error Control Capture Register (0020H)***/ 
207 #define AMAZON_BCU_ECON                    ((volatile u32*)(AMAZON_BCU+ 0x0020))
208 #define AMAZON_BCU_ECON_TAG(value)                (((( 1 << 4) - 1) & (value)) << 24)
209 #define AMAZON_BCU_ECON_RDN                              (1 << 23)
210 #define AMAZON_BCU_ECON_WRN                              (1 << 22)
211 #define AMAZON_BCU_ECON_SVM                              (1 << 21)
212 #define AMAZON_BCU_ECON_ACK(value)                (((( 1 << 2) - 1) & (value)) << 19)
213 #define AMAZON_BCU_ECON_ABT                              (1 << 18)
214 #define AMAZON_BCU_ECON_RDY                              (1 << 17)
215 #define AMAZON_BCU_ECON_TOUT                            (1 << 16)
216 #define AMAZON_BCU_ECON_ERRCNT(value)             (((( 1 << 16) - 1) & (value)) << 0)
217 #define AMAZON_BCU_ECON_OPC(value)                (((( 1 << 4) - 1) & (value)) << 28)
218       
219 /***BCU Error Address Capture Register (0024 H)***/ 
220 #define AMAZON_BCU_EADD                    ((volatile u32*)(AMAZON_BCU+ 0x0024))
221 #define AMAZON_BCU_EADD_FPIADR
222       
223 /***BCU Error Data Capture Register (0028H)***/ 
224 #define AMAZON_BCU_EDAT                    ((volatile u32*)(AMAZON_BCU+ 0x0028))
225 #define AMAZON_BCU_EDAT_FPIDAT          
226          
227 /***********************************************************************/
228 /*  Module      :  Switch register address and bits                    */
229 /***********************************************************************/
230          
231 #define AMAZON_SWITCH                       (KSEG1+0x10106000)
232 /***********************************************************************/   
233 #define AMAZON_SW_UN_DEST                       AMAZON_SWITCH+0x00 /*Unknown destination register*/
234 #define AMAZON_SW_VLAN_CTRL                     AMAZON_SWITCH+0x04 /*VLAN control register*/
235 #define AMAZON_SW_PS_CTL                        AMAZON_SWITCH+0x08 /*port status control register*/
236 #define AMAZON_SW_COS_CTL                       AMAZON_SWITCH+0x0c /*Cos control register*/
237 #define AMAZON_SW_VLAN_COS                      AMAZON_SWITCH+0x10 /*VLAN priority cos mapping register*/
238 #define AMAZON_SW_DSCP_COS3                     AMAZON_SWITCH+0x14 /*DSCP cos mapping register3*/
239 #define AMAZON_SW_DSCP_COS2                     AMAZON_SWITCH+0x18 /*DSCP cos mapping register2*/
240 #define AMAZON_SW_DSCP_COS1                     AMAZON_SWITCH+0x1c /*DSCP cos mapping register1*/
241 #define AMAZON_SW_DSCP_COS0                     AMAZON_SWITCH+0x20 /*DSCP cos mapping register*/
242 #define AMAZON_SW_ARL_CTL                       AMAZON_SWITCH+0x24 /*ARL control register*/
243 #define AMAZON_SW_PKT_LEN                       AMAZON_SWITCH+0x28 /*packet length register*/
244 #define AMAZON_SW_CPU_ACTL                      AMAZON_SWITCH+0x2c /*CPU control register1*/
245 #define AMAZON_SW_DATA1                         AMAZON_SWITCH+0x30 /*CPU access control register1*/
246 #define AMAZON_SW_DATA2                         AMAZON_SWITCH+0x34 /*CPU access control register2*/
247 #define AMAZON_SW_P2_PCTL                       AMAZON_SWITCH+0x38 /*Port2 control register*/
248 #define AMAZON_SW_P0_TX_CTL                     AMAZON_SWITCH+0x3c /*port0 TX control register*/
249 #define AMAZON_SW_P1_TX_CTL                     AMAZON_SWITCH+0x40 /*port 1 TX control register*/
250 #define AMAZON_SW_P0_WM                         AMAZON_SWITCH+0x44 /*port 0 watermark control register*/
251 #define AMAZON_SW_P1_WM                         AMAZON_SWITCH+0x48 /*port 1 watermark control register*/
252 #define AMAZON_SW_P2_WM                         AMAZON_SWITCH+0x4c /*port 2 watermark control register*/
253 #define AMAZON_SW_GBL_WM                        AMAZON_SWITCH+0x50 /*Global watermark register*/
254 #define AMAZON_SW_PM_CTL                        AMAZON_SWITCH+0x54 /*PM control register*/
255 #define AMAZON_SW_P2_CTL                        AMAZON_SWITCH+0x58 /*PMAC control register*/
256 #define AMAZON_SW_P2_TX_IPG                     AMAZON_SWITCH+0x5c /*port2 TX IPG control register*/
257 #define AMAZON_SW_P2_RX_IPG                     AMAZON_SWITCH+0x60 /*prot2 RX IPG control register*/
258 #define AMAZON_SW_MDIO_ACC                      AMAZON_SWITCH+0x64 /*MDIO access register*/
259 #define AMAZON_SW_EPHY                          AMAZON_SWITCH+0x68 /*Ethernet PHY register*/
260 #define AMAZON_SW_MDIO_CFG                      AMAZON_SWITCH+0x6c /*MDIO configuration register*/
261 #define AMAZON_SW_P0_RCV_DROP_CNT               AMAZON_SWITCH+0x70 /*port0 receive drop counter */
262 #define AMAZON_SW_P0_RCV_FRAME_ERR_CNT          AMAZON_SWITCH+0x74 /*port0 receive frame error conter*/
263 #define AMAZON_SW_P0_TX_COLL_CNT                AMAZON_SWITCH+0x78 /*port0 transmit collision counter*/ 
264 #define AMAZON_SW_P0_TX_DROP_CNT                AMAZON_SWITCH+0x7c /*port1 transmit drop counter*/
265 #define AMAZON_SW_P1_RCV_DROP_CNT               AMAZON_SWITCH+0x80 /*port1 receive drop counter*/
266 #define AMAZON_SW_P1_RCV_FRAME_ERR_CNT          AMAZON_SWITCH+0x84 /*port1 receive error counter*/
267 #define AMAZON_SW_P1_TX_COLL_CNT                AMAZON_SWITCH+0x88 /*port1 transmit collision counter*/
268 #define AMAZON_SW_P1_TX_DROP_CNT                AMAZON_SWITCH+0x8c /*port1 transmit drop counter*/
269
270
271          
272 /***********************************************************************/
273 /*  Module      :  SSC register address and bits                      */
274 /***********************************************************************/
275 #define AMAZON_SSC_BASE_ADD_0                   (KSEG1+0x10100800)         
276
277 /*165001:henryhsu:20050603:Source add by Bing Tao*/
278
279 /*configuration/Status Registers in Bus Clock Domain*/
280 #define AMAZON_SSC_CLC                          ((volatile u32*)(AMAZON_SSC_BASE_ADD_0+0x0000))
281 #define AMAZON_SSC_ID                           ((volatile u32*)(AMAZON_SSC_BASE_ADD_0+0x0008))
282 #define AMAZON_SSC_CON                          ((volatile u32*)(AMAZON_SSC_BASE_ADD_0+0x0010))
283 #define AMAZON_SSC_STATE                        ((volatile u32*)(AMAZON_SSC_BASE_ADD_0+0x0014))
284 #define AMAZON_SSC_WHBSTATE                     ((volatile u32*)(AMAZON_SSC_BASE_ADD_0+0x0018))
285 #define AMAZON_SSC_TB                           ((volatile u32*)(AMAZON_SSC_BASE_ADD_0+0x0020))
286 #define AMAZON_SSC_RB                           ((volatile u32*)(AMAZON_SSC_BASE_ADD_0+0x0024))
287 #define AMAZON_SSC_FSTAT                        ((volatile u32*)(AMAZON_SSC_BASE_ADD_0+0x0038)) 
288
289 /*Configuration/Status Registers in Kernel Clock Domain*/
290 #define AMAZON_SSC_PISEL                        ((volatile u32*)(AMAZON_SSC_BASE_ADD_0+0x0004))
291 #define AMAZON_SSC_RXFCON                       ((volatile u32*)(AMAZON_SSC_BASE_ADD_0+0x0030))
292 #define AMAZON_SSC_TXFCON                       ((volatile u32*)(AMAZON_SSC_BASE_ADD_0+0x0034))
293 #define AMAZON_SSC_BR                           ((volatile u32*)(AMAZON_SSC_BASE_ADD_0+0x0040))
294 #define AMAZON_SSC_BRSTAT                       ((volatile u32*)(AMAZON_SSC_BASE_ADD_0+0x0044))
295 #define AMAZON_SSC_SFCON                        ((volatile u32*)(AMAZON_SSC_BASE_ADD_0+0x0060))
296 #define AMAZON_SSC_SFSTAT                       ((volatile u32*)(AMAZON_SSC_BASE_ADD_0+0x0064))
297 #define AMAZON_SSC_GPOCON                       ((volatile u32*)(AMAZON_SSC_BASE_ADD_0+0x0070))
298 #define AMAZON_SSC_GPOSTAT                      ((volatile u32*)(AMAZON_SSC_BASE_ADD_0+0x0074))
299 #define AMAZON_SSC_WHBGPOSTAT                   ((volatile u32*)(AMAZON_SSC_BASE_ADD_0+0x0078))
300 #define AMAZON_SSC_RXREQ                        ((volatile u32*)(AMAZON_SSC_BASE_ADD_0+0x0080))
301 #define AMAZON_SSC_RXCNT                        ((volatile u32*)(AMAZON_SSC_BASE_ADD_0+0x0084))
302
303 /*DMA Registers in Bus Clock Domain*/
304 #define AMAZON_SSC_DMA_CON                      ((volatile u32*)(AMAZON_SSC_BASE_ADD_0+0x00ec))
305
306 /*interrupt Node Registers in Bus Clock Domain*/
307 #define AMAZON_SSC_IRNEN                        ((volatile u32*)(AMAZON_SSC_BASE_ADD_0+0x00F4))
308 #define AMAZON_SSC_IRNICR                       ((volatile u32*)(AMAZON_SSC_BASE_ADD_0+0x00FC))
309 #define AMAZON_SSC_IRNCR                        ((volatile u32*)(AMAZON_SSC_BASE_ADD_0+0x00F8))
310
311 /*165001*/
312
313 /***********************************************************************/   
314
315       
316          
317 /***********************************************************************/
318 /*  Module      :  EBU register address and bits                       */
319 /***********************************************************************/
320          
321 #define AMAZON_EBU                          (KSEG1+0x10105300)
322 /***********************************************************************/   
323
324       
325 /***EBU Clock Control Register***/ 
326 #define AMAZON_EBU_CLC                      ((volatile u32*)(AMAZON_EBU+ 0x0000))
327 #define AMAZON_EBU_CLC_DISS                            (1 << 1)
328 #define AMAZON_EBU_CLC_DISR                            (1 << 0)
329       
330 /***EBU Global Control Register***/ 
331 #define AMAZON_EBU_CON                      ((volatile u32*)(AMAZON_EBU+ 0x0010))
332 #define AMAZON_EBU_CON_DTACS(value)              (((( 1 << 3) - 1) & (value)) << 20)
333 #define AMAZON_EBU_CON_DTARW(value)              (((( 1 << 3) - 1) & (value)) << 16)
334 #define AMAZON_EBU_CON_TOUTC(value)              (((( 1 << 8) - 1) & (value)) << 8)
335 #define AMAZON_EBU_CON_ARBMODE(value)            (((( 1 << 2) - 1) & (value)) << 6)
336 #define AMAZON_EBU_CON_ARBSYNC                      (1 << 5)
337 #define AMAZON_EBU_CON_1                              (1 << 3)
338       
339 /***EBU Address Select Register 0***/ 
340 #define AMAZON_EBU_ADDSEL0                  ((volatile u32*)(AMAZON_EBU+ 0x0020))
341 #define AMAZON_EBU_ADDSEL0_BASE(value)               (((( 1 << 20) - 1) & (value)) << 12)
342 #define AMAZON_EBU_ADDSEL0_MASK(value)               (((( 1 << 4) - 1) & (value)) << 4)
343 #define AMAZON_EBU_ADDSEL0_MIRRORE                      (1 << 1)
344 #define AMAZON_EBU_ADDSEL0_REGEN                          (1 << 0)
345       
346 /***EBU Address Select Register 1***/ 
347 #define AMAZON_EBU_ADDSEL1                  ((volatile u32*)(AMAZON_EBU+ 0x0024))
348 #define AMAZON_EBU_ADDSEL1_BASE(value)               (((( 1 << 20) - 1) & (value)) << 12)
349 #define AMAZON_EBU_ADDSEL1_MASK(value)               (((( 1 << 4) - 1) & (value)) << 4)
350 #define AMAZON_EBU_ADDSEL1_MIRRORE                      (1 << 1)
351 #define AMAZON_EBU_ADDSEL1_REGEN                          (1 << 0)
352       
353 /***EBU Address Select Register 2***/ 
354 #define AMAZON_EBU_ADDSEL2                  ((volatile u32*)(AMAZON_EBU+ 0x0028))
355 #define AMAZON_EBU_ADDSEL2_BASE(value)               (((( 1 << 20) - 1) & (value)) << 12)
356 #define AMAZON_EBU_ADDSEL2_MASK(value)               (((( 1 << 4) - 1) & (value)) << 4)
357 #define AMAZON_EBU_ADDSEL2_MIRRORE                      (1 << 1)
358 #define AMAZON_EBU_ADDSEL2_REGEN                          (1 << 0)
359       
360 /***EBU Bus Configuration Register 0***/ 
361 #define AMAZON_EBU_BUSCON0                  ((volatile u32*)(AMAZON_EBU+ 0x0060))
362 #define AMAZON_EBU_BUSCON0_WRDIS                          (1 << 31)
363 #define AMAZON_EBU_BUSCON0_ALEC(value)               (((( 1 << 2) - 1) & (value)) << 29)
364 #define AMAZON_EBU_BUSCON0_BCGEN(value)              (((( 1 << 2) - 1) & (value)) << 27)
365 #define AMAZON_EBU_BUSCON0_AGEN(value)               (((( 1 << 2) - 1) & (value)) << 24)
366 #define AMAZON_EBU_BUSCON0_CMULTR(value)             (((( 1 << 2) - 1) & (value)) << 22)
367 #define AMAZON_EBU_BUSCON0_WAIT(value)               (((( 1 << 2) - 1) & (value)) << 20)
368 #define AMAZON_EBU_BUSCON0_WAITINV                      (1 << 19)
369 #define AMAZON_EBU_BUSCON0_SETUP                          (1 << 18)
370 #define AMAZON_EBU_BUSCON0_PORTW(value)              (((( 1 << 2) - 1) & (value)) << 16)
371 #define AMAZON_EBU_BUSCON0_WAITRDC(value)            (((( 1 << 7) - 1) & (value)) << 9)
372 #define AMAZON_EBU_BUSCON0_WAITWRC(value)            (((( 1 << 3) - 1) & (value)) << 6)
373 #define AMAZON_EBU_BUSCON0_HOLDC(value)              (((( 1 << 2) - 1) & (value)) << 4)
374 #define AMAZON_EBU_BUSCON0_RECOVC(value)             (((( 1 << 2) - 1) & (value)) << 2)
375 #define AMAZON_EBU_BUSCON0_CMULT(value)              (((( 1 << 2) - 1) & (value)) << 0)
376       
377 /***EBU Bus Configuration Register 1***/ 
378 #define AMAZON_EBU_BUSCON1                  ((volatile u32*)(AMAZON_EBU+ 0x0064))
379 #define AMAZON_EBU_BUSCON1_WRDIS                          (1 << 31)
380 #define AMAZON_EBU_BUSCON1_ALEC(value)               (((( 1 << 2) - 1) & (value)) << 29)
381 #define AMAZON_EBU_BUSCON1_BCGEN(value)              (((( 1 << 2) - 1) & (value)) << 27)
382 #define AMAZON_EBU_BUSCON1_AGEN(value)               (((( 1 << 2) - 1) & (value)) << 24)
383 #define AMAZON_EBU_BUSCON1_CMULTR(value)             (((( 1 << 2) - 1) & (value)) << 22)
384 #define AMAZON_EBU_BUSCON1_WAIT(value)               (((( 1 << 2) - 1) & (value)) << 20)
385 #define AMAZON_EBU_BUSCON1_WAITINV                      (1 << 19)
386 #define AMAZON_EBU_BUSCON1_SETUP                          (1 << 18)
387 #define AMAZON_EBU_BUSCON1_PORTW(value)              (((( 1 << 2) - 1) & (value)) << 16)
388 #define AMAZON_EBU_BUSCON1_WAITRDC(value)            (((( 1 << 7) - 1) & (value)) << 9)
389 #define AMAZON_EBU_BUSCON1_WAITWRC(value)            (((( 1 << 3) - 1) & (value)) << 6)
390 #define AMAZON_EBU_BUSCON1_HOLDC(value)              (((( 1 << 2) - 1) & (value)) << 4)
391 #define AMAZON_EBU_BUSCON1_RECOVC(value)             (((( 1 << 2) - 1) & (value)) << 2)
392 #define AMAZON_EBU_BUSCON1_CMULT(value)              (((( 1 << 2) - 1) & (value)) << 0)
393       
394 /***EBU Bus Configuration Register 2***/ 
395 #define AMAZON_EBU_BUSCON2                  ((volatile u32*)(AMAZON_EBU+ 0x0068))
396 #define AMAZON_EBU_BUSCON2_WRDIS                          (1 << 31)
397 #define AMAZON_EBU_BUSCON2_ALEC(value)               (((( 1 << 2) - 1) & (value)) << 29)
398 #define AMAZON_EBU_BUSCON2_BCGEN(value)              (((( 1 << 2) - 1) & (value)) << 27)
399 #define AMAZON_EBU_BUSCON2_AGEN(value)               (((( 1 << 2) - 1) & (value)) << 24)
400 #define AMAZON_EBU_BUSCON2_CMULTR(value)             (((( 1 << 2) - 1) & (value)) << 22)
401 #define AMAZON_EBU_BUSCON2_WAIT(value)               (((( 1 << 2) - 1) & (value)) << 20)
402 #define AMAZON_EBU_BUSCON2_WAITINV                      (1 << 19)
403 #define AMAZON_EBU_BUSCON2_SETUP                          (1 << 18)
404 #define AMAZON_EBU_BUSCON2_PORTW(value)              (((( 1 << 2) - 1) & (value)) << 16)
405 #define AMAZON_EBU_BUSCON2_WAITRDC(value)            (((( 1 << 7) - 1) & (value)) << 9)
406 #define AMAZON_EBU_BUSCON2_WAITWRC(value)            (((( 1 << 3) - 1) & (value)) << 6)
407 #define AMAZON_EBU_BUSCON2_HOLDC(value)              (((( 1 << 2) - 1) & (value)) << 4)
408 #define AMAZON_EBU_BUSCON2_RECOVC(value)             (((( 1 << 2) - 1) & (value)) << 2)
409 #define AMAZON_EBU_BUSCON2_CMULT(value)              (((( 1 << 2) - 1) & (value)) << 0)         
410          
411 /***********************************************************************/
412 /*  Module      :  SDRAM register address and bits                     */
413 /***********************************************************************/
414          
415 #define AMAZON_SDRAM                        (KSEG1+0x1F800000)
416 /***********************************************************************/   
417
418       
419 /***MC Access Error Cause Register***/ 
420 #define AMAZON_SDRAM_MC_ERRCAUSE                  ((volatile u32*)(AMAZON_SDRAM+ 0x0010))
421 #define AMAZON_SDRAM_MC_ERRCAUSE_ERR                              (1 << 31)
422 #define AMAZON_SDRAM_MC_ERRCAUSE_PORT(value)               (((( 1 << 4) - 1) & (value)) << 16)
423 #define AMAZON_SDRAM_MC_ERRCAUSE_CAUSE(value)              (((( 1 << 2) - 1) & (value)) << 0)
424 #define AMAZON_SDRAM_MC_ERRCAUSE_Res(value)                (((( 1 << NaN) - 1) & (value)) << NaN)
425       
426 /***MC Access Error Address Register***/ 
427 #define AMAZON_SDRAM_MC_ERRADDR                   ((volatile u32*)(AMAZON_SDRAM+ 0x0020))
428 #define AMAZON_SDRAM_MC_ERRADDR_ADDR
429       
430 /***MC I/O General Purpose Register***/ 
431 #define AMAZON_SDRAM_MC_IOGP                      ((volatile u32*)(AMAZON_SDRAM+ 0x0100))
432 #define AMAZON_SDRAM_MC_IOGP_GPR6(value)               (((( 1 << 4) - 1) & (value)) << 28)
433 #define AMAZON_SDRAM_MC_IOGP_GPR5(value)               (((( 1 << 4) - 1) & (value)) << 24)
434 #define AMAZON_SDRAM_MC_IOGP_GPR4(value)               (((( 1 << 4) - 1) & (value)) << 20)
435 #define AMAZON_SDRAM_MC_IOGP_GPR3(value)               (((( 1 << 4) - 1) & (value)) << 16)
436 #define AMAZON_SDRAM_MC_IOGP_GPR2(value)               (((( 1 << 4) - 1) & (value)) << 12)
437 #define AMAZON_SDRAM_MC_IOGP_CPS                              (1 << 11)
438 #define AMAZON_SDRAM_MC_IOGP_CLKDELAY(value)          (((( 1 << 3) - 1) & (value)) << 8)
439 #define AMAZON_SDRAM_MC_IOGP_CLKRAT(value)             (((( 1 << 4) - 1) & (value)) << 4)
440 #define AMAZON_SDRAM_MC_IOGP_RDDEL(value)              (((( 1 << 4) - 1) & (value)) << 0)
441       
442 /***MC Self Refresh Register***/ 
443 #define AMAZON_SDRAM_MC_SELFRFSH                  ((volatile u32*)(AMAZON_SDRAM+ 0x01A0))
444 #define AMAZON_SDRAM_MC_SELFRFSH_PWDS                            (1 << 1)
445 #define AMAZON_SDRAM_MC_SELFRFSH_PWD                              (1 << 0)
446 #define AMAZON_SDRAM_MC_SELFRFSH_Res(value)                (((( 1 << 30) - 1) & (value)) << 2)
447       
448 /***MC Enable Register***/ 
449 #define AMAZON_SDRAM_MC_CTRLENA                   ((volatile u32*)(AMAZON_SDRAM+ 0x0110))
450 #define AMAZON_SDRAM_MC_CTRLENA_ENA                              (1 << 0)
451 #define AMAZON_SDRAM_MC_CTRLENA_Res(value)                (((( 1 << 31) - 1) & (value)) << 1)
452       
453 /***MC Mode Register Setup Code***/ 
454 #define AMAZON_SDRAM_MC_MRSCODE                   ((volatile u32*)(AMAZON_SDRAM+ 0x0120))
455 #define AMAZON_SDRAM_MC_MRSCODE_UMC(value)                (((( 1 << 5) - 1) & (value)) << 7)
456 #define AMAZON_SDRAM_MC_MRSCODE_CL(value)                (((( 1 << 3) - 1) & (value)) << 4)
457 #define AMAZON_SDRAM_MC_MRSCODE_WT                              (1 << 3)
458 #define AMAZON_SDRAM_MC_MRSCODE_BL(value)                (((( 1 << 3) - 1) & (value)) << 0)
459       
460 /***MC Configuration Data-word Width Register***/ 
461 #define AMAZON_SDRAM_MC_CFGDW                    ((volatile u32*)(AMAZON_SDRAM+ 0x0130))
462 #define AMAZON_SDRAM_MC_CFGDW_DW(value)                (((( 1 << 4) - 1) & (value)) << 0)
463 #define AMAZON_SDRAM_MC_CFGDW_Res(value)                (((( 1 << 28) - 1) & (value)) << 4)
464       
465 /***MC Configuration Physical Bank 0 Register***/ 
466 #define AMAZON_SDRAM_MC_CFGPB0                    ((volatile u32*)(AMAZON_SDRAM+ 0x140))
467 #define AMAZON_SDRAM_MC_CFGPB0_MCSEN0(value)             (((( 1 << 4) - 1) & (value)) << 12)
468 #define AMAZON_SDRAM_MC_CFGPB0_BANKN0(value)             (((( 1 << 4) - 1) & (value)) << 8)
469 #define AMAZON_SDRAM_MC_CFGPB0_ROWW0(value)              (((( 1 << 4) - 1) & (value)) << 4)
470 #define AMAZON_SDRAM_MC_CFGPB0_COLW0(value)              (((( 1 << 4) - 1) & (value)) << 0)
471 #define AMAZON_SDRAM_MC_CFGPB0_Res(value)                (((( 1 << 16) - 1) & (value)) << 16)
472       
473 /***MC Latency Register***/ 
474 #define AMAZON_SDRAM_MC_LATENCY                   ((volatile u32*)(AMAZON_SDRAM+ 0x0180))
475 #define AMAZON_SDRAM_MC_LATENCY_TRP(value)                (((( 1 << 4) - 1) & (value)) << 16)
476 #define AMAZON_SDRAM_MC_LATENCY_TRAS(value)               (((( 1 << 4) - 1) & (value)) << 12)
477 #define AMAZON_SDRAM_MC_LATENCY_TRCD(value)               (((( 1 << 4) - 1) & (value)) << 8)
478 #define AMAZON_SDRAM_MC_LATENCY_TDPL(value)               (((( 1 << 4) - 1) & (value)) << 4)
479 #define AMAZON_SDRAM_MC_LATENCY_TDAL(value)               (((( 1 << 4) - 1) & (value)) << 0)
480 #define AMAZON_SDRAM_MC_LATENCY_Res(value)                (((( 1 << 12) - 1) & (value)) << 20)
481       
482 /***MC Refresh Cycle Time Register***/ 
483 #define AMAZON_SDRAM_MC_TREFRESH                  ((volatile u32*)(AMAZON_SDRAM+ 0x0190))
484 #define AMAZON_SDRAM_MC_TREFRESH_TREF(value)               (((( 1 << 13) - 1) & (value)) << 0)
485 #define AMAZON_SDRAM_MC_TREFRESH_Res(value)                (((( 1 << 19) - 1) & (value)) << 13)         
486          
487 /***********************************************************************/
488 /*  Module      :  GPTU register address and bits                      */
489 /***********************************************************************/
490          
491 #define AMAZON_GPTU                         (KSEG1+0x10100A00)
492 /***********************************************************************/   
493
494       
495 /***GPT Clock Control Register***/ 
496 #define AMAZON_GPTU_CLC                      ((volatile u32*)(AMAZON_GPTU+ 0x0000))
497 #define AMAZON_GPTU_CLC_RMC(value)                (((( 1 << 8) - 1) & (value)) << 8)
498 #define AMAZON_GPTU_CLC_DISS                            (1 << 1)
499 #define AMAZON_GPTU_CLC_DISR                            (1 << 0)
500       
501 /***GPT Timer 3 Control Register***/ 
502 #define AMAZON_GPTU_T3CON                    ((volatile u32*)(AMAZON_GPTU+ 0x0014))
503 #define AMAZON_GPTU_T3CON_T3RDIR                        (1 << 15)
504 #define AMAZON_GPTU_T3CON_T3CHDIR                      (1 << 14)
505 #define AMAZON_GPTU_T3CON_T3EDGE                        (1 << 13)
506 #define AMAZON_GPTU_T3CON_BPS1(value)               (((( 1 << 2) - 1) & (value)) << 11)
507 #define AMAZON_GPTU_T3CON_T3OTL                          (1 << 10)
508 #define AMAZON_GPTU_T3CON_T3UD                            (1 << 7)
509 #define AMAZON_GPTU_T3CON_T3R                              (1 << 6)
510 #define AMAZON_GPTU_T3CON_T3M(value)                (((( 1 << 3) - 1) & (value)) << 3)
511 #define AMAZON_GPTU_T3CON_T3I(value)                (((( 1 << 3) - 1) & (value)) << 0)
512       
513 /***GPT Write Hardware Modified Timer 3 Control Register 
514 If set and clear bit are written concurrently with 1, the associated bit is not changed.***/
515 #define AMAZON_GPTU_WHBT3CON                 ((volatile u32*)(AMAZON_GPTU+ 0x004C))
516 #define AMAZON_GPTU_WHBT3CON_SETT3CHDIR                (1 << 15)
517 #define AMAZON_GPTU_WHBT3CON_CLRT3CHDIR                (1 << 14)
518 #define AMAZON_GPTU_WHBT3CON_SETT3EDGE                  (1 << 13)
519 #define AMAZON_GPTU_WHBT3CON_CLRT3EDGE                  (1 << 12)
520 #define AMAZON_GPTU_WHBT3CON_SETT3OTL                  (1 << 11)
521 #define AMAZON_GPTU_WHBT3CON_CLRT3OTL                  (1 << 10)
522       
523 /***GPT Timer 2 Control Register***/ 
524 #define AMAZON_GPTU_T2CON                    ((volatile u32*)(AMAZON_GPTU+ 0x0010))
525 #define AMAZON_GPTU_T2CON_TxRDIR                        (1 << 15)
526 #define AMAZON_GPTU_T2CON_TxCHDIR                      (1 << 14)
527 #define AMAZON_GPTU_T2CON_TxEDGE                        (1 << 13)
528 #define AMAZON_GPTU_T2CON_TxIRDIS                      (1 << 12)
529 #define AMAZON_GPTU_T2CON_TxRC                            (1 << 9)
530 #define AMAZON_GPTU_T2CON_TxUD                            (1 << 7)
531 #define AMAZON_GPTU_T2CON_TxR                              (1 << 6)
532 #define AMAZON_GPTU_T2CON_TxM(value)                (((( 1 << 3) - 1) & (value)) << 3)
533 #define AMAZON_GPTU_T2CON_TxI(value)                (((( 1 << 3) - 1) & (value)) << 0)
534       
535 /***GPT Timer 4 Control Register***/ 
536 #define AMAZON_GPTU_T4CON                    ((volatile u32*)(AMAZON_GPTU+ 0x0018))
537 #define AMAZON_GPTU_T4CON_TxRDIR                        (1 << 15)
538 #define AMAZON_GPTU_T4CON_TxCHDIR                      (1 << 14)
539 #define AMAZON_GPTU_T4CON_TxEDGE                        (1 << 13)
540 #define AMAZON_GPTU_T4CON_TxIRDIS                      (1 << 12)
541 #define AMAZON_GPTU_T4CON_TxRC                            (1 << 9)
542 #define AMAZON_GPTU_T4CON_TxUD                            (1 << 7)
543 #define AMAZON_GPTU_T4CON_TxR                              (1 << 6)
544 #define AMAZON_GPTU_T4CON_TxM(value)                (((( 1 << 3) - 1) & (value)) << 3)
545 #define AMAZON_GPTU_T4CON_TxI(value)                (((( 1 << 3) - 1) & (value)) << 0)
546       
547 /***GPT Write HW Modified Timer 2 Control Register If set
548  and clear bit are written concurrently with 1, the associated bit is not changed.***/
549 #define AMAZON_GPTU_WHBT2CON                 ((volatile u32*)(AMAZON_GPTU+ 0x0048))
550 #define AMAZON_GPTU_WHBT2CON_SETTxCHDIR                (1 << 15)
551 #define AMAZON_GPTU_WHBT2CON_CLRTxCHDIR                (1 << 14)
552 #define AMAZON_GPTU_WHBT2CON_SETTxEDGE                  (1 << 13)
553 #define AMAZON_GPTU_WHBT2CON_CLRTxEDGE                  (1 << 12)
554       
555 /***GPT Write HW Modified Timer 4 Control Register If set
556  and clear bit are written concurrently with 1, the associated bit is not changed.***/
557 #define AMAZON_GPTU_WHBT4CON                 ((volatile u32*)(AMAZON_GPTU+ 0x0050))
558 #define AMAZON_GPTU_WHBT4CON_SETTxCHDIR                (1 << 15)
559 #define AMAZON_GPTU_WHBT4CON_CLRTxCHDIR                (1 << 14)
560 #define AMAZON_GPTU_WHBT4CON_SETTxEDGE                  (1 << 13)
561 #define AMAZON_GPTU_WHBT4CON_CLRTxEDGE                  (1 << 12)
562       
563 /***GPT Capture Reload Register***/ 
564 #define AMAZON_GPTU_CAPREL                   ((volatile u32*)(AMAZON_GPTU+ 0x0030))
565 #define AMAZON_GPTU_CAPREL_CAPREL(value)             (((( 1 << 16) - 1) & (value)) << 0)
566       
567 /***GPT Timer 2 Register***/ 
568 #define AMAZON_GPTU_T2                       ((volatile u32*)(AMAZON_GPTU+ 0x0034))
569 #define AMAZON_GPTU_T2_TVAL(value)               (((( 1 << 16) - 1) & (value)) << 0)
570       
571 /***GPT Timer 3 Register***/ 
572 #define AMAZON_GPTU_T3                       ((volatile u32*)(AMAZON_GPTU+ 0x0038))
573 #define AMAZON_GPTU_T3_TVAL(value)               (((( 1 << 16) - 1) & (value)) << 0)
574       
575 /***GPT Timer 4 Register***/ 
576 #define AMAZON_GPTU_T4                       ((volatile u32*)(AMAZON_GPTU+ 0x003C))
577 #define AMAZON_GPTU_T4_TVAL(value)               (((( 1 << 16) - 1) & (value)) << 0)
578       
579 /***GPT Timer 5 Register***/ 
580 #define AMAZON_GPTU_T5                       ((volatile u32*)(AMAZON_GPTU+ 0x0040))
581 #define AMAZON_GPTU_T5_TVAL(value)               (((( 1 << 16) - 1) & (value)) << 0)
582       
583 /***GPT Timer 6 Register***/ 
584 #define AMAZON_GPTU_T6                       ((volatile u32*)(AMAZON_GPTU+ 0x0044))
585 #define AMAZON_GPTU_T6_TVAL(value)               (((( 1 << 16) - 1) & (value)) << 0)
586       
587 /***GPT Timer 6 Control Register***/ 
588 #define AMAZON_GPTU_T6CON                    ((volatile u32*)(AMAZON_GPTU+ 0x0020))
589 #define AMAZON_GPTU_T6CON_T6SR                            (1 << 15)
590 #define AMAZON_GPTU_T6CON_T6CLR                          (1 << 14)
591 #define AMAZON_GPTU_T6CON_BPS2(value)               (((( 1 << 2) - 1) & (value)) << 11)
592 #define AMAZON_GPTU_T6CON_T6OTL                          (1 << 10)
593 #define AMAZON_GPTU_T6CON_T6UD                            (1 << 7)
594 #define AMAZON_GPTU_T6CON_T6R                              (1 << 6)
595 #define AMAZON_GPTU_T6CON_T6M(value)                (((( 1 << 3) - 1) & (value)) << 3)
596 #define AMAZON_GPTU_T6CON_T6I(value)                (((( 1 << 3) - 1) & (value)) << 0)
597       
598 /***GPT Write HW Modified Timer 6 Control Register If set
599  and clear bit are written concurrently with 1, the associated bit is not changed.***/
600 #define AMAZON_GPTU_WHBT6CON                 ((volatile u32*)(AMAZON_GPTU+ 0x0054))
601 #define AMAZON_GPTU_WHBT6CON_SETT6OTL                  (1 << 11)
602 #define AMAZON_GPTU_WHBT6CON_CLRT6OTL                  (1 << 10)
603       
604 /***GPT Timer 5 Control Register***/ 
605 #define AMAZON_GPTU_T5CON                    ((volatile u32*)(AMAZON_GPTU+ 0x001C))
606 #define AMAZON_GPTU_T5CON_T5SC                            (1 << 15)
607 #define AMAZON_GPTU_T5CON_T5CLR                          (1 << 14)
608 #define AMAZON_GPTU_T5CON_CI(value)                (((( 1 << 2) - 1) & (value)) << 12)
609 #define AMAZON_GPTU_T5CON_T5CC                            (1 << 11)
610 #define AMAZON_GPTU_T5CON_CT3                              (1 << 10)
611 #define AMAZON_GPTU_T5CON_T5RC                            (1 << 9)
612 #define AMAZON_GPTU_T5CON_T5UDE                          (1 << 8)
613 #define AMAZON_GPTU_T5CON_T5UD                            (1 << 7)
614 #define AMAZON_GPTU_T5CON_T5R                              (1 << 6)
615 #define AMAZON_GPTU_T5CON_T5M(value)                (((( 1 << 3) - 1) & (value)) << 3)
616 #define AMAZON_GPTU_T5CON_T5I(value)                (((( 1 << 3) - 1) & (value)) << 0)          
617          
618
619 /***********************************************************************/
620 /*  Module      :  ASC register address and bits                       */
621 /***********************************************************************/
622          
623 #define AMAZON_ASC                          (KSEG1+0x10100400)
624 /***********************************************************************/   
625
626       
627 /***ASC Port Input Select Register***/ 
628 #define AMAZON_ASC_PISEL                    ((volatile u32*)(AMAZON_ASC+ 0x0004))
629 #define AMAZON_ASC_PISEL_RIS                              (1 << 0)
630       
631 /***ASC Control Register***/ 
632 #define AMAZON_ASC_CON                      ((volatile u32*)(AMAZON_ASC+ 0x0010))
633 #define AMAZON_ASC_CON_R                              (1 << 15)
634 #define AMAZON_ASC_CON_LB                              (1 << 14)
635 #define AMAZON_ASC_CON_BRS                              (1 << 13)
636 #define AMAZON_ASC_CON_ODD                              (1 << 12)
637 #define AMAZON_ASC_CON_FDE                              (1 << 11)
638 #define AMAZON_ASC_CON_OE                              (1 << 10)
639 #define AMAZON_ASC_CON_FE                              (1 << 9)
640 #define AMAZON_ASC_CON_PE                              (1 << 8)
641 #define AMAZON_ASC_CON_OEN                              (1 << 7)
642 #define AMAZON_ASC_CON_FEN                              (1 << 6)
643 #define AMAZON_ASC_CON_PENRXDI                  (1 << 5)
644 #define AMAZON_ASC_CON_REN                              (1 << 4)
645 #define AMAZON_ASC_CON_STP                              (1 << 3)
646 #define AMAZON_ASC_CON_M(value)                (((( 1 << 3) - 1) & (value)) << 0)
647  
648 /***ASC Write Hardware Modified Control Register***/ 
649 #define AMAZON_ASC_WHBCON                   ((volatile u32*)(AMAZON_ASC+ 0x0050))
650 #define AMAZON_ASC_WHBCON_SETOE                          (1 << 13)
651 #define AMAZON_ASC_WHBCON_SETFE                          (1 << 12)
652 #define AMAZON_ASC_WHBCON_SETPE                          (1 << 11)
653 #define AMAZON_ASC_WHBCON_CLROE                          (1 << 10)
654 #define AMAZON_ASC_WHBCON_CLRFE                          (1 << 9)
655 #define AMAZON_ASC_WHBCON_CLRPE                          (1 << 8)
656 #define AMAZON_ASC_WHBCON_SETREN                        (1 << 5)
657 #define AMAZON_ASC_WHBCON_CLRREN                        (1 << 4)
658       
659 /***ASC Baudrate Timer/Reload Register***/ 
660 #define AMAZON_ASC_BTR                      ((volatile u32*)(AMAZON_ASC+ 0x0014))
661 #define AMAZON_ASC_BTR_BR_VALUE(value)          (((( 1 << 13) - 1) & (value)) << 0)
662       
663 /***ASC Fractional Divider Register***/ 
664 #define AMAZON_ASC_FDV                      ((volatile u32*)(AMAZON_ASC+ 0x0018))
665 #define AMAZON_ASC_FDV_FD_VALUE(value)          (((( 1 << 9) - 1) & (value)) << 0)
666       
667 /***ASC IrDA Pulse Mode/Width Register***/ 
668 #define AMAZON_ASC_PMW                      ((volatile u32*)(AMAZON_ASC+ 0x001C))
669 #define AMAZON_ASC_PMW_IRPW                            (1 << 8)
670 #define AMAZON_ASC_PMW_PW_VALUE(value)          (((( 1 << 8) - 1) & (value)) << 0)
671       
672 /***ASC Transmit Buffer Register***/ 
673 #define AMAZON_ASC_TBUF                    ((volatile u32*)(AMAZON_ASC+ 0x0020))
674 #define AMAZON_ASC_TBUF_TD_VALUE(value)          (((( 1 << 9) - 1) & (value)) << 0)
675       
676 /***ASC Receive Buffer Register***/ 
677 #define AMAZON_ASC_RBUF                    ((volatile u32*)(AMAZON_ASC+ 0x0024))
678 #define AMAZON_ASC_RBUF_RD_VALUE(value)          (((( 1 << 9) - 1) & (value)) << 0)
679       
680 /***ASC Autobaud Control Register***/ 
681 #define AMAZON_ASC_ABCON                    ((volatile u32*)(AMAZON_ASC+ 0x0030))
682 #define AMAZON_ASC_ABCON_RXINV                          (1 << 11)
683 #define AMAZON_ASC_ABCON_TXINV                          (1 << 10)
684 #define AMAZON_ASC_ABCON_ABEM(value)               (((( 1 << 2) - 1) & (value)) << 8)
685 #define AMAZON_ASC_ABCON_FCDETEN                      (1 << 4)
686 #define AMAZON_ASC_ABCON_ABDETEN                      (1 << 3)
687 #define AMAZON_ASC_ABCON_ABSTEN                        (1 << 2)
688 #define AMAZON_ASC_ABCON_AUREN                          (1 << 1)
689 #define AMAZON_ASC_ABCON_ABEN                            (1 << 0)
690       
691 /***Receive FIFO Control Register***/ 
692 #define AMAZON_ASC_RXFCON                       ((volatile u32*)(AMAZON_ASC+ 0x0040))
693 #define AMAZON_ASC_RXFCON_RXFITL(value)             (((( 1 << 6) - 1) & (value)) << 8)
694 #define AMAZON_ASC_RXFCON_RXTMEN                        (1 << 2)
695 #define AMAZON_ASC_RXFCON_RXFFLU                        (1 << 1)
696 #define AMAZON_ASC_RXFCON_RXFEN                          (1 << 0)
697       
698 /***Transmit FIFO Control Register***/ 
699 #define AMAZON_ASC_TXFCON                       ((volatile u32*)(AMAZON_ASC+ 0x0044))
700 #define AMAZON_ASC_TXFCON_TXFITL(value)             (((( 1 << 6) - 1) & (value)) << 8)
701 #define AMAZON_ASC_TXFCON_TXTMEN                        (1 << 2)
702 #define AMAZON_ASC_TXFCON_TXFFLU                        (1 << 1)
703 #define AMAZON_ASC_TXFCON_TXFEN                          (1 << 0)
704       
705 /***FIFO Status Register***/ 
706 #define AMAZON_ASC_FSTAT                        ((volatile u32*)(AMAZON_ASC+ 0x0048))
707 #define AMAZON_ASC_FSTAT_TXFFL(value)              (((( 1 << 6) - 1) & (value)) << 8)
708 #define AMAZON_ASC_FSTAT_RXFFL(value)              (((( 1 << 6) - 1) & (value)) << 0)
709       
710 /***ASC Write HW Modified Autobaud Control Register***/ 
711 #define AMAZON_ASC_WHBABCON                 ((volatile u32*)(AMAZON_ASC+ 0x0054))
712 #define AMAZON_ASC_WHBABCON_SETABEN                      (1 << 1)
713 #define AMAZON_ASC_WHBABCON_CLRABEN                      (1 << 0)
714       
715 /***ASC Autobaud Status Register***/ 
716 #define AMAZON_ASC_ABSTAT                   ((volatile u32*)(AMAZON_ASC+ 0x0034))
717 #define AMAZON_ASC_ABSTAT_DETWAIT                      (1 << 4)
718 #define AMAZON_ASC_ABSTAT_SCCDET                        (1 << 3)
719 #define AMAZON_ASC_ABSTAT_SCSDET                        (1 << 2)
720 #define AMAZON_ASC_ABSTAT_FCCDET                        (1 << 1)
721 #define AMAZON_ASC_ABSTAT_FCSDET                        (1 << 0)
722       
723 /***ASC Write HW Modified Autobaud Status Register***/ 
724 #define AMAZON_ASC_WHBABSTAT                 ((volatile u32*)(AMAZON_ASC+ 0x0058))
725 #define AMAZON_ASC_WHBABSTAT_SETDETWAIT                (1 << 9)
726 #define AMAZON_ASC_WHBABSTAT_CLRDETWAIT                (1 << 8)
727 #define AMAZON_ASC_WHBABSTAT_SETSCCDET                  (1 << 7)
728 #define AMAZON_ASC_WHBABSTAT_CLRSCCDET                  (1 << 6)
729 #define AMAZON_ASC_WHBABSTAT_SETSCSDET                  (1 << 5)
730 #define AMAZON_ASC_WHBABSTAT_CLRSCSDET                  (1 << 4)
731 #define AMAZON_ASC_WHBABSTAT_SETFCCDET                  (1 << 3)
732 #define AMAZON_ASC_WHBABSTAT_CLRFCCDET                  (1 << 2)
733 #define AMAZON_ASC_WHBABSTAT_SETFCSDET                  (1 << 1)
734 #define AMAZON_ASC_WHBABSTAT_CLRFCSDET                  (1 << 0)
735       
736 /***ASC Clock Control Register***/ 
737 #define AMAZON_ASC_CLC                      ((volatile u32*)(AMAZON_ASC+ 0x0000))
738 #define AMAZON_ASC_CLC_RMC(value)                (((( 1 << 8) - 1) & (value)) << 8)
739 #define AMAZON_ASC_CLC_DISS                            (1 << 1)
740 #define AMAZON_ASC_CLC_DISR                            (1 << 0)         
741
742 /***ASC IRNCR0 **/
743 #define AMAZON_ASC_IRNCR0                       ((volatile u32*)(AMAZON_ASC+ 0x00FC))
744 /***ASC IRNCR1 **/
745 #define AMAZON_ASC_IRNCR1                       ((volatile u32*)(AMAZON_ASC+ 0x00F8))
746 #define ASC_IRNCR_TIR   0x1
747 #define ASC_IRNCR_RIR   0x2
748 #define ASC_IRNCR_EIR   0x4
749 /***********************************************************************/
750 /*  Module      :  DMA register address and bits                       */
751 /***********************************************************************/
752          
753 #define AMAZON_DMA                              (KSEG1+0x10103000)
754 /***********************************************************************/   
755 #define AMAZON_DMA_CH_ON                AMAZON_DMA+0x28
756 #define AMAZON_DMA_CH_RST               AMAZON_DMA+0x2c
757 #define AMAZON_DMA_CH0_ISR              AMAZON_DMA+0x30
758 #define AMAZON_DMA_CH1_ISR              AMAZON_DMA+0x34
759 #define AMAZON_DMA_CH2_ISR              AMAZON_DMA+0x38
760 #define AMAZON_DMA_CH3_ISR              AMAZON_DMA+0x3c
761 #define AMAZON_DMA_CH4_ISR              AMAZON_DMA+0x40
762 #define AMAZON_DMA_CH5_ISR              AMAZON_DMA+0x44
763 #define AMAZON_DMA_CH6_ISR              AMAZON_DMA+0x48
764 #define AMAZON_DMA_CH7_ISR              AMAZON_DMA+0x4c
765 #define AMAZON_DMA_CH8_ISR              AMAZON_DMA+0x50
766 #define AMAZON_DMA_CH9_ISR              AMAZON_DMA+0x54
767 #define AMAZON_DMA_CH10_ISR             AMAZON_DMA+0x58
768 #define AMAZON_DMA_CH11_ISR             AMAZON_DMA+0x5c
769 #define AMAZON_DMA_CH0_MSK              AMAZON_DMA+0x60
770 #define AMAZON_DMA_CH1_MSK              AMAZON_DMA+0x64
771 #define AMAZON_DMA_CH2_MSK              AMAZON_DMA+0x68
772 #define AMAZON_DMA_CH3_MSK              AMAZON_DMA+0x6c
773 #define AMAZON_DMA_CH4_MSK              AMAZON_DMA+0x70
774 #define AMAZON_DMA_CH5_MSK              AMAZON_DMA+0x74
775 #define AMAZON_DMA_CH6_MSK              AMAZON_DMA+0x78
776 #define AMAZON_DMA_CH7_MSK              AMAZON_DMA+0x7c
777 #define AMAZON_DMA_CH8_MSK              AMAZON_DMA+0x80
778 #define AMAZON_DMA_CH9_MSK              AMAZON_DMA+0x84
779 #define AMAZON_DMA_CH10_MSK             AMAZON_DMA+0x88
780 #define AMAZON_DMA_CH11_MSK             AMAZON_DMA+0x8c
781 #define AMAZON_DMA_Desc_BA              AMAZON_DMA+0x90
782 #define AMAZON_DMA_CH0_DES_LEN          AMAZON_DMA+0x94
783 #define AMAZON_DMA_CH1_DES_LEN          AMAZON_DMA+0x98
784 #define AMAZON_DMA_CH2_DES_LEN          AMAZON_DMA+0x9c
785 #define AMAZON_DMA_CH3_DES_LEN          AMAZON_DMA+0xa0
786 #define AMAZON_DMA_CH4_DES_LEN          AMAZON_DMA+0xa4
787 #define AMAZON_DMA_CH5_DES_LEN          AMAZON_DMA+0xa8
788 #define AMAZON_DMA_CH6_DES_LEN          AMAZON_DMA+0xac
789 #define AMAZON_DMA_CH7_DES_LEN          AMAZON_DMA+0xb0
790 #define AMAZON_DMA_CH8_DES_LEN          AMAZON_DMA+0xb4
791 #define AMAZON_DMA_CH9_DES_LEN          AMAZON_DMA+0xb8
792 #define AMAZON_DMA_CH10_DES_LEN         AMAZON_DMA+0xbc
793 #define AMAZON_DMA_CH11_DES_LEN         AMAZON_DMA+0xc0
794 #define AMAZON_DMA_CH1_DES_OFST         AMAZON_DMA+0xc4
795 #define AMAZON_DMA_CH2_DES_OFST         AMAZON_DMA+0xc8
796 #define AMAZON_DMA_CH3_DES_OFST         AMAZON_DMA+0xcc
797 #define AMAZON_DMA_CH4_DES_OFST         AMAZON_DMA+0xd0
798 #define AMAZON_DMA_CH5_DES_OFST         AMAZON_DMA+0xd4
799 #define AMAZON_DMA_CH6_DES_OFST         AMAZON_DMA+0xd8
800 #define AMAZON_DMA_CH7_DES_OFST         AMAZON_DMA+0xdc
801 #define AMAZON_DMA_CH8_DES_OFST         AMAZON_DMA+0xe0
802 #define AMAZON_DMA_CH9_DES_OFST         AMAZON_DMA+0xe4
803 #define AMAZON_DMA_CH10_DES_OFST        AMAZON_DMA+0xe8
804 #define AMAZON_DMA_CH11_DES_OFST        AMAZON_DMA+0xec
805 #define AMAZON_DMA_SW_BL                AMAZON_DMA+0xf0
806 #define AMAZON_DMA_TPE_BL               AMAZON_DMA+0xf4
807 #define AMAZON_DMA_DPlus2FPI_BL         AMAZON_DMA+0xf8
808 #define AMAZON_DMA_GRX_BUF_LEN          AMAZON_DMA+0xfc
809 #define AMAZON_DMA_DMA_ECON_REG         AMAZON_DMA+0x100
810 #define AMAZON_DMA_POLLING_REG          AMAZON_DMA+0x104
811 #define AMAZON_DMA_CH_WGT               AMAZON_DMA+0x108
812 #define AMAZON_DMA_TX_WGT               AMAZON_DMA+0x10c
813 #define AMAZON_DMA_DPLus2FPI_CLASS      AMAZON_DMA+0x110
814 #define AMAZON_DMA_COMB_ISR             AMAZON_DMA+0x114
815
816 //channel reset
817 #define SWITCH1_RST_MASK        0x83    /* Switch1 channel mask */
818 #define SWITCH2_RST_MASK        0x10C   /* Switch1 channel mask */
819 #define TPE_RST_MASK            0x630   /* TPE channel mask */
820 #define DPlus2FPI_RST_MASK      0x840   /*  DPlusFPI channel mask */
821
822 //ISR
823 #define DMA_ISR_RDERR                   0x20
824 #define DMA_ISR_CMDCPT                  0x10
825 #define DMA_ISR_CPT                     0x8
826 #define DMA_ISR_DURR                    0x4
827 #define DMA_ISR_EOP                     0x2
828 #define DMA_DESC_BYTEOFF_SHIFT          23
829
830 #define DMA_POLLING_ENABLE              0x80000000
831 #define DMA_POLLING_CNT                 0x50    /*minimum 0x10, max 0xfff0*/
832
833 /***********************************************************************/
834 /*  Module      :  Debug register address and bits                     */
835 /***********************************************************************/
836          
837 #define AMAZON_DEBUG                        (KSEG1+0x1F106000)
838 /***********************************************************************/   
839
840       
841 /***MCD Break System Control Register***/ 
842 #define AMAZON_DEBUG_MCD_BSCR                           ((volatile u32*)(AMAZON_DEBUG+ 0x0000))
843
844 /***PMC Performance Counter Control Register0***/
845 #define AMAZON_DEBUG_PMC_PCCR0                          ((volatile u32*)(AMAZON_DEBUG+ 0x0010))
846
847 /***PMC Performance Counter Control Register1***/
848 #define AMAZON_DEBUG_PMC_PCCR1                          ((volatile u32*)(AMAZON_DEBUG+ 0x0014))
849
850 /***PMC Performance Counter Register0***/
851 #define AMAZON_DEBUG_PMC_PCR0                           ((volatile u32*)(AMAZON_DEBUG+ 0x0018))
852
853 /*165001:henryhsu:20050603:Source modified by Bing Tao*/
854
855 /***PMC Performance Counter Register1***/
856 //#define AMAZON_DEBUG_PMC_PCR1                          ((volatile u32*)(AMAZON_DEBUG+ 0x0020))
857 #define AMAZON_DEBUG_PMC_PCR1                            ((volatile u32*)(AMAZON_DEBUG+ 0x001c))
858
859 /*165001*/
860
861
862
863 /***MCD Suspend Mode Control Register***/
864 #define AMAZON_DEBUG_MCD_SMCR                           ((volatile u32*)(AMAZON_DEBUG+ 0x0024))
865
866 /***********************************************************************/
867 /*  Module      :  GPIO register address and bits                     */
868 /***********************************************************************/
869          
870 #define AMAZON_GPIO                        (KSEG1+0x10100B00)
871 /***********************************************************************/   
872
873       
874 /***Port 0 Data Output Register (0010H)***/ 
875 #define AMAZON_GPIO_P0_OUT                       ((volatile u32*)(AMAZON_GPIO+ 0x0010))                      
876       
877 /***Port 1 Data Output Register (0040H)***/ 
878 #define AMAZON_GPIO_P1_OUT                       ((volatile u32*)(AMAZON_GPIO+ 0x0040))                      
879       
880 /***Port 0 Data Input Register (0014H)***/ 
881 #define AMAZON_GPIO_P0_IN                        ((volatile u32*)(AMAZON_GPIO+ 0x0014))                      
882       
883 /***Port 1 Data Input Register (0044H)***/ 
884 #define AMAZON_GPIO_P1_IN                        ((volatile u32*)(AMAZON_GPIO+ 0x0044))
885                             
886 /***Port 0 Direction Register (0018H)***/ 
887 #define AMAZON_GPIO_P0_DIR                       ((volatile u32*)(AMAZON_GPIO+ 0x0018))
888       
889 /***Port 1 Direction Register (0048H)***/ 
890 #define AMAZON_GPIO_P1_DIR                       ((volatile u32*)(AMAZON_GPIO+ 0x0048))
891       
892 /***Port 0 Alternate Function Select Register 0 (001C H) ***/
893 #define AMAZON_GPIO_P0_ALTSEL0                    ((volatile u32*)(AMAZON_GPIO+ 0x001C))                      
894       
895 /***Port 1 Alternate Function Select Register 0 (004C H) ***/
896 #define AMAZON_GPIO_P1_ALTSEL0                    ((volatile u32*)(AMAZON_GPIO+ 0x004C))
897                       
898 /***Port 0 Alternate Function Select Register 1 (0020 H) ***/
899 #define AMAZON_GPIO_P0_ALTSEL1                    ((volatile u32*)(AMAZON_GPIO+ 0x0020))
900       
901 /***Port 1 Alternate Function Select Register 0 (0050 H) ***/
902 #define AMAZON_GPIO_P1_ALTSEL1                    ((volatile u32*)(AMAZON_GPIO+ 0x0050))
903       
904 /***Port 0 Open Drain Control Register (0024H)***/ 
905 #define AMAZON_GPIO_P0_OD                        ((volatile u32*)(AMAZON_GPIO+ 0x0024))                      
906       
907 /***Port 1 Open Drain Control Register (0054H)***/ 
908 #define AMAZON_GPIO_P1_OD                        ((volatile u32*)(AMAZON_GPIO+ 0x0054))
909                       
910 /***Port 0 Input Schmitt-Trigger Off Register (0028 H) ***/
911 #define AMAZON_GPIO_P0_STOFF                    ((volatile u32*)(AMAZON_GPIO+ 0x0028))
912       
913 /***Port 1 Input Schmitt-Trigger Off Register (0058 H) ***/
914 #define AMAZON_GPIO_P1_STOFF                    ((volatile u32*)(AMAZON_GPIO+ 0x0058))
915                       
916 /***Port 0 Pull Up/Pull Down Select Register (002C H)***/ 
917 #define AMAZON_GPIO_P0_PUDSEL                    ((volatile u32*)(AMAZON_GPIO+ 0x002C))
918                       
919 /***Port 1 Pull Up/Pull Down Select Register (005C H)***/ 
920 #define AMAZON_GPIO_P1_PUDSEL                    ((volatile u32*)(AMAZON_GPIO+ 0x005C))
921                       
922 /***Port 0 Pull Up Device Enable Register (0030 H)***/ 
923 #define AMAZON_GPIO_P0_PUDEN                    ((volatile u32*)(AMAZON_GPIO+ 0x0030))
924                       
925 /***Port 1 Pull Up Device Enable Register (0060 H)***/ 
926 #define AMAZON_GPIO_P1_PUDEN                    ((volatile u32*)(AMAZON_GPIO+ 0x0060))
927                                                                           
928 /***********************************************************************/
929 /*  Module      :  BIU register address and bits                       */
930 /***********************************************************************/
931          
932 #define AMAZON_BIU                          (KSEG1+0x1FA80000)
933 /***********************************************************************/   
934
935       
936 /***BIU Identification Register***/ 
937 #define AMAZON_BIU_ID                       ((volatile u32*)(AMAZON_BIU+ 0x0000))
938 #define AMAZON_BIU_ID_ARCH                            (1 << 16)
939 #define AMAZON_BIU_ID_ID(value)                (((( 1 << 8) - 1) & (value)) << 8)
940 #define AMAZON_BIU_ID_REV(value)                (((( 1 << 8) - 1) & (value)) << 0)
941       
942 /***BIU Access Error Cause Register***/ 
943 #define AMAZON_BIU_ERRCAUSE                 ((volatile u32*)(AMAZON_BIU+ 0x0100))
944 #define AMAZON_BIU_ERRCAUSE_ERR                              (1 << 31)
945 #define AMAZON_BIU_ERRCAUSE_PORT(value)               (((( 1 << 4) - 1) & (value)) << 16)
946 #define AMAZON_BIU_ERRCAUSE_CAUSE(value)              (((( 1 << 2) - 1) & (value)) << 0)
947       
948 /***BIU Access Error Address Register***/ 
949 #define AMAZON_BIU_ERRADDR                  ((volatile u32*)(AMAZON_BIU+ 0x0108))
950 #define AMAZON_BIU_ERRADDR_ADDR         
951          
952 /***********************************************************************/
953 /*  Module      :  ICU register address and bits                       */
954 /***********************************************************************/
955          
956 #define AMAZON_ICU                                                              (KSEG1+0x1F101000)
957 /***********************************************************************/   
958
959 /***IM0 Interrupt Status Register***/ 
960 #define AMAZON_ICU_IM0_ISR                                              (AMAZON_ICU + 0x0010)
961 #define AMAZON_ICU_IM1_ISR                                              (AMAZON_ICU + 0x0020)
962 #define AMAZON_ICU_IM2_ISR                                              (AMAZON_ICU + 0x0030)
963 #define AMAZON_ICU_IM3_ISR                                              (AMAZON_ICU + 0x0040)
964 #define AMAZON_ICU_IM4_ISR                                              (AMAZON_ICU + 0x0050)
965                         
966 /***IM0 Interrupt Enable Register***/ 
967 #define AMAZON_ICU_IM0_IER                                              (AMAZON_ICU + 0x0014)
968 #define AMAZON_ICU_IM1_IER                                              (AMAZON_ICU + 0x0024)
969 #define AMAZON_ICU_IM2_IER                                              (AMAZON_ICU + 0x0034)
970 #define AMAZON_ICU_IM3_IER                                              (AMAZON_ICU + 0x0044)
971 #define AMAZON_ICU_IM4_IER                                              (AMAZON_ICU + 0x0054)
972
973 /***IM0 Interrupt Output Status Register***/ 
974 #define AMAZON_ICU_IM0_IOSR                                             (AMAZON_ICU + 0x0018)
975 #define AMAZON_ICU_IM1_IOSR                                             (AMAZON_ICU + 0x0028)
976 #define AMAZON_ICU_IM2_IOSR                                             (AMAZON_ICU + 0x0038)
977 #define AMAZON_ICU_IM3_IOSR                                             (AMAZON_ICU + 0x0048)
978 #define AMAZON_ICU_IM4_IOSR                                             (AMAZON_ICU + 0x0058)
979
980 /***IM0 Interrupt Request Set Register***/ 
981 #define AMAZON_ICU_IM0_IRSR                                             (AMAZON_ICU + 0x001c)
982 #define AMAZON_ICU_IM1_IRSR                                             (AMAZON_ICU + 0x002c)
983 #define AMAZON_ICU_IM2_IRSR                                             (AMAZON_ICU + 0x003c)
984 #define AMAZON_ICU_IM3_IRSR                                             (AMAZON_ICU + 0x004c)
985 #define AMAZON_ICU_IM4_IRSR                                             (AMAZON_ICU + 0x005c)
986
987 /***Interrupt Vector Value Register***/
988 #define AMAZON_ICU_IM_VEC                                               (AMAZON_ICU + 0x0060)
989
990 /***Interrupt Vector Value Mask***/
991 #define AMAZON_ICU_IM0_VEC_MASK                                 0x0000001f
992 #define AMAZON_ICU_IM1_VEC_MASK                                 0x000003e0
993 #define AMAZON_ICU_IM2_VEC_MASK                                 0x00007c00
994 #define AMAZON_ICU_IM3_VEC_MASK                                 0x000f8000
995 #define AMAZON_ICU_IM4_VEC_MASK                                 0x01f00000
996
997 /***DMA Interrupt Mask Value***/
998 #define AMAZON_DMA_H_MASK                                               0x00000fff
999                                                                                        
1000 /***External Interrupt Control Register***/
1001 #define AMAZON_ICU_EXTINTCR                                             (AMAZON_ICU + 0x0000)
1002 #define AMAZON_ICU_IRNICR                                               (AMAZON_ICU + 0x0004)   
1003 #define AMAZON_ICU_IRNCR                                                (AMAZON_ICU + 0x0008)   
1004 #define AMAZON_ICU_IRNEN                                                (AMAZON_ICU + 0x000c)
1005
1006 /***********************************************************************/
1007 /*  Module      :   PCI/Card-BUS/PC-Card register address and bits     */
1008 /***********************************************************************/
1009          
1010 #define AMAZON_PCI                              (KSEG1+0x10105400)
1011 #define AMAZON_PCI_CFG_BASE                     (KSEG1+0x11000000)
1012 #define AMAZON_PCI_MEM_BASE                     (KSEG1+0x12000000)
1013
1014 #define CLOCK_CONTROL                           AMAZON_PCI + 0x00000000
1015 #define ARB_CTRL_bit                            1
1016 #define IDENTIFICATION                          AMAZON_PCI + 0x00000004
1017 #define SOFTRESET                               AMAZON_PCI + 0x00000010
1018 #define PCI_FPI_ERROR_ADDRESS                   AMAZON_PCI + 0x00000014
1019 #define FPI_PCI_ERROR_ADDRESS                   AMAZON_PCI + 0x00000018
1020 #define FPI_ERROR_TAG                           AMAZON_PCI + 0x0000001c
1021 #define IRR                                     AMAZON_PCI + 0x00000020
1022 #define IRA_IR                                  AMAZON_PCI + 0x00000024
1023 #define IRM                                     AMAZON_PCI + 0x00000028
1024 #define DMA_COMPLETE_BIT                        0
1025 #define PCI_POWER_CHANGE_BIT                    16
1026 #define PCI_MASTER0_BROKEN_INT_BIT              24
1027 #define PCI_MASTER1_BROKEN_INT_BIT              25
1028 #define PCI_MASTER2_BROKEN_INT_BIT              26
1029 #define EOI                                     AMAZON_PCI + 0x0000002c
1030 #define PCI_MODE                                AMAZON_PCI + 0x00000030
1031 #define PCI_MODE_cfgok_bit                      24
1032 #define DEVICE_VENDOR_ID                        AMAZON_PCI + 0x00000034
1033 #define SUBSYSTEM_VENDOR_ID                     AMAZON_PCI + 0x00000038
1034 #define POWER_MANAGEMENT                        AMAZON_PCI + 0x0000003c
1035 #define CLASS_CODE1                             AMAZON_PCI + 0x00000040
1036 #define BAR11_MASK                              AMAZON_PCI + 0x00000044
1037 #define BAR12_MASK                              AMAZON_PCI + 0x00000048
1038 #define BAR13_MASK                              AMAZON_PCI + 0x0000004c
1039 #define BAR14_MASK                              AMAZON_PCI + 0x00000050
1040 #define BAR15_MASK                              AMAZON_PCI + 0x00000054
1041 #define BAR16_MASK                              AMAZON_PCI + 0x00000058
1042 #define CARDBUS_CIS_POINTER1                    AMAZON_PCI + 0x0000005c
1043 #define SUBSYSTEM_ID1                           AMAZON_PCI + 0x00000060
1044 #define PCI_ADDRESS_MAP_11                      AMAZON_PCI + 0x00000064
1045 #define PCI_ADDRESS_MAP_12                      AMAZON_PCI + 0x00000068
1046 #define PCI_ADDRESS_MAP_13                      AMAZON_PCI + 0x0000006c
1047 #define PCI_ADDRESS_MAP_14                      AMAZON_PCI + 0x00000070
1048 #define PCI_ADDRESS_MAP_15                      AMAZON_PCI + 0x00000074
1049 #define PCI_ADDRESS_MAP_16                      AMAZON_PCI + 0x00000078
1050 #define FPI_SEGMENT_ENABLE                      AMAZON_PCI + 0x0000007c
1051 #define CLASS_CODE2                             AMAZON_PCI + 0x00000080
1052 #define BAR21_MASK                              AMAZON_PCI + 0x00000084
1053 #define BAR22_MASK                              AMAZON_PCI + 0x00000088
1054 #define BAR23_MASK                              AMAZON_PCI + 0x0000008c
1055 #define BAR24_MASK                              AMAZON_PCI + 0x00000090
1056 #define BAR25_MASK                              AMAZON_PCI + 0x00000094
1057 #define BAR26_MASK                              AMAZON_PCI + 0x00000098
1058 #define CARDBUS_CIS_POINTER2                    AMAZON_PCI + 0x0000009c
1059 #define SUBSYSTEM_ID2                           AMAZON_PCI + 0x000000a0
1060 #define PCI_ADDRESS_MAP_21                      AMAZON_PCI + 0x000000a4
1061 #define PCI_ADDRESS_MAP_22                      AMAZON_PCI + 0x000000a8
1062 #define PCI_ADDRESS_MAP_23                      AMAZON_PCI + 0x000000ac
1063 #define PCI_ADDRESS_MAP_24                      AMAZON_PCI + 0x000000b0
1064 #define PCI_ADDRESS_MAP_25                      AMAZON_PCI + 0x000000b4
1065 #define PCI_ADDRESS_MAP_26                      AMAZON_PCI + 0x000000b8
1066 #define FPI_ADDRESS_MASK11LOW                   AMAZON_PCI + 0x000000bc
1067 #define FPI_ADDRESS_MAP_0                       AMAZON_PCI + 0x000000c0
1068 #define FPI_ADDRESS_MAP_1                       AMAZON_PCI + 0x000000c4
1069 #define FPI_ADDRESS_MAP_2                       AMAZON_PCI + 0x000000c8
1070 #define FPI_ADDRESS_MAP_3                       AMAZON_PCI + 0x000000cc
1071 #define FPI_ADDRESS_MAP_4                       AMAZON_PCI + 0x000000d0
1072 #define FPI_ADDRESS_MAP_5                       AMAZON_PCI + 0x000000d4
1073 #define FPI_ADDRESS_MAP_6                       AMAZON_PCI + 0x000000d8
1074 #define FPI_ADDRESS_MAP_7                       AMAZON_PCI + 0x000000dc
1075 #define FPI_ADDRESS_MAP_11LOW                   AMAZON_PCI + 0x000000e0
1076 #define FPI_ADDRESS_MAP_11HIGH                  AMAZON_PCI + 0x000000e4
1077 #define FPI_BURST_LENGTH                        AMAZON_PCI + 0x000000e8
1078 #define SET_PCI_SERR                            AMAZON_PCI + 0x000000ec
1079 #define DMA_FPI_START_ADDR                      AMAZON_PCI + 0x000000f0
1080 #define DMA_PCI_START_ADDR                      AMAZON_PCI + 0x000000f4
1081 #define DMA_TRANSFER_COUNT                      AMAZON_PCI + 0x000000f8
1082 #define DMA_CONTROL_STATUS                      AMAZON_PCI + 0x000000fc
1083
1084 #define EXT_PCI1_CONFIG_SPACE_BASE_ADDR         AMAZON_PCI_CFG_BASE + 0x0800
1085 #define EXT_PCI2_CONFIG_SPACE_BASE_ADDR         AMAZON_PCI_CFG_BASE + 0x1000
1086 #define EXT_PCI3_CONFIG_SPACE_BASE_ADDR         AMAZON_PCI_CFG_BASE + 0x1800
1087 #define EXT_PCI4_CONFIG_SPACE_BASE_ADDR         AMAZON_PCI_CFG_BASE + 0x2000
1088 #define EXT_PCI5_CONFIG_SPACE_BASE_ADDR         AMAZON_PCI_CFG_BASE + 0x2800
1089 #define EXT_PCI6_CONFIG_SPACE_BASE_ADDR         AMAZON_PCI_CFG_BASE + 0x3000
1090 #define EXT_PCI7_CONFIG_SPACE_BASE_ADDR         AMAZON_PCI_CFG_BASE + 0x3800
1091 #define EXT_PCI8_CONFIG_SPACE_BASE_ADDR         AMAZON_PCI_CFG_BASE + 0x4000
1092 #define EXT_PCI9_CONFIG_SPACE_BASE_ADDR         AMAZON_PCI_CFG_BASE + 0x4800
1093 #define EXT_PCI10_CONFIG_SPACE_BASE_ADDR        AMAZON_PCI_CFG_BASE + 0x5000
1094 #define EXT_PCI11_CONFIG_SPACE_BASE_ADDR        AMAZON_PCI_CFG_BASE + 0x5800
1095 #define EXT_PCI12_CONFIG_SPACE_BASE_ADDR        AMAZON_PCI_CFG_BASE + 0x6000
1096 #define EXT_PCI13_CONFIG_SPACE_BASE_ADDR        AMAZON_PCI_CFG_BASE + 0x6800
1097 #define EXT_PCI14_CONFIG_SPACE_BASE_ADDR        AMAZON_PCI_CFG_BASE + 0x7000
1098 #define EXT_PCI15_CONFIG_SPACE_BASE_ADDR        AMAZON_PCI_CFG_BASE + 0x7800
1099 #define EXT_CARDBUS_CONFIG_SPACE_BASE_ADDR      AMAZON_PCI_CFG_BASE + 0XF000
1100 #define EXT_PCI_BAR1_ADDR                       0x10
1101 #define EXT_PCI_BAR2_ADDR                       0x14
1102 #define EXT_PCI_BAR3_ADDR                       0x18
1103 #define EXT_PCI_BAR4_ADDR                       0x1C
1104 #define EXT_PCI_BAR5_ADDR                       0x20
1105 #define EXT_PCI_BAR6_ADDR                       0x24
1106                                                                                                              
1107 #define DEVICE_ID_VECDOR_ID_ADDR                AMAZON_PCI_CFG_BASE + 0x0
1108 #define STATUS_COMMAND_ADDR                     AMAZON_PCI_CFG_BASE + 0x4
1109 #define BUS_MASTER_ENABLE_BIT                   2
1110 #define MEM_SPACE_ENABLE_BIT                    1
1111 #define CLASS_CODE_REVISION_ADDR                AMAZON_PCI_CFG_BASE + 0x8
1112 #define BIST_HEADER_TYPE_LATENCY_CAHCE_ADDR     AMAZON_PCI_CFG_BASE + 0xC
1113 #define BAR1_ADDR                               AMAZON_PCI_CFG_BASE + 0x10
1114 #define BAR2_ADDR                               AMAZON_PCI_CFG_BASE + 0x14
1115 #define BAR3_ADDR                               AMAZON_PCI_CFG_BASE + 0x18
1116 #define BAR4_ADDR                               AMAZON_PCI_CFG_BASE + 0x1C
1117 #define BAR3_ADDR                               AMAZON_PCI_CFG_BASE + 0x18
1118 #define BAR4_ADDR                               AMAZON_PCI_CFG_BASE + 0x1C
1119 #define BAR5_ADDR                               AMAZON_PCI_CFG_BASE + 0x20
1120 #define BAR6_ADDR                               AMAZON_PCI_CFG_BASE + 0x24
1121 #define CARDBUS_CIS_POINTER_ADDR                AMAZON_PCI_CFG_BASE + 0x28
1122 #define SUBSYSTEM_ID_VENDOR_ID_ADDR             AMAZON_PCI_CFG_BASE + 0x2C
1123 #define EXPANSION_ROM_BASE_ADDR                 AMAZON_PCI_CFG_BASE + 0x30
1124 #define CAPABILITIES_POINTER_ADDR               AMAZON_PCI_CFG_BASE + 0x34
1125 #define RESERVED_0x38                           AMAZON_PCI_CFG_BASE + 0x38
1126 #define MAX_LAT_MIN_GNT_INT_PIN_LINE_ADDR       AMAZON_PCI_CFG_BASE + 0x3C
1127 #define POWER_MNGT_NEXT_POINTER_CAP_ID_ADDR     AMAZON_PCI_CFG_BASE + 0x40
1128 #define POWER_MANAGEMENT_CTRL_STATUS_ADDR       AMAZON_PCI_CFG_BASE + 0x44
1129 #define RESERVED_0x48                           AMAZON_PCI_CFG_BASE + 0x48
1130 #define RESERVED_0x4C                           AMAZON_PCI_CFG_BASE + 0x4C
1131 #define ERROR_ADDR_PCI_FPI_ADDR                 AMAZON_PCI_CFG_BASE + 0x50
1132 #define ERROR_ADdR_FPI_PCI_ADDR                 AMAZON_PCI_CFG_BASE + 0x54
1133 #define ERROR_TAG_FPI_PCI_ADDR                  AMAZON_PCI_CFG_BASE + 0x58
1134 #define PCI_ARB_CTRL_STATUS_ADDR                AMAZON_PCI_CFG_BASE + 0x5C
1135 #define INTERNAL_ARB_ENABLE_BIT                 0
1136 #define ARB_SCHEME_BIT                          1
1137 #define PCI_MASTER0_PRIOR_2BITS                 2
1138 #define PCI_MASTER1_PRIOR_2BITS                 4
1139 #define PCI_MASTER2_PRIOR_2BITS                 6
1140 #define PCI_MASTER0_REQ_MASK_2BITS              8
1141 #define PCI_MASTER1_REQ_MASK_2BITS              10
1142 #define PCI_MASTER2_REQ_MASK_2BITS              12
1143 #define PCI_MASTER0_GNT_MASK_2BITS              14
1144 #define PCI_MASTER1_GNT_MASK_2BITS              16
1145 #define PCI_MASTER2_GNT_MASK_2BITS              18
1146 #define FPI_PCI_INT_STATUS_ADDR                 AMAZON_PCI_CFG_BASE + 0x60
1147 #define FPI_PCI_INT_ACK_ADDR                    AMAZON_PCI_CFG_BASE + 0x64
1148 #define FPI_PCI_INT_MASK_ADDR                   AMAZON_PCI_CFG_BASE + 0x68
1149 #define CARDBUS_CTRL_STATUS_ADDR                AMAZON_PCI_CFG_BASE + 0x6C
1150 #define CARDBUS_CFRAME_ENABLE                   0
1151                                                                                                              
1152 #define CLOCK_CONTROL_default                   0x00000000
1153 #define CLOCK_CONTROL_mask                      0x00000003
1154                                                                                                              
1155 #define IDENTIFICATION_default                  0x0011C002
1156 #define IDENTIFICATION_mask                     0x00000000
1157                                                                                                              
1158 #define SOFTRESET_default                       0x00000000
1159 // SOFTRESET bit 0 is writable but will be reset to 0 after software reset is over
1160 #define SOFTRESET_mask                          0x00000000
1161                                                                                                              
1162 #define PCI_FPI_ERROR_ADDRESS_default           0xFFFFFFFF
1163 #define PCI_FPI_ERROR_ADDRESS_mask              0x00000000
1164                                                                                                              
1165 #define FPI_PCI_ERROR_ADDRESS_default           0xFFFFFFFF
1166 #define FPI_PCI_ERROR_ADDRESS_mask              0x00000000
1167                                                                                                              
1168 #define FPI_ERROR_TAG_default                   0x0000000F
1169 #define FPI_ERROR_TAG_mask                      0x00000000
1170                                                                                                              
1171 #define IRR_default                             0x00000000
1172 #define IRR_mask                                0x07013b2F
1173                                                                                                              
1174 #define IRA_IR_default                          0x00000000
1175 #define IRA_IR_mask                             0x07013b2F
1176                                                                                                              
1177 #define IRM_default                             0x00000000
1178 #define IRM_mask                                0xFFFFFFFF
1179                                                                                                              
1180 #define EOI_default                             0x00000000
1181 #define EOI_mask                                0x00000000
1182                                                                                                              
1183 #define PCI_MODE_default                        0x01000103
1184 #define PCI_MODE_mask                           0x1107070F
1185                                                                                                              
1186 #define DEVICE_VENDOR_ID_default                0x000C15D1
1187 #define DEVICE_VENDOR_ID_mask                   0xFFFFFFFF
1188                                                                                                              
1189 #define SUBSYSTEM_VENDOR_ID_default             0x000015D1
1190 #define SUBSYSTEM_VENDOR_ID_mask                0x0000FFFF
1191                                                                                                              
1192 #define POWER_MANAGEMENT_default                0x0000001B
1193 #define POWER_MANAGEMENT_mask                   0x0000001F
1194                                                                                                              
1195 #define CLASS_CODE1_default                     0x00028000
1196 #define CLASS_CODE1_mask                        0x00FFFFFF
1197                                                                                                              
1198 #define BAR11_MASK_default                      0x0FF00008
1199 #define BAR11_MASK_mask                         0x8FF00008
1200                                                                                                              
1201 #define BAR12_MASK_default                      0x80001800
1202 #define BAR12_MASK_mask                         0x80001F08
1203                                                                                                              
1204 #define BAR13_MASK_default                      0x8FF00008
1205 #define BAR13_MASK_mask                         0x8FF00008
1206                                                                                                              
1207 #define BAR14_MASK_default                      0x8F000000
1208 #define BAR14_MASK_mask                         0x8FFFFF08
1209                                                                                                              
1210 #define BAR15_MASK_default                      0x80000000
1211 #define BAR15_MASK_mask                         0x8FFFFF08
1212                                                                                                              
1213 #define BAR16_MASK_default                      0x80000001
1214 // bit 0 and bit 3 is mutually exclusive
1215 #define BAR16_MASK_mask                         0x8FFFFFF9
1216                                                                                                              
1217 #define CARDBUS_CIS_POINTER1_default            0x00000000
1218 #define CARDBUS_CIS_POINTER1_mask               0x03FFFFFF
1219                                                                                                              
1220 #define SUBSYSTEM_ID1_default                   0x0000000C
1221 #define SUBSYSTEM_ID1_mask                      0x0000FFFF
1222                                                                                                              
1223 #define PCI_ADDRESS_MAP_11_default              0x18000000
1224 #define PCI_ADDRESS_MAP_11_mask                 0x7FFFFFF1
1225                                                                                                              
1226 #define PCI_ADDRESS_MAP_12_default              0x18100000
1227 #define PCI_ADDRESS_MAP_12_mask                 0x7FFFFF01
1228                                                                                                              
1229 #define PCI_ADDRESS_MAP_13_default              0x18200000
1230 #define PCI_ADDRESS_MAP_13_mask                 0x7FF00001
1231                                                                                                              
1232 #define PCI_ADDRESS_MAP_14_default              0x70000000
1233 #define PCI_ADDRESS_MAP_14_mask                 0x7FFFFF01
1234                                                                                                                 
1235 #define PCI_ADDRESS_MAP_15_default              0x00000001
1236 #define PCI_ADDRESS_MAP_15_mask                 0x7FFFFF01
1237                                                                                                              
1238 #define PCI_ADDRESS_MAP_16_default              0x60000000
1239 #define PCI_ADDRESS_MAP_16_mask                 0x7FF00001
1240                                                                                                              
1241 #define FPI_SEGMENT_ENABLE_default              0x000003FF
1242 #define FPI_SEGMENT_ENABLE_mask                 0x000003FF
1243                                                                                                              
1244 #define CLASS_CODE2_default                     0x00FF0000
1245 #define CLASS_CODE2_mask                        0x00FFFFFF
1246                                                                                                              
1247 #define BAR21_MASK_default                      0x80000008
1248 #define BAR21_MASK_mask                         0x8FFFFFF8
1249                                                                                                              
1250 #define BAR22_MASK_default                      0x80000008
1251 #define BAR22_MASK_mask                         0x80001F08
1252                                                                                                              
1253 #define BAR23_MASK_default                      0x80000008
1254 #define BAR23_MASK_mask                         0x8FF00008
1255                                                                                                              
1256 #define BAR24_MASK_default                      0x8FE00000
1257 #define BAR24_MASK_mask                         0x8FFFFF08
1258                                                                                                              
1259 #define BAR25_MASK_default                      0x8FFFF000
1260 #define BAR25_MASK_mask                         0x8FFFFF08
1261                                                                                                              
1262 #define BAR26_MASK_default                      0x8FFFFFE1
1263 #define BAR26_MASK_mask                         0x8FFFFFF1
1264                                                                                                              
1265 #define CARDBUS_CIS_POINTER2_default            0x00000000
1266 #define CARDBUS_CIS_POINTER2_mask               0x03FFFFFF
1267
1268 #define SUBSYSTEM_ID2_default                   0x0000000C
1269 #define SUBSYSTEM_ID2_mask                      0x0000FFFF
1270                                                                                                              
1271 #define PCI_ADDRESS_MAP_21_default              0x3FE00000
1272 #define PCI_ADDRESS_MAP_21_mask                 0x7FFFFFF1
1273                                                                                                              
1274 #define PCI_ADDRESS_MAP_22_default              0x68000000
1275 #define PCI_ADDRESS_MAP_22_mask                 0x7FFFFF01
1276                                                                                                              
1277 #define PCI_ADDRESS_MAP_23_default              0x20000000
1278 #define PCI_ADDRESS_MAP_23_mask                 0x7FF00001
1279                                                                                                              
1280 #define PCI_ADDRESS_MAP_24_default              0x70000001
1281 #define PCI_ADDRESS_MAP_24_mask                 0x7FFFFF01
1282                                                                                                              
1283 #define PCI_ADDRESS_MAP_25_default              0x78000001
1284 #define PCI_ADDRESS_MAP_25_mask                 0x7FFFFF01
1285                                                                                                              
1286 #define PCI_ADDRESS_MAP_26_default              0x20000000
1287 #define PCI_ADDRESS_MAP_26_mask                 0x7FF00001
1288                                                                                                              
1289 #define FPI_ADDRESS_MASK11LOW_default           0x00000000
1290 #define FPI_ADDRESS_MASK11LOW_mask              0x00070000
1291                                                                                                              
1292 #define FPI_ADDRESS_MAP_0_default               0x00000000
1293 #define FPI_ADDRESS_MAP_0_mask                  0xFFF00000
1294                                                                                                              
1295 #define FPI_ADDRESS_MAP_1_default               0x10000000
1296 #define FPI_ADDRESS_MAP_1_mask                  0xFFF00000
1297                                                                                                              
1298 #define FPI_ADDRESS_MAP_2_default               0x20000000
1299 #define FPI_ADDRESS_MAP_2_mask                  0xFFF00000
1300
1301 #define FPI_ADDRESS_MAP_3_default               0x30000000
1302 #define FPI_ADDRESS_MAP_3_mask                  0xFFF00000
1303                                                                                                              
1304 #define FPI_ADDRESS_MAP_4_default               0x40000000
1305 #define FPI_ADDRESS_MAP_4_mask                  0xFFF00000
1306                                                                                                              
1307 #define FPI_ADDRESS_MAP_5_default               0x50000000
1308 #define FPI_ADDRESS_MAP_5_mask                  0xFFF00000
1309                                                                                                              
1310 #define FPI_ADDRESS_MAP_6_default               0x60000000
1311 #define FPI_ADDRESS_MAP_6_mask                  0xFFF00000
1312                                                                                                              
1313 #define FPI_ADDRESS_MAP_7_default               0x70000000
1314 #define FPI_ADDRESS_MAP_7_mask                  0xFFF00000
1315                                                                                                              
1316 #define FPI_ADDRESS_MAP_11LOW_default           0xB0000000
1317 #define FPI_ADDRESS_MAP_11LOW_mask              0xFFFF0000
1318                                                                                                              
1319 #define FPI_ADDRESS_MAP_11HIGH_default          0xB8000000
1320 #define FPI_ADDRESS_MAP_11HIGH_mask             0xFFF80000
1321                                                                                                              
1322 #define FPI_BURST_LENGTH_default                0x00000000
1323 #define FPI_BURST_LENGTH_mask                   0x00000303
1324                                                                                                              
1325 #define SET_PCI_SERR_default                    0x00000000
1326 #define SET_PCI_SERR_mask                       0x00000000
1327                                                                                                              
1328 #define DMA_FPI_START_ADDRESS_default           0x00000000
1329 #define DMA_FPI_START_ADDRESS_mask              0xFFFFFFFF
1330                                                                                                              
1331 #define DMA_PCI_START_ADDRESS_default           0x00000000
1332 #define DMA_PCI_START_ADDRESS_mask              0xFFFFFFFF
1333                                                                                                              
1334 #define DMA_TRANSFER_COUNT_default              0x00000000
1335 #define DMA_TRANSFER_COUNT_mask                 0x0000FFFF
1336
1337 #define DMA_CONTROL_STATUS_default              0x00000000
1338 #define DMA_CONTROL_STATUS_mask                 0x00000000   // bit 0,1 is writable
1339
1340 /***********************************************************************/       
1341 #undef IKOS_MINI_BOOT           //don't run a full booting
1342 #ifdef CONFIG_USE_IKOS  
1343 #define CONFIG_USE_VENUS                //Faster, 10M CPU and 192k baudrate
1344 #ifdef CONFIG_USE_VENUS
1345 #define IKOS_CPU_SPEED          10000000                                                                                   
1346 #else
1347 #define IKOS_CPU_SPEED          180000  //IKOS is slow                                                                             
1348 #endif 
1349 #endif //CONFIG_USE_IKOS
1350
1351 /* 165001:henryhsu:20050603:Source Modify form Bing Tao */
1352
1353 #if defined(CONFIG_NET_WIRELESS_SPURS) || defined(CONFIG_NET_WIRELESS_SPURS_MODULE)
1354 #define EBU_PCI_SOFTWARE_ARBITOR
1355 #endif
1356
1357 #define  AMAZON_B11
1358 #ifdef AMAZON_B11
1359 #define SWITCH_BUF_FPI_ADDR             (0x10110000)
1360 #define SWITCH_BUF_ADDR                 (KSEG1+SWITCH_BUF_FPI_ADDR)
1361 #define SWITCH_BUF_SIZE                 (0x2800)
1362 #define AMAZON_B11_CBM_QD_ADDR          (SWITCH_BUF_ADDR+0x0)
1363 #define AMAZON_B11_BOND_CELL_ADDR       (SWITCH_BUF_ADDR+0x000)
1364 #endif
1365 #define  AMAZON_REFERENCE_BOARD
1366 //for AMAZON ATM bonding application
1367 #ifdef AMAZON_REFERENCE_BOARD
1368 #define  GPIO_DETECT_LOW
1369 #else
1370 #undef  GPIO_DETECT_LOW
1371 #endif
1372
1373 /* 165001 */
1374
1375 #undef AMAZON_IKOS_DEBUG_MSG
1376 #undef AMAZON_INT_DEBUG_MSG
1377 #undef AMAZON_ATM_DEBUG_MSG
1378 #undef AMAZON_DMA_DEBUG_MSG
1379 #undef AMAZON_SW_DEBUG_MSG
1380 #undef AMAZON_WDT_DEBUG_MSG
1381 #undef AMAZON_MTD_DEBUG_MSG
1382 #undef AMAZON_SSC_DEBUG_MSG
1383 #undef AMAZON_MEI_DEBUG_MSG
1384
1385 #ifdef AMAZON_IKOS_DEBUG_MSG
1386 #define AMAZON_IKOS_DMSG(fmt,args...) printk("%s:" fmt, __FUNCTION__, ##args)
1387 #else
1388 #define AMAZON_IKOS_DMSG(fmt,args...)
1389 #endif
1390
1391 #ifdef AMAZON_WDT_DEBUG_MSG 
1392 #define AMAZON_WDT_DMSG(fmt, args...) printk( "%s: " fmt, __FUNCTION__ , ##args)
1393 #else 
1394 #define AMAZON_WDT_DMSG(fm,args...)
1395 #endif
1396
1397 #ifdef AMAZON_SSC_DEBUG_MSG 
1398 #define AMAZON_SSC_DMSG(fmt, args...) printk( "%s: " fmt, __FUNCTION__ , ##args)
1399 #else 
1400 #define AMAZON_SSC_DMSG(fm,args...)
1401 #endif
1402
1403 #ifdef AMAZON_DMA_DEBUG_MSG 
1404 #define AMAZON_DMA_DMSG(fmt, args...) printk( "%s: " fmt, __FUNCTION__ , ##args)
1405 #else 
1406 #define AMAZON_DMA_DMSG(fm,args...)
1407 #endif
1408
1409 #ifdef AMAZON_ATM_DEBUG_MSG
1410 #define AMAZON_TPE_DMSG(fmt, args...) printk( "%s: " fmt, __FUNCTION__ , ##args)
1411 #else //not AMAZON_ATM_DEBUG
1412 #define AMAZON_TPE_DMSG(fmt, args...)
1413 #endif //AMAZON_ATM_DEBUG
1414
1415 #ifdef AMAZON_SW_DEBUG_MSG
1416 #define AMAZON_SW_DMSG(fmt,args...) printk("%s: " fmt, __FUNCTION__ , ##args)
1417 #else
1418 #define AMAZON_SW_DMSG(fmt,args...)
1419 #endif  
1420
1421 #ifdef AMAZON_MTD_DEBUG_MSG
1422 #define AMAZON_MTD_DMSG(fmt,args...) printk("%s: " fmt, __FUNCTION__ , ##args)
1423 #else
1424 #define AMAZON_MTD_DMSG(fmt,args...)
1425 #endif  
1426
1427 #ifdef AMAZON_INT_DEBUG_MSG
1428 #define AMAZON_INT_DMSG(x...) printk(x)
1429 #else
1430 #define AMAZON_INT_DMSG(x...)
1431 #endif 
1432
1433 #ifdef AMAZON_MEI_DEBUG_MSG
1434 #define AMAZON_MEI_DMSG(fmt,args...) printk("%s:" fmt, __FUNCTION__, ##args)
1435 #else
1436 #define AMAZON_MEI_DMSG(fmt,args...)
1437 #endif
1438
1439 #endif //AMAZON_H