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