1 /*
2  * arch/arm/mach-spear3xx/include/mach/irqs.h
3  *
4  * IRQ helper macros for SPEAr3xx machine family
5  *
6  * Copyright (C) 2009 ST Microelectronics
7  * Viresh Kumar<viresh.kumar@st.com>
8  *
9  * This file is licensed under the terms of the GNU General Public
10  * License version 2. This program is licensed "as is" without any
11  * warranty of any kind, whether express or implied.
12  */
13 
14 #ifndef __MACH_IRQS_H
15 #define __MACH_IRQS_H
16 
17 /* SPEAr3xx IRQ definitions */
18 #define IRQ_HW_ACCEL_MOD_0			0
19 #define IRQ_INTRCOMM_RAS_ARM			1
20 #define IRQ_CPU_GPT1_1				2
21 #define IRQ_CPU_GPT1_2				3
22 #define IRQ_BASIC_GPT1_1			4
23 #define IRQ_BASIC_GPT1_2			5
24 #define IRQ_BASIC_GPT2_1			6
25 #define IRQ_BASIC_GPT2_2			7
26 #define IRQ_BASIC_DMA				8
27 #define IRQ_BASIC_SMI				9
28 #define IRQ_BASIC_RTC				10
29 #define IRQ_BASIC_GPIO				11
30 #define IRQ_BASIC_WDT				12
31 #define IRQ_DDR_CONTROLLER			13
32 #define IRQ_SYS_ERROR				14
33 #define IRQ_WAKEUP_RCV				15
34 #define IRQ_JPEG				16
35 #define IRQ_IRDA				17
36 #define IRQ_ADC					18
37 #define IRQ_UART				19
38 #define IRQ_SSP					20
39 #define IRQ_I2C					21
40 #define IRQ_MAC_1				22
41 #define IRQ_MAC_2				23
42 #define IRQ_USB_DEV				24
43 #define IRQ_USB_H_OHCI_0			25
44 #define IRQ_USB_H_EHCI_0			26
45 #define IRQ_USB_H_EHCI_1			IRQ_USB_H_EHCI_0
46 #define IRQ_USB_H_OHCI_1			27
47 #define IRQ_GEN_RAS_1				28
48 #define IRQ_GEN_RAS_2				29
49 #define IRQ_GEN_RAS_3				30
50 #define IRQ_HW_ACCEL_MOD_1			31
51 #define IRQ_VIC_END				32
52 
53 #define VIRQ_START				IRQ_VIC_END
54 
55 /* SPEAr300 Virtual irq definitions */
56 #ifdef CONFIG_MACH_SPEAR300
57 /* IRQs sharing IRQ_GEN_RAS_1 */
58 #define VIRQ_IT_PERS_S				(VIRQ_START + 0)
59 #define VIRQ_IT_CHANGE_S			(VIRQ_START + 1)
60 #define VIRQ_I2S				(VIRQ_START + 2)
61 #define VIRQ_TDM				(VIRQ_START + 3)
62 #define VIRQ_CAMERA_L				(VIRQ_START + 4)
63 #define VIRQ_CAMERA_F				(VIRQ_START + 5)
64 #define VIRQ_CAMERA_V				(VIRQ_START + 6)
65 #define VIRQ_KEYBOARD				(VIRQ_START + 7)
66 #define VIRQ_GPIO1				(VIRQ_START + 8)
67 
68 /* IRQs sharing IRQ_GEN_RAS_3 */
69 #define IRQ_CLCD				IRQ_GEN_RAS_3
70 
71 /* IRQs sharing IRQ_INTRCOMM_RAS_ARM */
72 #define IRQ_SDHCI				IRQ_INTRCOMM_RAS_ARM
73 
74 /* GPIO pins virtual irqs */
75 #define SPEAR_GPIO_INT_BASE			(VIRQ_START + 9)
76 #define SPEAR_GPIO1_INT_BASE			(SPEAR_GPIO_INT_BASE + 8)
77 #define SPEAR_GPIO_INT_END			(SPEAR_GPIO1_INT_BASE + 8)
78 
79 /* SPEAr310 Virtual irq definitions */
80 #elif defined(CONFIG_MACH_SPEAR310)
81 /* IRQs sharing IRQ_GEN_RAS_1 */
82 #define VIRQ_SMII0				(VIRQ_START + 0)
83 #define VIRQ_SMII1				(VIRQ_START + 1)
84 #define VIRQ_SMII2				(VIRQ_START + 2)
85 #define VIRQ_SMII3				(VIRQ_START + 3)
86 #define VIRQ_WAKEUP_SMII0			(VIRQ_START + 4)
87 #define VIRQ_WAKEUP_SMII1			(VIRQ_START + 5)
88 #define VIRQ_WAKEUP_SMII2			(VIRQ_START + 6)
89 #define VIRQ_WAKEUP_SMII3			(VIRQ_START + 7)
90 
91 /* IRQs sharing IRQ_GEN_RAS_2 */
92 #define VIRQ_UART1				(VIRQ_START + 8)
93 #define VIRQ_UART2				(VIRQ_START + 9)
94 #define VIRQ_UART3				(VIRQ_START + 10)
95 #define VIRQ_UART4				(VIRQ_START + 11)
96 #define VIRQ_UART5				(VIRQ_START + 12)
97 
98 /* IRQs sharing IRQ_GEN_RAS_3 */
99 #define VIRQ_EMI				(VIRQ_START + 13)
100 #define VIRQ_PLGPIO				(VIRQ_START + 14)
101 
102 /* IRQs sharing IRQ_INTRCOMM_RAS_ARM */
103 #define VIRQ_TDM_HDLC				(VIRQ_START + 15)
104 #define VIRQ_RS485_0				(VIRQ_START + 16)
105 #define VIRQ_RS485_1				(VIRQ_START + 17)
106 
107 /* GPIO pins virtual irqs */
108 #define SPEAR_GPIO_INT_BASE			(VIRQ_START + 18)
109 
110 /* SPEAr320 Virtual irq definitions */
111 #else
112 /* IRQs sharing IRQ_GEN_RAS_1 */
113 #define VIRQ_EMI				(VIRQ_START + 0)
114 #define VIRQ_CLCD				(VIRQ_START + 1)
115 #define VIRQ_SPP				(VIRQ_START + 2)
116 
117 /* IRQs sharing IRQ_GEN_RAS_2 */
118 #define IRQ_SDHCI				IRQ_GEN_RAS_2
119 
120 /* IRQs sharing IRQ_GEN_RAS_3 */
121 #define VIRQ_PLGPIO				(VIRQ_START + 3)
122 #define VIRQ_I2S_PLAY				(VIRQ_START + 4)
123 #define VIRQ_I2S_REC				(VIRQ_START + 5)
124 
125 /* IRQs sharing IRQ_INTRCOMM_RAS_ARM */
126 #define VIRQ_CANU				(VIRQ_START + 6)
127 #define VIRQ_CANL				(VIRQ_START + 7)
128 #define VIRQ_UART1				(VIRQ_START + 8)
129 #define VIRQ_UART2				(VIRQ_START + 9)
130 #define VIRQ_SSP1				(VIRQ_START + 10)
131 #define VIRQ_SSP2				(VIRQ_START + 11)
132 #define VIRQ_SMII0				(VIRQ_START + 12)
133 #define VIRQ_MII1_SMII1				(VIRQ_START + 13)
134 #define VIRQ_WAKEUP_SMII0			(VIRQ_START + 14)
135 #define VIRQ_WAKEUP_MII1_SMII1			(VIRQ_START + 15)
136 #define VIRQ_I2C				(VIRQ_START + 16)
137 
138 /* GPIO pins virtual irqs */
139 #define SPEAR_GPIO_INT_BASE			(VIRQ_START + 17)
140 
141 #endif
142 
143 /* PLGPIO Virtual IRQs */
144 #if defined(CONFIG_MACH_SPEAR310) || defined(CONFIG_MACH_SPEAR320)
145 #define SPEAR_PLGPIO_INT_BASE			(SPEAR_GPIO_INT_BASE + 8)
146 #define SPEAR_GPIO_INT_END			(SPEAR_PLGPIO_INT_BASE + 102)
147 #endif
148 
149 #define VIRQ_END				SPEAR_GPIO_INT_END
150 #define NR_IRQS					VIRQ_END
151 
152 #endif /* __MACH_IRQS_H */
153