Implemented system_reboot().
[kugel-rb.git] / firmware / export / as3525.h
blob50b1fbe06bf5d6f94576377d41a61ae4c1c359e7
1 /*
2 * (C) Copyright 2006
3 * Copyright (C) 2006 Austriamicrosystems, by thomas.luo
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of
8 * the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
18 * MA 02111-1307 USA
20 #ifndef __AS3525_H__
21 #define __AS3525_H__
23 #define UART_CHANNELS 1
25 /* AS352X only supports 512 Byte HW ECC */
26 #define ECCSIZE 512
27 #define ECCBYTES 3
30 /* AS352X device base addresses */
34 ------------------------------------------------------------------------
35 * AS352X Registers
37 ------------------------------------------------------------------------
42 /* AHB */
43 #define USB_BASE 0xC6000000
44 #define VIC_BASE 0xC6010000
45 #define DMAC_BASE 0xC6020000
46 #define MPMC_BASE 0xC6030000
47 #define MEMSTICK_BASE 0xC6040000
48 #define CF_IDE_BASE 0xC6050000
50 /* APB */
51 #define NAND_FLASH_BASE 0xC8000000
52 #define BIST_MANAGER_BASE 0xC8010000
53 #define SD_MCI_BASE 0xC8020000
54 #define TIMER_BASE 0xC8040000
55 #define WDT_BASE 0xC8050000
56 #define I2C_MS_BASE 0xC8060000
57 #define I2C_AUDIO_BASE 0xC8070000
58 #define SSP_BASE 0xC8080000
59 #define I2SIN_BASE 0xC8090000
60 #define I2SOUT_BASE 0xC80A0000
61 #define GPIOA_BASE 0xC80B0000
62 #define GPIOB_BASE 0xC80C0000
63 #define GPIOC_BASE 0xC80D0000
64 #define GPIOD_BASE 0xC80E0000
65 #define CGU_BASE 0xC80F0000
66 #define CCU_BASE 0xC8100000
67 #define UART0_BASE 0xC8110000
68 #define DBOP_BASE 0xC8120000
78 ------------------------------------------------------------------------
79 * AS352X control registers
81 ------------------------------------------------------------------------
84 #define CCU_SRC (*(volatile unsigned long *)(CCU_BASE + 0x00))
85 #define CCU_SRL (*(volatile unsigned long *)(CCU_BASE + 0x04))
86 #define CCU_MEMMAP (*(volatile unsigned long *)(CCU_BASE + 0x08))
87 #define CCU_IO (*(volatile unsigned long *)(CCU_BASE + 0x0C))
88 #define CCU_SCON (*(volatile unsigned long *)(CCU_BASE + 0x10))
89 #define CCU_VERS (*(volatile unsigned long *)(CCU_BASE + 0x14))
90 #define CCU_SPARE1 (*(volatile unsigned long *)(CCU_BASE + 0x18))
91 #define CCU_SPARE2 (*(volatile unsigned long *)(CCU_BASE + 0x1C))
93 /* DBOP */
94 #define DBOP_TIMPOL_01 (*(volatile unsigned long *)(DBOP_BASE + 0x00))
95 #define DBOP_TIMPOL_23 (*(volatile unsigned long *)(DBOP_BASE + 0x04))
96 #define DBOP_CTRL (*(volatile unsigned long *)(DBOP_BASE + 0x08))
97 #define DBOP_STAT (*(volatile unsigned long *)(DBOP_BASE + 0x0C))
98 #define DBOP_DOUT (*(volatile unsigned short*)(DBOP_BASE + 0x10))
99 #define DBOP_DIN (*(volatile unsigned long *)(DBOP_BASE + 0x14))
103 * Reset Control Lines in CCU_SRC register
105 #define CCU_SRC_DBOP_EN ( 1 << 24 )
106 #define CCU_SRC_SPDIF_EN ( 1 << 22 )
107 #define CCU_SRC_TIMER_EN ( 1 << 21 )
108 #define CCU_SRC_SSP_EN ( 1 << 20 )
109 #define CCU_SRC_WDO_EN ( 1 << 19 )
110 #define CCU_SRC_IDE_EN ( 1 << 18 )
111 #define CCU_SRC_IDE_AHB_EN ( 1 << 17 )
112 #define CCU_SRC_UART0 ( 1 << 16 )
113 #define CCU_SRC_NAF_EN ( 1 << 15 )
114 #define CCU_SRC_SDMCI_EN ( 1 << 14 )
115 #define CCU_SRC_GPIO_EN ( 1 << 13 )
116 #define CCU_SRC_I2C_AUDIO_EN ( 1 << 12 )
117 #define CCU_SRC_I2C_EN ( 1 << 11 )
118 #define CCU_SRC_MST_EN ( 1 << 10 )
119 #define CCU_SRC_I2SIN ( 1 << 9 )
120 #define CCU_SRC_I2SOUT ( 1 << 8 )
121 #define CCU_SRC_USB_AHB_EN ( 1 << 7 )
122 #define CCU_SRC_USB_PHY_EN ( 1 << 6 )
123 #define CCU_SRC_DMAC_EN ( 1 << 5 )
124 #define CCU_SRC_VIC_EN ( 1 << 4 )
127 * Magic number for CCU_SRL for reset.
129 #define CCU_SRL_MAGIC_NUMBER 0x1A720212
132 * Chip select lines for NAF. Use these constants to select/deselct the
133 CE lines
134 * for NAND flashes in Register CCU_IO.
136 #define CCU_IO_NAF_CE_LINE_0 ( 0 << 7 )
137 #define CCU_IO_NAF_CE_LINE_1 ( 1 << 7 )
138 #define CCU_IO_NAF_CE_LINE_2 ( 2 << 7 )
139 #define CCU_IO_NAF_CE_LINE_3 ( 3 << 7 )
141 /* CCU IO Select/Deselect IDE */
142 #define CCU_IO_IDE ( 1 << 5 )
144 /* CCU IO Select/desect I2C */
145 #define CCU_IO_I2C_MASTER_SLAVE ( 1 << 1 )
147 /* CCU IO Select/desect UART */
148 #define CCU_IO_UART0 ( 1 << 0 )
151 #define CCU_RESET_ALL_BUT_MEMORY \
152 ( CCU_SRC_DBOP_EN \
153 | CCU_SRC_SPDIF_EN \
154 | CCU_SRC_TIMER_EN \
155 | CCU_SRC_SSP_EN \
156 | CCU_SRC_WDO_EN \
157 | CCU_SRC_IDE_EN \
158 | CCU_SRC_IDE_AHB_EN \
159 | CCU_SRC_UART0 \
160 | CCU_SRC_NAF_EN \
161 | CCU_SRC_SDMCI_EN \
162 | CCU_SRC_GPIO_EN \
163 | CCU_SRC_I2C_AUDIO_EN \
164 | CCU_SRC_I2C_EN \
165 | CCU_SRC_MST_EN \
166 | CCU_SRC_I2SIN \
167 | CCU_SRC_I2SOUT \
168 | CCU_SRC_USB_AHB_EN \
169 | CCU_SRC_USB_PHY_EN \
170 | CCU_SRC_DMAC_EN \
171 | CCU_SRC_VIC_EN \
174 #define CCU_IO_UART ( 1 << 0 )
176 ------------------------------------------------------------------------
177 * AS352X clock control registers
179 ------------------------------------------------------------------------
182 #define CGU_PLLA (*(volatile unsigned long *)(CGU_BASE + 0x00))
183 #define CGU_PLLB (*(volatile unsigned long *)(CGU_BASE + 0x04))
184 #define CGU_PLLASUP (*(volatile unsigned long *)(CGU_BASE + 0x08))
185 #define CGU_PLLBSUP (*(volatile unsigned long *)(CGU_BASE + 0x0C))
186 #define CGU_PROC (*(volatile unsigned long *)(CGU_BASE + 0x10))
187 #define CGU_PERI (*(volatile unsigned long *)(CGU_BASE + 0x14))
188 #define CGU_AUDIO (*(volatile unsigned long *)(CGU_BASE + 0x18))
189 #define CGU_USB (*(volatile unsigned long *)(CGU_BASE + 0x1C))
190 #define CGU_INTCTRL (*(volatile unsigned long *)(CGU_BASE + 0x20))
191 #define CGU_IRQ (*(volatile unsigned long *)(CGU_BASE + 0x24))
192 #define CGU_COUNTA (*(volatile unsigned long *)(CGU_BASE + 0x28))
193 #define CGU_COUNTB (*(volatile unsigned long *)(CGU_BASE + 0x2C))
194 #define CGU_IDE (*(volatile unsigned long *)(CGU_BASE + 0x30))
195 #define CGU_MEMSTICK (*(volatile unsigned long *)(CGU_BASE + 0x34))
196 #define CGU_DBOP (*(volatile unsigned long *)(CGU_BASE + 0x38))
198 #define CGU_VIC_CLOCK_ENABLE ( 1 << 23 ) /* vic */
199 /* --- are disabled after reset --- */
200 #define CGU_DMA_CLOCK_ENABLE ( 1 << 22 ) /* dma */
201 #define CGU_USB_CLOCK_ENABLE ( 1 << 21 ) /* usb */
202 #define CGU_I2SOUT_APB_CLOCK_ENABLE ( 1 << 20 ) /* i2sout */
203 #define CGU_I2SIN_APB_CLOCK_ENABLE ( 1 << 19 ) /* i2sin */
204 #define CGU_I2C_MASTER_SLAVE_CLOCK_ENABLE ( 1 << 18 ) /* i2c master/slave */
205 #define CGU_I2C_AUDIO_MASTER_CLOCK_ENABLE ( 1 << 17 ) /* i2c audio master */
206 #define CGU_GPIO_CLOCK_ENABLE ( 1 << 16 ) /* gpio */
207 #define CGU_MCI_CLOCK_ENABLE ( 1 << 15 ) /* mmc + sd */
208 #define CGU_NAF_CLOCK_ENABLE ( 1 << 14 ) /* naf */
209 #define CGU_UART_APB_CLOCK_ENABLE ( 1 << 13 ) /* uart */
210 #define CGU_WDOCNT_CLOCK_ENABLE ( 1 << 12 ) /* watchdog counter */
211 #define CGU_WDOIF_CLOCK_ENABLE ( 1 << 11 ) /* watchdog timer module */
212 #define CGU_SSP_CLOCK_ENABLE ( 1 << 10 ) /* ssp */
213 #define CGU_TIMER1_CLOCK_ENABLE ( 1 << 9 ) /* timer 1 */
214 #define CGU_TIMER2_CLOCK_ENABLE ( 1 << 8 ) /* timer 2 */
215 #define CGU_TIMERIF_CLOCK_ENABLE ( 1 << 7 ) /* timer
216 interface */
218 /** ------------------------------------------------------------------
219 * Number of cycles to wait before cgu is safely locked.
221 #define CGU_LOCK_CNT 0xFF
223 /* FIFO depth is 16 for tx and rx fifo */
224 #define UART_FIFO_DEPTH 16
226 /* ------------------- UART Line Control Register bit fields -------------------- */
228 #define UART_LNCTL_DLSEN (1 << 7) /* Device latch select bit */
231 /* -------------- UART Interrupt Control Register bit fields --------------- */
233 #define UART_INTR_RXDRDY 0x1 /* Data ready interrupt */
234 #define UART_INTR_TXEMT 0x2 /* Transmit data empty interrupt */
235 #define UART_INTR_RXLINESTATUS 0x4 /* Receive line status interrupt */
237 /* ------------------- UART Line Status Register bit fields -------------------- */
239 #define UART_ERRORBITS 0x1E
240 #define UART_RX_DATA_READY (1 << 0)
241 #define UART_TX_HOLD_EMPTY (1 << 5)
243 /* ------------------- FIFO CNTL Register contants -------------------*/
245 #define UART_FIFO_EN (1 << 0) /* Enable the UART FIFO */
246 #define UART_TX_FIFO_RST (1 << 1) /* Enable the UART FIFO */
247 #define UART_RX_FIFO_RST (1 << 2)
248 #define UART_RXFIFO_TRIGLVL_1 (0 << 4) /* RX FIFO TRIGGER_LEVEL 1 */
249 #define UART_RXFIFO_TRIGLVL_4 0x08 /* RX FIFO TRIGGER_LEVEL 4 */
250 #define UART_RXFIFO_TRIGLVL_8 0x10 /* RX FIFO TRIGGER_LEVEL 8 */
251 #define UART_RXFIFO_TRIGLVL_14 0x18 /* RX FIFO TRIGGER_LEVEL 14 */
254 /* ------------------- FIFO status Register contants ------------------*/
255 #define UART_TX_FIFO_FULL (1 << 0)
256 #define UART_RX_FIFO_FULL (1 << 1)
257 #define UART_TX_FIFO_EMPTY (1 << 2)
258 #define UART_RX_FIFO_EMPTY (1 << 3)
261 /* ----------------------- defines ---------------------------------------- */
265 #define UART_DATA_REG (*(volatile unsigned long*)(UART0_BASE + 0x00)) /* Data register */
266 #define UART_DLO_REG (*(volatile unsigned long*)(UART0_BASE + 0x00)) /* Clock divider(lower byte) register */
267 #define UART_DHI_REG (*(volatile unsigned long*)(UART0_BASE + 0x04)) /* Clock divider(higher byte) register */
268 #define UART_INTEN_REG (*(volatile unsigned long*)(UART0_BASE + 0x04)) /* Interrupt enable register */
269 #define UART_INTSTATUS_REG (*(volatile unsigned long*)(UART0_BASE + 0x08)) /* Interrupt status register */
270 #define UART_FCTL_REG (*(volatile unsigned long*)(UART0_BASE + 0x0C)) /* Fifo control register */
271 #define UART_FSTATUS_REG (*(volatile unsigned long*)(UART0_BASE + 0x0C)) /* Fifo status register */
272 #define UART_LNCTL_REG (*(volatile unsigned long*)(UART0_BASE + 0x10)) /* Line control register */
273 #define UART_LNSTATUS_REG (*(volatile unsigned long*)(UART0_BASE + 0x14)) /* Line status register */
278 #define TIMER1_LOAD (*(volatile unsigned long*)(TIMER_BASE + 0x00)) /* 32-bit width */
279 #define TIMER1_VALUE (*(volatile unsigned long*)(TIMER_BASE + 0x04)) /* 32 bit width */
280 #define TIMER1_CONTROL (*(volatile unsigned long*)(TIMER_BASE + 0x08)) /* 8 bit width */
281 #define TIMER1_INTCLR (*(volatile unsigned long*)(TIMER_BASE + 0x0C)) /* clears ir by write access */
282 #define TIMER1_RIS (*(volatile unsigned long*)(TIMER_BASE + 0x10)) /* 1 bit width */
283 #define TIMER1_MIS (*(volatile unsigned long*)(TIMER_BASE + 0x14)) /* 1 bit width */
284 #define TIMER1_BGLOAD (*(volatile unsigned long*)(TIMER_BASE + 0x18)) /* 32-bit width */
286 #define TIMER2_LOAD (*(volatile unsigned long*)(TIMER_BASE + 0x20)) /* 32-bit width */
287 #define TIMER2_VALUE (*(volatile unsigned long*)(TIMER_BASE + 0x24)) /* 32 bit width */
288 #define TIMER2_CONTROL (*(volatile unsigned long*)(TIMER_BASE + 0x28)) /* 8 bit width */
289 #define TIMER2_INTCLR (*(volatile unsigned long*)(TIMER_BASE + 0x2C)) /* clears ir by write access */
290 #define TIMER2_RIS (*(volatile unsigned long*)(TIMER_BASE + 0x30)) /* 1 bit width */
291 #define TIMER2_MIS (*(volatile unsigned long*)(TIMER_BASE + 0x34)) /* 1 bit width */
292 #define TIMER2_BGLOAD (*(volatile unsigned long*)(TIMER_BASE + 0x38)) /* 32-bit width */
295 * Counter/Timer control register bits
297 #define TIMER_ENABLE 0x80
298 #define TIMER_PERIODIC 0x40
299 #define TIMER_INT_ENABLE 0x20
300 #define TIMER_32_BIT 0x02
301 #define TIMER_ONE_SHOT 0x01
302 #define TIMER_PRESCALE_1 0x00
303 #define TIMER_PRESCALE_16 0x04
304 #define TIMER_PRESCALE_256 0x08
307 /* Watchdog registers */
308 #define WDT_LOAD (*(volatile unsigned long*)(WDT_BASE))
309 #define WDT_CONTROL (*(volatile unsigned long*)(WDT_BASE+8))
312 /* GPIO registers */
314 #define GPIOA_DIR (*(volatile unsigned char*)(GPIOA_BASE+0x400))
315 #define GPIOA_IS (*(volatile unsigned char*)(GPIOA_BASE+0x404))
316 #define GPIOA_IBE (*(volatile unsigned char*)(GPIOA_BASE+0x408))
317 #define GPIOA_IEV (*(volatile unsigned char*)(GPIOA_BASE+0x40C))
318 #define GPIOA_IE (*(volatile unsigned char*)(GPIOA_BASE+0x410))
319 #define GPIOA_RIS (*(volatile unsigned char*)(GPIOA_BASE+0x414))
320 #define GPIOA_MIS (*(volatile unsigned char*)(GPIOA_BASE+0x418))
321 #define GPIOA_IC (*(volatile unsigned char*)(GPIOA_BASE+0x41C))
322 #define GPIOA_AFSEL (*(volatile unsigned char*)(GPIOA_BASE+0x420))
323 #define GPIOA_PIN(a) (*(volatile unsigned char*)(GPIOA_BASE+(1<<((a)+2))))
325 #define GPIOB_DIR (*(volatile unsigned char*)(GPIOB_BASE+0x400))
326 #define GPIOB_IS (*(volatile unsigned char*)(GPIOB_BASE+0x404))
327 #define GPIOB_IBE (*(volatile unsigned char*)(GPIOB_BASE+0x408))
328 #define GPIOB_IEV (*(volatile unsigned char*)(GPIOB_BASE+0x40C))
329 #define GPIOB_IE (*(volatile unsigned char*)(GPIOB_BASE+0x410))
330 #define GPIOB_RIS (*(volatile unsigned char*)(GPIOB_BASE+0x414))
331 #define GPIOB_MIS (*(volatile unsigned char*)(GPIOB_BASE+0x418))
332 #define GPIOB_IC (*(volatile unsigned char*)(GPIOB_BASE+0x41C))
333 #define GPIOB_AFSEL (*(volatile unsigned char*)(GPIOB_BASE+0x420))
334 #define GPIOB_PIN(a) (*(volatile unsigned char*)(GPIOB_BASE+(1<<((a)+2))))
336 #define GPIOC_DIR (*(volatile unsigned char*)(GPIOC_BASE+0x400))
337 #define GPIOC_IS (*(volatile unsigned char*)(GPIOC_BASE+0x404))
338 #define GPIOC_IBE (*(volatile unsigned char*)(GPIOC_BASE+0x408))
339 #define GPIOC_IEV (*(volatile unsigned char*)(GPIOC_BASE+0x40C))
340 #define GPIOC_IE (*(volatile unsigned char*)(GPIOC_BASE+0x410))
341 #define GPIOC_RIS (*(volatile unsigned char*)(GPIOC_BASE+0x414))
342 #define GPIOC_MIS (*(volatile unsigned char*)(GPIOC_BASE+0x418))
343 #define GPIOC_IC (*(volatile unsigned char*)(GPIOC_BASE+0x41C))
344 #define GPIOC_AFSEL (*(volatile unsigned char*)(GPIOC_BASE+0x420))
345 #define GPIOC_PIN(a) (*(volatile unsigned char*)(GPIOC_BASE+(1<<((a)+2))))
347 #define GPIOD_DIR (*(volatile unsigned char*)(GPIOD_BASE+0x400))
348 #define GPIOD_IS (*(volatile unsigned char*)(GPIOD_BASE+0x404))
349 #define GPIOD_IBE (*(volatile unsigned char*)(GPIOD_BASE+0x408))
350 #define GPIOD_IEV (*(volatile unsigned char*)(GPIOD_BASE+0x40C))
351 #define GPIOD_IE (*(volatile unsigned char*)(GPIOD_BASE+0x410))
352 #define GPIOD_RIS (*(volatile unsigned char*)(GPIOD_BASE+0x414))
353 #define GPIOD_MIS (*(volatile unsigned char*)(GPIOD_BASE+0x418))
354 #define GPIOD_IC (*(volatile unsigned char*)(GPIOD_BASE+0x41C))
355 #define GPIOD_AFSEL (*(volatile unsigned char*)(GPIOD_BASE+0x420))
356 #define GPIOD_PIN(a) (*(volatile unsigned char*)(GPIOD_BASE+(1<<((a)+2))))
358 /* ARM PL172 Memory Controller registers */
360 #define MPMC_CONTROL (*(volatile unsigned long*)(MPMC_BASE+0x000))
361 #define MPMC_STATUS (*(volatile unsigned long*)(MPMC_BASE+0x004))
362 #define MPMC_CONFIG (*(volatile unsigned long*)(MPMC_BASE+0x008))
364 #define MPMC_DYNAMIC_CONTROL (*(volatile unsigned long*)(MPMC_BASE+0x020))
365 #define MPMC_DYNAMIC_REFRESH (*(volatile unsigned long*)(MPMC_BASE+0x024))
366 #define MPMC_DYNAMIC_READ_CONFIG (*(volatile unsigned long*)(MPMC_BASE+0x028))
367 #define MPMC_DYNAMIC_tRP (*(volatile unsigned long*)(MPMC_BASE+0x030))
368 #define MPMC_DYNAMIC_tRAS (*(volatile unsigned long*)(MPMC_BASE+0x034))
369 #define MPMC_DYNAMIC_tSREX (*(volatile unsigned long*)(MPMC_BASE+0x038))
370 #define MPMC_DYNAMIC_tAPR (*(volatile unsigned long*)(MPMC_BASE+0x03C))
371 #define MPMC_DYNAMIC_tDAL (*(volatile unsigned long*)(MPMC_BASE+0x040))
372 #define MPMC_DYNAMIC_tWR (*(volatile unsigned long*)(MPMC_BASE+0x044))
373 #define MPMC_DYNAMIC_tRC (*(volatile unsigned long*)(MPMC_BASE+0x048))
374 #define MPMC_DYNAMIC_tRFC (*(volatile unsigned long*)(MPMC_BASE+0x04C))
375 #define MPMC_DYNAMIC_tXSR (*(volatile unsigned long*)(MPMC_BASE+0x050))
376 #define MPMC_DYNAMIC_tRRD (*(volatile unsigned long*)(MPMC_BASE+0x054))
377 #define MPMC_DYNAMIC_tMRD (*(volatile unsigned long*)(MPMC_BASE+0x058))
379 #define MPMC_STATIC_EXTENDED_WAIT (*(volatile unsigned long*)(MPMC_BASE+0x080))
381 #define MPMC_DYNAMIC_CONFIG_0 (*(volatile unsigned long*)(MPMC_BASE+0x100))
382 #define MPMC_DYNAMIC_CONFIG_1 (*(volatile unsigned long*)(MPMC_BASE+0x120))
383 #define MPMC_DYNAMIC_CONFIG_2 (*(volatile unsigned long*)(MPMC_BASE+0x140))
384 #define MPMC_DYNAMIC_CONFIG_3 (*(volatile unsigned long*)(MPMC_BASE+0x160))
386 #define MPMC_DYNAMIC_RASCAS_0 (*(volatile unsigned long*)(MPMC_BASE+0x104))
387 #define MPMC_DYNAMIC_RASCAS_1 (*(volatile unsigned long*)(MPMC_BASE+0x124))
388 #define MPMC_DYNAMIC_RASCAS_2 (*(volatile unsigned long*)(MPMC_BASE+0x144))
389 #define MPMC_DYNAMIC_RASCAS_3 (*(volatile unsigned long*)(MPMC_BASE+0x164))
391 #define MPMC_PERIPH_ID2 (*(volatile unsigned long*)(MPMC_BASE+0xFE8))
393 /* VIC controller (PL190) registers */
395 #define VIC_IRQ_STATUS (*(volatile unsigned long*)(VIC_BASE+0x00))
396 #define VIC_FIQ_STATUS (*(volatile unsigned long*)(VIC_BASE+0x04))
397 #define VIC_RAW_INTR (*(volatile unsigned long*)(VIC_BASE+0x08))
398 #define VIC_INT_SELECT (*(volatile unsigned long*)(VIC_BASE+0x0C))
399 #define VIC_INT_ENABLE (*(volatile unsigned long*)(VIC_BASE+0x10))
400 #define VIC_INT_EN_CLEAR (*(volatile unsigned long*)(VIC_BASE+0x14))
401 #define VIC_SOFT_INT (*(volatile unsigned long*)(VIC_BASE+0x18))
402 #define VIC_SOFT_INT_CLEAR (*(volatile unsigned long*)(VIC_BASE+0x1C))
403 #define VIC_PROTECTION (*(volatile unsigned long*)(VIC_BASE+0x20))
404 #define VIC_VECT_ADDR (*(volatile unsigned long*)(VIC_BASE+0x30))
405 #define VIC_DEF_VECT_ADDR (*(volatile unsigned long*)(VIC_BASE+0x34))
406 #define VIC_VECT_ADDRS ((volatile unsigned long*)(VIC_BASE+0x100))
407 #define VIC_VECT_CNTLS ((volatile unsigned long*)(VIC_BASE+0x200))
409 /* Interrupt sources (for vectors setup) */
410 #define INT_SRC_WATCHDOG 0
411 #define INT_SRC_TIMER1 1
412 #define INT_SRC_TIMER2 2
413 #define INT_SRC_USB 3
414 #define INT_SRC_DMAC 4
415 #define INT_SRC_NAND 5
416 #define INT_SRC_IDE 6
417 #define INT_SRC_MCI0 7
418 #define INT_SRC_MCI1 8
419 #define INT_SRC_AUDIO 9
420 #define INT_SRC_SSP 10
421 #define INT_SRC_I2C_MS 11
422 #define INT_SRC_I2C_AUDIO 12
423 #define INT_SRC_I2SIN 13
424 #define INT_SRC_I2SOUT 14
425 #define INT_SRC_UART 15
426 #define INT_SRC_GPIOD 16
427 /* 17 reserved */
428 #define INT_SRC_CGU 18
429 #define INT_SRC_MEMORY_STICK 19
430 #define INT_SRC_DBOP 20
431 /* 21-28 reserved */
432 #define INT_SRC_GPIOA 29
433 #define INT_SRC_GPIOB 30
434 #define INT_SRC_GPIOC 31
436 /* Interrupt sources bitmask */
437 #define INTERRUPT_WATCHDOG (1<<0)
438 #define INTERRUPT_TIMER1 (1<<1)
439 #define INTERRUPT_TIMER2 (1<<2)
440 #define INTERRUPT_USB (1<<3)
441 #define INTERRUPT_DMAC (1<<4)
442 #define INTERRUPT_NAND (1<<5)
443 #define INTERRUPT_IDE (1<<6)
444 #define INTERRUPT_MCI0 (1<<7)
445 #define INTERRUPT_MCI1 (1<<8)
446 #define INTERRUPT_AUDIO (1<<9)
447 #define INTERRUPT_SSP (1<<10)
448 #define INTERRUPT_I2C_MS (1<<11)
449 #define INTERRUPT_I2C_AUDIO (1<<12)
450 #define INTERRUPT_I2SIN (1<<13)
451 #define INTERRUPT_I2SOUT (1<<14)
452 #define INTERRUPT_UART (1<<15)
453 #define INTERRUPT_GPIOD (1<<16)
454 /* 17 reserved */
455 #define INTERRUPT_CGU (1<<18)
456 #define INTERRUPT_MEMORY_STICK (1<<19)
457 #define INTERRUPT_DBOP (1<<20)
458 /* 21-28 reserved */
459 #define INTERRUPT_GPIOA (1<<29)
460 #define INTERRUPT_GPIOB (1<<30)
461 #define INTERRUPT_GPIOC (1<<31)
463 /* I2SOUT registers */
465 #define I2SOUT_CONTROL (*(volatile unsigned char*)(I2SOUT_BASE+0x00))
466 #define I2SOUT_MASK (*(volatile unsigned char*)(I2SOUT_BASE+0x04))
467 #define I2SOUT_RAW_STATUS (*(volatile unsigned char*)(I2SOUT_BASE+0x08))
468 #define I2SOUT_STATUS (*(volatile unsigned char*)(I2SOUT_BASE+0x0C))
469 #define I2SOUT_CLEAR (*(volatile unsigned char*)(I2SOUT_BASE+0x10))
470 #define I2SOUT_DATA (volatile unsigned long*)(I2SOUT_BASE+0x14)
472 #endif /*__AS3525_H__*/