aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-spear3xx/include
diff options
context:
space:
mode:
authorviresh kumar <viresh.kumar@st.com>2010-05-03 04:24:30 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-05-04 11:54:54 -0400
commit4c18e77f718cdda33363132127db4df795eadbd9 (patch)
treebbecdc08f487246049bb6d0c212d338a9056597a /arch/arm/mach-spear3xx/include
parentff37f6e5910c4fd7ad42063d89c0687def665941 (diff)
ARM: 6091/1: ST SPEAr: Adding support for shared irq layer
Multiple peripherals in SPEAr share common hardware interrupt lines. This patch adds support for a shared irq layer, which registers hardware irqs by itself and exposes virtual irq numbers to peripherals. Signed-off-by: Viresh Kumar <viresh.kumar@st.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-spear3xx/include')
-rw-r--r--arch/arm/mach-spear3xx/include/mach/irqs.h101
-rw-r--r--arch/arm/mach-spear3xx/include/mach/spear300.h16
-rw-r--r--arch/arm/mach-spear3xx/include/mach/spear310.h24
-rw-r--r--arch/arm/mach-spear3xx/include/mach/spear320.h26
4 files changed, 160 insertions, 7 deletions
diff --git a/arch/arm/mach-spear3xx/include/mach/irqs.h b/arch/arm/mach-spear3xx/include/mach/irqs.h
index fe980e07b6ab..7f940b818473 100644
--- a/arch/arm/mach-spear3xx/include/mach/irqs.h
+++ b/arch/arm/mach-spear3xx/include/mach/irqs.h
@@ -14,7 +14,7 @@
14#ifndef __MACH_IRQS_H 14#ifndef __MACH_IRQS_H
15#define __MACH_IRQS_H 15#define __MACH_IRQS_H
16 16
17/* IRQ definitions */ 17/* SPEAr3xx IRQ definitions */
18#define IRQ_HW_ACCEL_MOD_0 0 18#define IRQ_HW_ACCEL_MOD_0 0
19#define IRQ_INTRCOMM_RAS_ARM 1 19#define IRQ_INTRCOMM_RAS_ARM 1
20#define IRQ_CPU_GPT1_1 2 20#define IRQ_CPU_GPT1_1 2
@@ -50,16 +50,103 @@
50#define IRQ_HW_ACCEL_MOD_1 31 50#define IRQ_HW_ACCEL_MOD_1 31
51#define IRQ_VIC_END 32 51#define IRQ_VIC_END 32
52 52
53#define SPEAR_GPIO_INT_BASE IRQ_VIC_END 53#define VIRQ_START IRQ_VIC_END
54 54
55/* SPEAr300 Virtual irq definitions */
55#ifdef CONFIG_MACH_SPEAR300 56#ifdef CONFIG_MACH_SPEAR300
56#define SPEAR_GPIO1_INT_BASE (SPEAR_GPIO_INT_BASE + 8) 57/* IRQs sharing IRQ_GEN_RAS_1 */
57#define SPEAR_GPIO_INT_END (SPEAR_GPIO1_INT_BASE + 8) 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_SDIO 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 */
58#else 111#else
59#define SPEAR_GPIO_INT_END (SPEAR_GPIO_INT_BASE + 8) 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_SDIO 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)
60#endif 147#endif
61 148
62#define VIRTUAL_IRQS (SPEAR_GPIO_INT_END - IRQ_VIC_END) 149#define VIRQ_END SPEAR_GPIO_INT_END
63#define NR_IRQS (IRQ_VIC_END + VIRTUAL_IRQS) 150#define NR_IRQS VIRQ_END
64 151
65#endif /* __MACH_IRQS_H */ 152#endif /* __MACH_IRQS_H */
diff --git a/arch/arm/mach-spear3xx/include/mach/spear300.h b/arch/arm/mach-spear3xx/include/mach/spear300.h
index 40c16f385cfa..ccaa76522ee2 100644
--- a/arch/arm/mach-spear3xx/include/mach/spear300.h
+++ b/arch/arm/mach-spear3xx/include/mach/spear300.h
@@ -20,6 +20,22 @@
20#define SPEAR300_TELECOM_BASE 0x50000000 20#define SPEAR300_TELECOM_BASE 0x50000000
21#define SPEAR300_TELECOM_SIZE 0x10000000 21#define SPEAR300_TELECOM_SIZE 0x10000000
22 22
23/* Interrupt registers offsets and masks */
24#define SPEAR300_TELECOM_REG_SIZE 0x00010000
25#define INT_ENB_MASK_REG 0x54
26#define INT_STS_MASK_REG 0x58
27#define IT_PERS_S_IRQ_MASK (1 << 0)
28#define IT_CHANGE_S_IRQ_MASK (1 << 1)
29#define I2S_IRQ_MASK (1 << 2)
30#define TDM_IRQ_MASK (1 << 3)
31#define CAMERA_L_IRQ_MASK (1 << 4)
32#define CAMERA_F_IRQ_MASK (1 << 5)
33#define CAMERA_V_IRQ_MASK (1 << 6)
34#define KEYBOARD_IRQ_MASK (1 << 7)
35#define GPIO1_IRQ_MASK (1 << 8)
36
37#define SHIRQ_RAS1_MASK 0x1FF
38
23#define SPEAR300_CLCD_BASE 0x60000000 39#define SPEAR300_CLCD_BASE 0x60000000
24#define SPEAR300_CLCD_SIZE 0x10000000 40#define SPEAR300_CLCD_SIZE 0x10000000
25 41
diff --git a/arch/arm/mach-spear3xx/include/mach/spear310.h b/arch/arm/mach-spear3xx/include/mach/spear310.h
index d4f58d6469d9..b27bb8af3309 100644
--- a/arch/arm/mach-spear3xx/include/mach/spear310.h
+++ b/arch/arm/mach-spear3xx/include/mach/spear310.h
@@ -40,6 +40,30 @@
40 40
41#define SPEAR310_SOC_CONFIG_BASE 0xB4000000 41#define SPEAR310_SOC_CONFIG_BASE 0xB4000000
42#define SPEAR310_SOC_CONFIG_SIZE 0x00000070 42#define SPEAR310_SOC_CONFIG_SIZE 0x00000070
43/* Interrupt registers offsets and masks */
44#define INT_STS_MASK_REG 0x04
45#define SMII0_IRQ_MASK (1 << 0)
46#define SMII1_IRQ_MASK (1 << 1)
47#define SMII2_IRQ_MASK (1 << 2)
48#define SMII3_IRQ_MASK (1 << 3)
49#define WAKEUP_SMII0_IRQ_MASK (1 << 4)
50#define WAKEUP_SMII1_IRQ_MASK (1 << 5)
51#define WAKEUP_SMII2_IRQ_MASK (1 << 6)
52#define WAKEUP_SMII3_IRQ_MASK (1 << 7)
53#define UART1_IRQ_MASK (1 << 8)
54#define UART2_IRQ_MASK (1 << 9)
55#define UART3_IRQ_MASK (1 << 10)
56#define UART4_IRQ_MASK (1 << 11)
57#define UART5_IRQ_MASK (1 << 12)
58#define EMI_IRQ_MASK (1 << 13)
59#define TDM_HDLC_IRQ_MASK (1 << 14)
60#define RS485_0_IRQ_MASK (1 << 15)
61#define RS485_1_IRQ_MASK (1 << 16)
62
63#define SHIRQ_RAS1_MASK 0x000FF
64#define SHIRQ_RAS2_MASK 0x01F00
65#define SHIRQ_RAS3_MASK 0x02000
66#define SHIRQ_INTRCOMM_RAS_MASK 0x1C000
43 67
44#endif /* __MACH_SPEAR310_H */ 68#endif /* __MACH_SPEAR310_H */
45 69
diff --git a/arch/arm/mach-spear3xx/include/mach/spear320.h b/arch/arm/mach-spear3xx/include/mach/spear320.h
index e8ad2ed82e24..cacf17a958cd 100644
--- a/arch/arm/mach-spear3xx/include/mach/spear320.h
+++ b/arch/arm/mach-spear3xx/include/mach/spear320.h
@@ -64,6 +64,32 @@
64 64
65#define SPEAR320_SOC_CONFIG_BASE 0xB4000000 65#define SPEAR320_SOC_CONFIG_BASE 0xB4000000
66#define SPEAR320_SOC_CONFIG_SIZE 0x00000070 66#define SPEAR320_SOC_CONFIG_SIZE 0x00000070
67/* Interrupt registers offsets and masks */
68#define INT_STS_MASK_REG 0x04
69#define INT_CLR_MASK_REG 0x04
70#define INT_ENB_MASK_REG 0x08
71#define GPIO_IRQ_MASK (1 << 0)
72#define I2S_PLAY_IRQ_MASK (1 << 1)
73#define I2S_REC_IRQ_MASK (1 << 2)
74#define EMI_IRQ_MASK (1 << 7)
75#define CLCD_IRQ_MASK (1 << 8)
76#define SPP_IRQ_MASK (1 << 9)
77#define SDIO_IRQ_MASK (1 << 10)
78#define CAN_U_IRQ_MASK (1 << 11)
79#define CAN_L_IRQ_MASK (1 << 12)
80#define UART1_IRQ_MASK (1 << 13)
81#define UART2_IRQ_MASK (1 << 14)
82#define SSP1_IRQ_MASK (1 << 15)
83#define SSP2_IRQ_MASK (1 << 16)
84#define SMII0_IRQ_MASK (1 << 17)
85#define MII1_SMII1_IRQ_MASK (1 << 18)
86#define WAKEUP_SMII0_IRQ_MASK (1 << 19)
87#define WAKEUP_MII1_SMII1_IRQ_MASK (1 << 20)
88#define I2C1_IRQ_MASK (1 << 21)
89
90#define SHIRQ_RAS1_MASK 0x000380
91#define SHIRQ_RAS3_MASK 0x000007
92#define SHIRQ_INTRCOMM_RAS_MASK 0x3FF800
67 93
68#endif /* __MACH_SPEAR320_H */ 94#endif /* __MACH_SPEAR320_H */
69 95