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