e8e4d996743d573b210f67fc6b46688d34a1a828
[15.05/openwrt.git] / target / linux / adm5120 / files / include / asm-mips / mach-adm5120 / adm5120_intc.h
1 /*
2  *  $Id$
3  *
4  *  ADM5120 interrupt controller definitions
5  *
6  *  This header file defines the hardware registers of the ADM5120 SoC
7  *  built-in interrupt controller.
8  *
9  *  Copyright (C) 2007 OpenWrt.org
10  *  Copyright (C) 2007 Gabor Juhos <juhosg at openwrt.org>
11  *
12  *  This program is free software; you can redistribute it and/or modify it
13  *  under the terms of the GNU General Public License version 2 as published
14  *  by the Free Software Foundation.
15  *
16  */
17
18 #ifndef _ADM5120_INTC_H_
19 #define _ADM5120_INTC_H_
20
21 /*
22  * INTC register offsets
23  */
24 #define INTC_REG_IRQ_STATUS             0x00 /* Interrupt status after masking */
25 #define INTC_REG_IRQ_RAW_STATUS         0x04 /* Interrupt status before masking */
26 #define INTC_REG_IRQ_ENABLE             0x08 /* Used to enable the interrupt sources */
27 #define INTC_REG_IRQ_ENABLE_CLEAR       0x0C /* Used to disable the interrupt sources */
28 #define INTC_REG_IRQ_DISABLE            INTC_REG_IRQ_ENABLE_CLEAR
29 #define INTC_REG_INT_MODE               0x14 /* The interrupt mode of the sources */
30 #define INTC_REG_FIQ_STATUS             0x18 /* FIQ status */
31 #define INTC_REG_IRQ_TEST_SOURCE        0x1C
32 #define INTC_REG_IRQ_SOURCE_SELECT      0x20
33 #define INTC_REG_INT_LEVEL              0x24
34
35 /*
36  * INTC IRQ numbers
37  */
38 #define INTC_IRQ_TIMER  0       /* built in timer */
39 #define INTC_IRQ_UART0  1       /* built-in UART0 */
40 #define INTC_IRQ_UART1  2       /* built-in UART1 */
41 #define INTC_IRQ_USBC   3       /* USB Host Controller */
42 #define INTC_IRQ_GPIO2  4       /* GPIO line 2 */
43 #define INTC_IRQ_GPIO4  5       /* GPIO line 4 */
44 #define INTC_IRQ_PCI0   6       /* PCI slot 2 */
45 #define INTC_IRQ_PCI1   7       /* PCI slot 3 */
46 #define INTC_IRQ_PCI2   8       /* PCI slot 4 */
47 #define INTC_IRQ_SWITCH 9       /* built-in ethernet switch */
48 #define INTC_IRQ_LAST   INTC_IRQ_SWITCH
49 #define INTC_IRQ_COUNT  10
50
51 /*
52  * INTC register bits
53  */
54 #define INTC_INT_TIMER  ( 1 << INTC_IRQ_TIMER )
55 #define INTC_INT_UART0  ( 1 << INTC_IRQ_UART0 )
56 #define INTC_INT_UART1  ( 1 << INTC_IRQ_UART1 )
57 #define INTC_INT_USBC   ( 1 << INTC_IRQ_USBC )
58 #define INTC_INT_INTX0  ( 1 << INTC_IRQ_INTX0 )
59 #define INTC_INT_INTX1  ( 1 << INTC_IRQ_INTX1 )
60 #define INTC_INT_PCI0   ( 1 << INTC_IRQ_PCI0 )
61 #define INTC_INT_PCI1   ( 1 << INTC_IRQ_PCI1 )
62 #define INTC_INT_PCI2   ( 1 << INTC_IRQ_PCI2 )
63 #define INTC_INT_SWITCH ( 1 << INTC_IRQ_SWITCH )
64 #define INTC_INT_ALL    (( 1 << INTC_IRQ_COUNT)-1)
65
66 #endif /* _ADM5120_INTC_H_ */