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