aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorLudovic Desroches <ludovic.desroches@atmel.com>2012-06-20 10:13:30 -0400
committerNicolas Ferre <nicolas.ferre@atmel.com>2012-07-02 08:26:58 -0400
commitf8a073ee378b9893aee0749c3868a6ecfb0c1636 (patch)
tree7d51d97410bb03bc6ca8b431b3df8592b206b7f7 /arch/arm
parentc65739437045c351a2a0ddb834719b9d616d4d47 (diff)
ARM: at91: add of irq priorities support
Add a third cell to define irq priority. Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Reviewed-by: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/boot/dts/at91sam9260.dtsi36
-rw-r--r--arch/arm/boot/dts/at91sam9263.dtsi30
-rw-r--r--arch/arm/boot/dts/at91sam9g45.dtsi38
-rw-r--r--arch/arm/boot/dts/at91sam9n12.dtsi30
-rw-r--r--arch/arm/boot/dts/at91sam9x5.dtsi38
-rw-r--r--arch/arm/mach-at91/include/mach/at91_aic.h3
-rw-r--r--arch/arm/mach-at91/irq.c34
7 files changed, 120 insertions, 89 deletions
diff --git a/arch/arm/boot/dts/at91sam9260.dtsi b/arch/arm/boot/dts/at91sam9260.dtsi
index f2c96430f9cb..66389c1c6f62 100644
--- a/arch/arm/boot/dts/at91sam9260.dtsi
+++ b/arch/arm/boot/dts/at91sam9260.dtsi
@@ -52,7 +52,7 @@
52 ranges; 52 ranges;
53 53
54 aic: interrupt-controller@fffff000 { 54 aic: interrupt-controller@fffff000 {
55 #interrupt-cells = <2>; 55 #interrupt-cells = <3>;
56 compatible = "atmel,at91rm9200-aic"; 56 compatible = "atmel,at91rm9200-aic";
57 interrupt-controller; 57 interrupt-controller;
58 reg = <0xfffff000 0x200>; 58 reg = <0xfffff000 0x200>;
@@ -82,25 +82,25 @@
82 pit: timer@fffffd30 { 82 pit: timer@fffffd30 {
83 compatible = "atmel,at91sam9260-pit"; 83 compatible = "atmel,at91sam9260-pit";
84 reg = <0xfffffd30 0xf>; 84 reg = <0xfffffd30 0xf>;
85 interrupts = <1 4>; 85 interrupts = <1 4 7>;
86 }; 86 };
87 87
88 tcb0: timer@fffa0000 { 88 tcb0: timer@fffa0000 {
89 compatible = "atmel,at91rm9200-tcb"; 89 compatible = "atmel,at91rm9200-tcb";
90 reg = <0xfffa0000 0x100>; 90 reg = <0xfffa0000 0x100>;
91 interrupts = <17 4 18 4 19 4>; 91 interrupts = <17 4 0 18 4 0 19 4 0>;
92 }; 92 };
93 93
94 tcb1: timer@fffdc000 { 94 tcb1: timer@fffdc000 {
95 compatible = "atmel,at91rm9200-tcb"; 95 compatible = "atmel,at91rm9200-tcb";
96 reg = <0xfffdc000 0x100>; 96 reg = <0xfffdc000 0x100>;
97 interrupts = <26 4 27 4 28 4>; 97 interrupts = <26 4 0 27 4 0 28 4 0>;
98 }; 98 };
99 99
100 pioA: gpio@fffff400 { 100 pioA: gpio@fffff400 {
101 compatible = "atmel,at91rm9200-gpio"; 101 compatible = "atmel,at91rm9200-gpio";
102 reg = <0xfffff400 0x100>; 102 reg = <0xfffff400 0x100>;
103 interrupts = <2 4>; 103 interrupts = <2 4 1>;
104 #gpio-cells = <2>; 104 #gpio-cells = <2>;
105 gpio-controller; 105 gpio-controller;
106 interrupt-controller; 106 interrupt-controller;
@@ -109,7 +109,7 @@
109 pioB: gpio@fffff600 { 109 pioB: gpio@fffff600 {
110 compatible = "atmel,at91rm9200-gpio"; 110 compatible = "atmel,at91rm9200-gpio";
111 reg = <0xfffff600 0x100>; 111 reg = <0xfffff600 0x100>;
112 interrupts = <3 4>; 112 interrupts = <3 4 1>;
113 #gpio-cells = <2>; 113 #gpio-cells = <2>;
114 gpio-controller; 114 gpio-controller;
115 interrupt-controller; 115 interrupt-controller;
@@ -118,7 +118,7 @@
118 pioC: gpio@fffff800 { 118 pioC: gpio@fffff800 {
119 compatible = "atmel,at91rm9200-gpio"; 119 compatible = "atmel,at91rm9200-gpio";
120 reg = <0xfffff800 0x100>; 120 reg = <0xfffff800 0x100>;
121 interrupts = <4 4>; 121 interrupts = <4 4 1>;
122 #gpio-cells = <2>; 122 #gpio-cells = <2>;
123 gpio-controller; 123 gpio-controller;
124 interrupt-controller; 124 interrupt-controller;
@@ -127,14 +127,14 @@
127 dbgu: serial@fffff200 { 127 dbgu: serial@fffff200 {
128 compatible = "atmel,at91sam9260-usart"; 128 compatible = "atmel,at91sam9260-usart";
129 reg = <0xfffff200 0x200>; 129 reg = <0xfffff200 0x200>;
130 interrupts = <1 4>; 130 interrupts = <1 4 7>;
131 status = "disabled"; 131 status = "disabled";
132 }; 132 };
133 133
134 usart0: serial@fffb0000 { 134 usart0: serial@fffb0000 {
135 compatible = "atmel,at91sam9260-usart"; 135 compatible = "atmel,at91sam9260-usart";
136 reg = <0xfffb0000 0x200>; 136 reg = <0xfffb0000 0x200>;
137 interrupts = <6 4>; 137 interrupts = <6 4 5>;
138 atmel,use-dma-rx; 138 atmel,use-dma-rx;
139 atmel,use-dma-tx; 139 atmel,use-dma-tx;
140 status = "disabled"; 140 status = "disabled";
@@ -143,7 +143,7 @@
143 usart1: serial@fffb4000 { 143 usart1: serial@fffb4000 {
144 compatible = "atmel,at91sam9260-usart"; 144 compatible = "atmel,at91sam9260-usart";
145 reg = <0xfffb4000 0x200>; 145 reg = <0xfffb4000 0x200>;
146 interrupts = <7 4>; 146 interrupts = <7 4 5>;
147 atmel,use-dma-rx; 147 atmel,use-dma-rx;
148 atmel,use-dma-tx; 148 atmel,use-dma-tx;
149 status = "disabled"; 149 status = "disabled";
@@ -152,7 +152,7 @@
152 usart2: serial@fffb8000 { 152 usart2: serial@fffb8000 {
153 compatible = "atmel,at91sam9260-usart"; 153 compatible = "atmel,at91sam9260-usart";
154 reg = <0xfffb8000 0x200>; 154 reg = <0xfffb8000 0x200>;
155 interrupts = <8 4>; 155 interrupts = <8 4 5>;
156 atmel,use-dma-rx; 156 atmel,use-dma-rx;
157 atmel,use-dma-tx; 157 atmel,use-dma-tx;
158 status = "disabled"; 158 status = "disabled";
@@ -161,7 +161,7 @@
161 usart3: serial@fffd0000 { 161 usart3: serial@fffd0000 {
162 compatible = "atmel,at91sam9260-usart"; 162 compatible = "atmel,at91sam9260-usart";
163 reg = <0xfffd0000 0x200>; 163 reg = <0xfffd0000 0x200>;
164 interrupts = <23 4>; 164 interrupts = <23 4 5>;
165 atmel,use-dma-rx; 165 atmel,use-dma-rx;
166 atmel,use-dma-tx; 166 atmel,use-dma-tx;
167 status = "disabled"; 167 status = "disabled";
@@ -170,7 +170,7 @@
170 usart4: serial@fffd4000 { 170 usart4: serial@fffd4000 {
171 compatible = "atmel,at91sam9260-usart"; 171 compatible = "atmel,at91sam9260-usart";
172 reg = <0xfffd4000 0x200>; 172 reg = <0xfffd4000 0x200>;
173 interrupts = <24 4>; 173 interrupts = <24 4 5>;
174 atmel,use-dma-rx; 174 atmel,use-dma-rx;
175 atmel,use-dma-tx; 175 atmel,use-dma-tx;
176 status = "disabled"; 176 status = "disabled";
@@ -179,7 +179,7 @@
179 usart5: serial@fffd8000 { 179 usart5: serial@fffd8000 {
180 compatible = "atmel,at91sam9260-usart"; 180 compatible = "atmel,at91sam9260-usart";
181 reg = <0xfffd8000 0x200>; 181 reg = <0xfffd8000 0x200>;
182 interrupts = <25 4>; 182 interrupts = <25 4 5>;
183 atmel,use-dma-rx; 183 atmel,use-dma-rx;
184 atmel,use-dma-tx; 184 atmel,use-dma-tx;
185 status = "disabled"; 185 status = "disabled";
@@ -188,21 +188,21 @@
188 macb0: ethernet@fffc4000 { 188 macb0: ethernet@fffc4000 {
189 compatible = "cdns,at32ap7000-macb", "cdns,macb"; 189 compatible = "cdns,at32ap7000-macb", "cdns,macb";
190 reg = <0xfffc4000 0x100>; 190 reg = <0xfffc4000 0x100>;
191 interrupts = <21 4>; 191 interrupts = <21 4 3>;
192 status = "disabled"; 192 status = "disabled";
193 }; 193 };
194 194
195 usb1: gadget@fffa4000 { 195 usb1: gadget@fffa4000 {
196 compatible = "atmel,at91rm9200-udc"; 196 compatible = "atmel,at91rm9200-udc";
197 reg = <0xfffa4000 0x4000>; 197 reg = <0xfffa4000 0x4000>;
198 interrupts = <10 4>; 198 interrupts = <10 4 2>;
199 status = "disabled"; 199 status = "disabled";
200 }; 200 };
201 201
202 adc0: adc@fffe0000 { 202 adc0: adc@fffe0000 {
203 compatible = "atmel,at91sam9260-adc"; 203 compatible = "atmel,at91sam9260-adc";
204 reg = <0xfffe0000 0x100>; 204 reg = <0xfffe0000 0x100>;
205 interrupts = <5 4>; 205 interrupts = <5 4 0>;
206 atmel,adc-use-external-triggers; 206 atmel,adc-use-external-triggers;
207 atmel,adc-channels-used = <0xf>; 207 atmel,adc-channels-used = <0xf>;
208 atmel,adc-vref = <3300>; 208 atmel,adc-vref = <3300>;
@@ -254,7 +254,7 @@
254 usb0: ohci@00500000 { 254 usb0: ohci@00500000 {
255 compatible = "atmel,at91rm9200-ohci", "usb-ohci"; 255 compatible = "atmel,at91rm9200-ohci", "usb-ohci";
256 reg = <0x00500000 0x100000>; 256 reg = <0x00500000 0x100000>;
257 interrupts = <20 4>; 257 interrupts = <20 4 2>;
258 status = "disabled"; 258 status = "disabled";
259 }; 259 };
260 }; 260 };
diff --git a/arch/arm/boot/dts/at91sam9263.dtsi b/arch/arm/boot/dts/at91sam9263.dtsi
index c803636ca9f5..b460d6ce9eb5 100644
--- a/arch/arm/boot/dts/at91sam9263.dtsi
+++ b/arch/arm/boot/dts/at91sam9263.dtsi
@@ -48,7 +48,7 @@
48 ranges; 48 ranges;
49 49
50 aic: interrupt-controller@fffff000 { 50 aic: interrupt-controller@fffff000 {
51 #interrupt-cells = <2>; 51 #interrupt-cells = <3>;
52 compatible = "atmel,at91rm9200-aic"; 52 compatible = "atmel,at91rm9200-aic";
53 interrupt-controller; 53 interrupt-controller;
54 reg = <0xfffff000 0x200>; 54 reg = <0xfffff000 0x200>;
@@ -69,13 +69,13 @@
69 pit: timer@fffffd30 { 69 pit: timer@fffffd30 {
70 compatible = "atmel,at91sam9260-pit"; 70 compatible = "atmel,at91sam9260-pit";
71 reg = <0xfffffd30 0xf>; 71 reg = <0xfffffd30 0xf>;
72 interrupts = <1 4>; 72 interrupts = <1 4 7>;
73 }; 73 };
74 74
75 tcb0: timer@fff7c000 { 75 tcb0: timer@fff7c000 {
76 compatible = "atmel,at91rm9200-tcb"; 76 compatible = "atmel,at91rm9200-tcb";
77 reg = <0xfff7c000 0x100>; 77 reg = <0xfff7c000 0x100>;
78 interrupts = <19 4>; 78 interrupts = <19 4 0>;
79 }; 79 };
80 80
81 rstc@fffffd00 { 81 rstc@fffffd00 {
@@ -91,7 +91,7 @@
91 pioA: gpio@fffff200 { 91 pioA: gpio@fffff200 {
92 compatible = "atmel,at91rm9200-gpio"; 92 compatible = "atmel,at91rm9200-gpio";
93 reg = <0xfffff200 0x100>; 93 reg = <0xfffff200 0x100>;
94 interrupts = <2 4>; 94 interrupts = <2 4 1>;
95 #gpio-cells = <2>; 95 #gpio-cells = <2>;
96 gpio-controller; 96 gpio-controller;
97 interrupt-controller; 97 interrupt-controller;
@@ -100,7 +100,7 @@
100 pioB: gpio@fffff400 { 100 pioB: gpio@fffff400 {
101 compatible = "atmel,at91rm9200-gpio"; 101 compatible = "atmel,at91rm9200-gpio";
102 reg = <0xfffff400 0x100>; 102 reg = <0xfffff400 0x100>;
103 interrupts = <3 4>; 103 interrupts = <3 4 1>;
104 #gpio-cells = <2>; 104 #gpio-cells = <2>;
105 gpio-controller; 105 gpio-controller;
106 interrupt-controller; 106 interrupt-controller;
@@ -109,7 +109,7 @@
109 pioC: gpio@fffff600 { 109 pioC: gpio@fffff600 {
110 compatible = "atmel,at91rm9200-gpio"; 110 compatible = "atmel,at91rm9200-gpio";
111 reg = <0xfffff600 0x100>; 111 reg = <0xfffff600 0x100>;
112 interrupts = <4 4>; 112 interrupts = <4 4 1>;
113 #gpio-cells = <2>; 113 #gpio-cells = <2>;
114 gpio-controller; 114 gpio-controller;
115 interrupt-controller; 115 interrupt-controller;
@@ -118,7 +118,7 @@
118 pioD: gpio@fffff800 { 118 pioD: gpio@fffff800 {
119 compatible = "atmel,at91rm9200-gpio"; 119 compatible = "atmel,at91rm9200-gpio";
120 reg = <0xfffff800 0x100>; 120 reg = <0xfffff800 0x100>;
121 interrupts = <4 4>; 121 interrupts = <4 4 1>;
122 #gpio-cells = <2>; 122 #gpio-cells = <2>;
123 gpio-controller; 123 gpio-controller;
124 interrupt-controller; 124 interrupt-controller;
@@ -127,7 +127,7 @@
127 pioE: gpio@fffffa00 { 127 pioE: gpio@fffffa00 {
128 compatible = "atmel,at91rm9200-gpio"; 128 compatible = "atmel,at91rm9200-gpio";
129 reg = <0xfffffa00 0x100>; 129 reg = <0xfffffa00 0x100>;
130 interrupts = <4 4>; 130 interrupts = <4 4 1>;
131 #gpio-cells = <2>; 131 #gpio-cells = <2>;
132 gpio-controller; 132 gpio-controller;
133 interrupt-controller; 133 interrupt-controller;
@@ -136,14 +136,14 @@
136 dbgu: serial@ffffee00 { 136 dbgu: serial@ffffee00 {
137 compatible = "atmel,at91sam9260-usart"; 137 compatible = "atmel,at91sam9260-usart";
138 reg = <0xffffee00 0x200>; 138 reg = <0xffffee00 0x200>;
139 interrupts = <1 4>; 139 interrupts = <1 4 7>;
140 status = "disabled"; 140 status = "disabled";
141 }; 141 };
142 142
143 usart0: serial@fff8c000 { 143 usart0: serial@fff8c000 {
144 compatible = "atmel,at91sam9260-usart"; 144 compatible = "atmel,at91sam9260-usart";
145 reg = <0xfff8c000 0x200>; 145 reg = <0xfff8c000 0x200>;
146 interrupts = <7 4>; 146 interrupts = <7 4 5>;
147 atmel,use-dma-rx; 147 atmel,use-dma-rx;
148 atmel,use-dma-tx; 148 atmel,use-dma-tx;
149 status = "disabled"; 149 status = "disabled";
@@ -152,7 +152,7 @@
152 usart1: serial@fff90000 { 152 usart1: serial@fff90000 {
153 compatible = "atmel,at91sam9260-usart"; 153 compatible = "atmel,at91sam9260-usart";
154 reg = <0xfff90000 0x200>; 154 reg = <0xfff90000 0x200>;
155 interrupts = <8 4>; 155 interrupts = <8 4 5>;
156 atmel,use-dma-rx; 156 atmel,use-dma-rx;
157 atmel,use-dma-tx; 157 atmel,use-dma-tx;
158 status = "disabled"; 158 status = "disabled";
@@ -161,7 +161,7 @@
161 usart2: serial@fff94000 { 161 usart2: serial@fff94000 {
162 compatible = "atmel,at91sam9260-usart"; 162 compatible = "atmel,at91sam9260-usart";
163 reg = <0xfff94000 0x200>; 163 reg = <0xfff94000 0x200>;
164 interrupts = <9 4>; 164 interrupts = <9 4 5>;
165 atmel,use-dma-rx; 165 atmel,use-dma-rx;
166 atmel,use-dma-tx; 166 atmel,use-dma-tx;
167 status = "disabled"; 167 status = "disabled";
@@ -170,14 +170,14 @@
170 macb0: ethernet@fffbc000 { 170 macb0: ethernet@fffbc000 {
171 compatible = "cdns,at32ap7000-macb", "cdns,macb"; 171 compatible = "cdns,at32ap7000-macb", "cdns,macb";
172 reg = <0xfffbc000 0x100>; 172 reg = <0xfffbc000 0x100>;
173 interrupts = <21 4>; 173 interrupts = <21 4 3>;
174 status = "disabled"; 174 status = "disabled";
175 }; 175 };
176 176
177 usb1: gadget@fff78000 { 177 usb1: gadget@fff78000 {
178 compatible = "atmel,at91rm9200-udc"; 178 compatible = "atmel,at91rm9200-udc";
179 reg = <0xfff78000 0x4000>; 179 reg = <0xfff78000 0x4000>;
180 interrupts = <24 4>; 180 interrupts = <24 4 2>;
181 status = "disabled"; 181 status = "disabled";
182 }; 182 };
183 }; 183 };
@@ -201,7 +201,7 @@
201 usb0: ohci@00a00000 { 201 usb0: ohci@00a00000 {
202 compatible = "atmel,at91rm9200-ohci", "usb-ohci"; 202 compatible = "atmel,at91rm9200-ohci", "usb-ohci";
203 reg = <0x00a00000 0x100000>; 203 reg = <0x00a00000 0x100000>;
204 interrupts = <29 4>; 204 interrupts = <29 4 2>;
205 status = "disabled"; 205 status = "disabled";
206 }; 206 };
207 }; 207 };
diff --git a/arch/arm/boot/dts/at91sam9g45.dtsi b/arch/arm/boot/dts/at91sam9g45.dtsi
index 2d01ce2a023f..bafa8806fc17 100644
--- a/arch/arm/boot/dts/at91sam9g45.dtsi
+++ b/arch/arm/boot/dts/at91sam9g45.dtsi
@@ -53,7 +53,7 @@
53 ranges; 53 ranges;
54 54
55 aic: interrupt-controller@fffff000 { 55 aic: interrupt-controller@fffff000 {
56 #interrupt-cells = <2>; 56 #interrupt-cells = <3>;
57 compatible = "atmel,at91rm9200-aic"; 57 compatible = "atmel,at91rm9200-aic";
58 interrupt-controller; 58 interrupt-controller;
59 reg = <0xfffff000 0x200>; 59 reg = <0xfffff000 0x200>;
@@ -79,7 +79,7 @@
79 pit: timer@fffffd30 { 79 pit: timer@fffffd30 {
80 compatible = "atmel,at91sam9260-pit"; 80 compatible = "atmel,at91sam9260-pit";
81 reg = <0xfffffd30 0xf>; 81 reg = <0xfffffd30 0xf>;
82 interrupts = <1 4>; 82 interrupts = <1 4 7>;
83 }; 83 };
84 84
85 85
@@ -91,25 +91,25 @@
91 tcb0: timer@fff7c000 { 91 tcb0: timer@fff7c000 {
92 compatible = "atmel,at91rm9200-tcb"; 92 compatible = "atmel,at91rm9200-tcb";
93 reg = <0xfff7c000 0x100>; 93 reg = <0xfff7c000 0x100>;
94 interrupts = <18 4>; 94 interrupts = <18 4 0>;
95 }; 95 };
96 96
97 tcb1: timer@fffd4000 { 97 tcb1: timer@fffd4000 {
98 compatible = "atmel,at91rm9200-tcb"; 98 compatible = "atmel,at91rm9200-tcb";
99 reg = <0xfffd4000 0x100>; 99 reg = <0xfffd4000 0x100>;
100 interrupts = <18 4>; 100 interrupts = <18 4 0>;
101 }; 101 };
102 102
103 dma: dma-controller@ffffec00 { 103 dma: dma-controller@ffffec00 {
104 compatible = "atmel,at91sam9g45-dma"; 104 compatible = "atmel,at91sam9g45-dma";
105 reg = <0xffffec00 0x200>; 105 reg = <0xffffec00 0x200>;
106 interrupts = <21 4>; 106 interrupts = <21 4 0>;
107 }; 107 };
108 108
109 pioA: gpio@fffff200 { 109 pioA: gpio@fffff200 {
110 compatible = "atmel,at91rm9200-gpio"; 110 compatible = "atmel,at91rm9200-gpio";
111 reg = <0xfffff200 0x100>; 111 reg = <0xfffff200 0x100>;
112 interrupts = <2 4>; 112 interrupts = <2 4 1>;
113 #gpio-cells = <2>; 113 #gpio-cells = <2>;
114 gpio-controller; 114 gpio-controller;
115 interrupt-controller; 115 interrupt-controller;
@@ -118,7 +118,7 @@
118 pioB: gpio@fffff400 { 118 pioB: gpio@fffff400 {
119 compatible = "atmel,at91rm9200-gpio"; 119 compatible = "atmel,at91rm9200-gpio";
120 reg = <0xfffff400 0x100>; 120 reg = <0xfffff400 0x100>;
121 interrupts = <3 4>; 121 interrupts = <3 4 1>;
122 #gpio-cells = <2>; 122 #gpio-cells = <2>;
123 gpio-controller; 123 gpio-controller;
124 interrupt-controller; 124 interrupt-controller;
@@ -127,7 +127,7 @@
127 pioC: gpio@fffff600 { 127 pioC: gpio@fffff600 {
128 compatible = "atmel,at91rm9200-gpio"; 128 compatible = "atmel,at91rm9200-gpio";
129 reg = <0xfffff600 0x100>; 129 reg = <0xfffff600 0x100>;
130 interrupts = <4 4>; 130 interrupts = <4 4 1>;
131 #gpio-cells = <2>; 131 #gpio-cells = <2>;
132 gpio-controller; 132 gpio-controller;
133 interrupt-controller; 133 interrupt-controller;
@@ -136,7 +136,7 @@
136 pioD: gpio@fffff800 { 136 pioD: gpio@fffff800 {
137 compatible = "atmel,at91rm9200-gpio"; 137 compatible = "atmel,at91rm9200-gpio";
138 reg = <0xfffff800 0x100>; 138 reg = <0xfffff800 0x100>;
139 interrupts = <5 4>; 139 interrupts = <5 4 1>;
140 #gpio-cells = <2>; 140 #gpio-cells = <2>;
141 gpio-controller; 141 gpio-controller;
142 interrupt-controller; 142 interrupt-controller;
@@ -145,7 +145,7 @@
145 pioE: gpio@fffffa00 { 145 pioE: gpio@fffffa00 {
146 compatible = "atmel,at91rm9200-gpio"; 146 compatible = "atmel,at91rm9200-gpio";
147 reg = <0xfffffa00 0x100>; 147 reg = <0xfffffa00 0x100>;
148 interrupts = <5 4>; 148 interrupts = <5 4 1>;
149 #gpio-cells = <2>; 149 #gpio-cells = <2>;
150 gpio-controller; 150 gpio-controller;
151 interrupt-controller; 151 interrupt-controller;
@@ -154,14 +154,14 @@
154 dbgu: serial@ffffee00 { 154 dbgu: serial@ffffee00 {
155 compatible = "atmel,at91sam9260-usart"; 155 compatible = "atmel,at91sam9260-usart";
156 reg = <0xffffee00 0x200>; 156 reg = <0xffffee00 0x200>;
157 interrupts = <1 4>; 157 interrupts = <1 4 7>;
158 status = "disabled"; 158 status = "disabled";
159 }; 159 };
160 160
161 usart0: serial@fff8c000 { 161 usart0: serial@fff8c000 {
162 compatible = "atmel,at91sam9260-usart"; 162 compatible = "atmel,at91sam9260-usart";
163 reg = <0xfff8c000 0x200>; 163 reg = <0xfff8c000 0x200>;
164 interrupts = <7 4>; 164 interrupts = <7 4 5>;
165 atmel,use-dma-rx; 165 atmel,use-dma-rx;
166 atmel,use-dma-tx; 166 atmel,use-dma-tx;
167 status = "disabled"; 167 status = "disabled";
@@ -170,7 +170,7 @@
170 usart1: serial@fff90000 { 170 usart1: serial@fff90000 {
171 compatible = "atmel,at91sam9260-usart"; 171 compatible = "atmel,at91sam9260-usart";
172 reg = <0xfff90000 0x200>; 172 reg = <0xfff90000 0x200>;
173 interrupts = <8 4>; 173 interrupts = <8 4 5>;
174 atmel,use-dma-rx; 174 atmel,use-dma-rx;
175 atmel,use-dma-tx; 175 atmel,use-dma-tx;
176 status = "disabled"; 176 status = "disabled";
@@ -179,7 +179,7 @@
179 usart2: serial@fff94000 { 179 usart2: serial@fff94000 {
180 compatible = "atmel,at91sam9260-usart"; 180 compatible = "atmel,at91sam9260-usart";
181 reg = <0xfff94000 0x200>; 181 reg = <0xfff94000 0x200>;
182 interrupts = <9 4>; 182 interrupts = <9 4 5>;
183 atmel,use-dma-rx; 183 atmel,use-dma-rx;
184 atmel,use-dma-tx; 184 atmel,use-dma-tx;
185 status = "disabled"; 185 status = "disabled";
@@ -188,7 +188,7 @@
188 usart3: serial@fff98000 { 188 usart3: serial@fff98000 {
189 compatible = "atmel,at91sam9260-usart"; 189 compatible = "atmel,at91sam9260-usart";
190 reg = <0xfff98000 0x200>; 190 reg = <0xfff98000 0x200>;
191 interrupts = <10 4>; 191 interrupts = <10 4 5>;
192 atmel,use-dma-rx; 192 atmel,use-dma-rx;
193 atmel,use-dma-tx; 193 atmel,use-dma-tx;
194 status = "disabled"; 194 status = "disabled";
@@ -197,14 +197,14 @@
197 macb0: ethernet@fffbc000 { 197 macb0: ethernet@fffbc000 {
198 compatible = "cdns,at32ap7000-macb", "cdns,macb"; 198 compatible = "cdns,at32ap7000-macb", "cdns,macb";
199 reg = <0xfffbc000 0x100>; 199 reg = <0xfffbc000 0x100>;
200 interrupts = <25 4>; 200 interrupts = <25 4 3>;
201 status = "disabled"; 201 status = "disabled";
202 }; 202 };
203 203
204 adc0: adc@fffb0000 { 204 adc0: adc@fffb0000 {
205 compatible = "atmel,at91sam9260-adc"; 205 compatible = "atmel,at91sam9260-adc";
206 reg = <0xfffb0000 0x100>; 206 reg = <0xfffb0000 0x100>;
207 interrupts = <20 4>; 207 interrupts = <20 4 0>;
208 atmel,adc-use-external-triggers; 208 atmel,adc-use-external-triggers;
209 atmel,adc-channels-used = <0xff>; 209 atmel,adc-channels-used = <0xff>;
210 atmel,adc-vref = <3300>; 210 atmel,adc-vref = <3300>;
@@ -258,14 +258,14 @@
258 usb0: ohci@00700000 { 258 usb0: ohci@00700000 {
259 compatible = "atmel,at91rm9200-ohci", "usb-ohci"; 259 compatible = "atmel,at91rm9200-ohci", "usb-ohci";
260 reg = <0x00700000 0x100000>; 260 reg = <0x00700000 0x100000>;
261 interrupts = <22 4>; 261 interrupts = <22 4 2>;
262 status = "disabled"; 262 status = "disabled";
263 }; 263 };
264 264
265 usb1: ehci@00800000 { 265 usb1: ehci@00800000 {
266 compatible = "atmel,at91sam9g45-ehci", "usb-ehci"; 266 compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
267 reg = <0x00800000 0x100000>; 267 reg = <0x00800000 0x100000>;
268 interrupts = <22 4>; 268 interrupts = <22 4 2>;
269 status = "disabled"; 269 status = "disabled";
270 }; 270 };
271 }; 271 };
diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi
index cb84de791b5a..bfac0dfc332c 100644
--- a/arch/arm/boot/dts/at91sam9n12.dtsi
+++ b/arch/arm/boot/dts/at91sam9n12.dtsi
@@ -50,7 +50,7 @@
50 ranges; 50 ranges;
51 51
52 aic: interrupt-controller@fffff000 { 52 aic: interrupt-controller@fffff000 {
53 #interrupt-cells = <2>; 53 #interrupt-cells = <3>;
54 compatible = "atmel,at91rm9200-aic"; 54 compatible = "atmel,at91rm9200-aic";
55 interrupt-controller; 55 interrupt-controller;
56 reg = <0xfffff000 0x200>; 56 reg = <0xfffff000 0x200>;
@@ -74,7 +74,7 @@
74 pit: timer@fffffe30 { 74 pit: timer@fffffe30 {
75 compatible = "atmel,at91sam9260-pit"; 75 compatible = "atmel,at91sam9260-pit";
76 reg = <0xfffffe30 0xf>; 76 reg = <0xfffffe30 0xf>;
77 interrupts = <1 4>; 77 interrupts = <1 4 7>;
78 }; 78 };
79 79
80 shdwc@fffffe10 { 80 shdwc@fffffe10 {
@@ -85,25 +85,25 @@
85 tcb0: timer@f8008000 { 85 tcb0: timer@f8008000 {
86 compatible = "atmel,at91sam9x5-tcb"; 86 compatible = "atmel,at91sam9x5-tcb";
87 reg = <0xf8008000 0x100>; 87 reg = <0xf8008000 0x100>;
88 interrupts = <17 4>; 88 interrupts = <17 4 0>;
89 }; 89 };
90 90
91 tcb1: timer@f800c000 { 91 tcb1: timer@f800c000 {
92 compatible = "atmel,at91sam9x5-tcb"; 92 compatible = "atmel,at91sam9x5-tcb";
93 reg = <0xf800c000 0x100>; 93 reg = <0xf800c000 0x100>;
94 interrupts = <17 4>; 94 interrupts = <17 4 0>;
95 }; 95 };
96 96
97 dma: dma-controller@ffffec00 { 97 dma: dma-controller@ffffec00 {
98 compatible = "atmel,at91sam9g45-dma"; 98 compatible = "atmel,at91sam9g45-dma";
99 reg = <0xffffec00 0x200>; 99 reg = <0xffffec00 0x200>;
100 interrupts = <20 4>; 100 interrupts = <20 4 0>;
101 }; 101 };
102 102
103 pioA: gpio@fffff400 { 103 pioA: gpio@fffff400 {
104 compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio"; 104 compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
105 reg = <0xfffff400 0x100>; 105 reg = <0xfffff400 0x100>;
106 interrupts = <2 4>; 106 interrupts = <2 4 1>;
107 #gpio-cells = <2>; 107 #gpio-cells = <2>;
108 gpio-controller; 108 gpio-controller;
109 interrupt-controller; 109 interrupt-controller;
@@ -112,7 +112,7 @@
112 pioB: gpio@fffff600 { 112 pioB: gpio@fffff600 {
113 compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio"; 113 compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
114 reg = <0xfffff600 0x100>; 114 reg = <0xfffff600 0x100>;
115 interrupts = <2 4>; 115 interrupts = <2 4 1>;
116 #gpio-cells = <2>; 116 #gpio-cells = <2>;
117 gpio-controller; 117 gpio-controller;
118 interrupt-controller; 118 interrupt-controller;
@@ -121,7 +121,7 @@
121 pioC: gpio@fffff800 { 121 pioC: gpio@fffff800 {
122 compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio"; 122 compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
123 reg = <0xfffff800 0x100>; 123 reg = <0xfffff800 0x100>;
124 interrupts = <3 4>; 124 interrupts = <3 4 1>;
125 #gpio-cells = <2>; 125 #gpio-cells = <2>;
126 gpio-controller; 126 gpio-controller;
127 interrupt-controller; 127 interrupt-controller;
@@ -130,7 +130,7 @@
130 pioD: gpio@fffffa00 { 130 pioD: gpio@fffffa00 {
131 compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio"; 131 compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
132 reg = <0xfffffa00 0x100>; 132 reg = <0xfffffa00 0x100>;
133 interrupts = <3 4>; 133 interrupts = <3 4 1>;
134 #gpio-cells = <2>; 134 #gpio-cells = <2>;
135 gpio-controller; 135 gpio-controller;
136 interrupt-controller; 136 interrupt-controller;
@@ -139,14 +139,14 @@
139 dbgu: serial@fffff200 { 139 dbgu: serial@fffff200 {
140 compatible = "atmel,at91sam9260-usart"; 140 compatible = "atmel,at91sam9260-usart";
141 reg = <0xfffff200 0x200>; 141 reg = <0xfffff200 0x200>;
142 interrupts = <1 4>; 142 interrupts = <1 4 7>;
143 status = "disabled"; 143 status = "disabled";
144 }; 144 };
145 145
146 usart0: serial@f801c000 { 146 usart0: serial@f801c000 {
147 compatible = "atmel,at91sam9260-usart"; 147 compatible = "atmel,at91sam9260-usart";
148 reg = <0xf801c000 0x4000>; 148 reg = <0xf801c000 0x4000>;
149 interrupts = <5 4>; 149 interrupts = <5 4 5>;
150 atmel,use-dma-rx; 150 atmel,use-dma-rx;
151 atmel,use-dma-tx; 151 atmel,use-dma-tx;
152 status = "disabled"; 152 status = "disabled";
@@ -155,7 +155,7 @@
155 usart1: serial@f8020000 { 155 usart1: serial@f8020000 {
156 compatible = "atmel,at91sam9260-usart"; 156 compatible = "atmel,at91sam9260-usart";
157 reg = <0xf8020000 0x4000>; 157 reg = <0xf8020000 0x4000>;
158 interrupts = <6 4>; 158 interrupts = <6 4 5>;
159 atmel,use-dma-rx; 159 atmel,use-dma-rx;
160 atmel,use-dma-tx; 160 atmel,use-dma-tx;
161 status = "disabled"; 161 status = "disabled";
@@ -164,7 +164,7 @@
164 usart2: serial@f8024000 { 164 usart2: serial@f8024000 {
165 compatible = "atmel,at91sam9260-usart"; 165 compatible = "atmel,at91sam9260-usart";
166 reg = <0xf8024000 0x4000>; 166 reg = <0xf8024000 0x4000>;
167 interrupts = <7 4>; 167 interrupts = <7 4 5>;
168 atmel,use-dma-rx; 168 atmel,use-dma-rx;
169 atmel,use-dma-tx; 169 atmel,use-dma-tx;
170 status = "disabled"; 170 status = "disabled";
@@ -173,7 +173,7 @@
173 usart3: serial@f8028000 { 173 usart3: serial@f8028000 {
174 compatible = "atmel,at91sam9260-usart"; 174 compatible = "atmel,at91sam9260-usart";
175 reg = <0xf8028000 0x4000>; 175 reg = <0xf8028000 0x4000>;
176 interrupts = <8 4>; 176 interrupts = <8 4 5>;
177 atmel,use-dma-rx; 177 atmel,use-dma-rx;
178 atmel,use-dma-tx; 178 atmel,use-dma-tx;
179 status = "disabled"; 179 status = "disabled";
@@ -201,7 +201,7 @@
201 usb0: ohci@00500000 { 201 usb0: ohci@00500000 {
202 compatible = "atmel,at91rm9200-ohci", "usb-ohci"; 202 compatible = "atmel,at91rm9200-ohci", "usb-ohci";
203 reg = <0x00500000 0x00100000>; 203 reg = <0x00500000 0x00100000>;
204 interrupts = <22 4>; 204 interrupts = <22 4 2>;
205 status = "disabled"; 205 status = "disabled";
206 }; 206 };
207 }; 207 };
diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi
index 6a0a0fbb6283..4a18c393b136 100644
--- a/arch/arm/boot/dts/at91sam9x5.dtsi
+++ b/arch/arm/boot/dts/at91sam9x5.dtsi
@@ -51,7 +51,7 @@
51 ranges; 51 ranges;
52 52
53 aic: interrupt-controller@fffff000 { 53 aic: interrupt-controller@fffff000 {
54 #interrupt-cells = <2>; 54 #interrupt-cells = <3>;
55 compatible = "atmel,at91rm9200-aic"; 55 compatible = "atmel,at91rm9200-aic";
56 interrupt-controller; 56 interrupt-controller;
57 reg = <0xfffff000 0x200>; 57 reg = <0xfffff000 0x200>;
@@ -81,37 +81,37 @@
81 pit: timer@fffffe30 { 81 pit: timer@fffffe30 {
82 compatible = "atmel,at91sam9260-pit"; 82 compatible = "atmel,at91sam9260-pit";
83 reg = <0xfffffe30 0xf>; 83 reg = <0xfffffe30 0xf>;
84 interrupts = <1 4>; 84 interrupts = <1 4 7>;
85 }; 85 };
86 86
87 tcb0: timer@f8008000 { 87 tcb0: timer@f8008000 {
88 compatible = "atmel,at91sam9x5-tcb"; 88 compatible = "atmel,at91sam9x5-tcb";
89 reg = <0xf8008000 0x100>; 89 reg = <0xf8008000 0x100>;
90 interrupts = <17 4>; 90 interrupts = <17 4 0>;
91 }; 91 };
92 92
93 tcb1: timer@f800c000 { 93 tcb1: timer@f800c000 {
94 compatible = "atmel,at91sam9x5-tcb"; 94 compatible = "atmel,at91sam9x5-tcb";
95 reg = <0xf800c000 0x100>; 95 reg = <0xf800c000 0x100>;
96 interrupts = <17 4>; 96 interrupts = <17 4 0>;
97 }; 97 };
98 98
99 dma0: dma-controller@ffffec00 { 99 dma0: dma-controller@ffffec00 {
100 compatible = "atmel,at91sam9g45-dma"; 100 compatible = "atmel,at91sam9g45-dma";
101 reg = <0xffffec00 0x200>; 101 reg = <0xffffec00 0x200>;
102 interrupts = <20 4>; 102 interrupts = <20 4 0>;
103 }; 103 };
104 104
105 dma1: dma-controller@ffffee00 { 105 dma1: dma-controller@ffffee00 {
106 compatible = "atmel,at91sam9g45-dma"; 106 compatible = "atmel,at91sam9g45-dma";
107 reg = <0xffffee00 0x200>; 107 reg = <0xffffee00 0x200>;
108 interrupts = <21 4>; 108 interrupts = <21 4 0>;
109 }; 109 };
110 110
111 pioA: gpio@fffff400 { 111 pioA: gpio@fffff400 {
112 compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio"; 112 compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
113 reg = <0xfffff400 0x100>; 113 reg = <0xfffff400 0x100>;
114 interrupts = <2 4>; 114 interrupts = <2 4 1>;
115 #gpio-cells = <2>; 115 #gpio-cells = <2>;
116 gpio-controller; 116 gpio-controller;
117 interrupt-controller; 117 interrupt-controller;
@@ -120,7 +120,7 @@
120 pioB: gpio@fffff600 { 120 pioB: gpio@fffff600 {
121 compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio"; 121 compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
122 reg = <0xfffff600 0x100>; 122 reg = <0xfffff600 0x100>;
123 interrupts = <2 4>; 123 interrupts = <2 4 1>;
124 #gpio-cells = <2>; 124 #gpio-cells = <2>;
125 gpio-controller; 125 gpio-controller;
126 interrupt-controller; 126 interrupt-controller;
@@ -129,7 +129,7 @@
129 pioC: gpio@fffff800 { 129 pioC: gpio@fffff800 {
130 compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio"; 130 compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
131 reg = <0xfffff800 0x100>; 131 reg = <0xfffff800 0x100>;
132 interrupts = <3 4>; 132 interrupts = <3 4 1>;
133 #gpio-cells = <2>; 133 #gpio-cells = <2>;
134 gpio-controller; 134 gpio-controller;
135 interrupt-controller; 135 interrupt-controller;
@@ -138,7 +138,7 @@
138 pioD: gpio@fffffa00 { 138 pioD: gpio@fffffa00 {
139 compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio"; 139 compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
140 reg = <0xfffffa00 0x100>; 140 reg = <0xfffffa00 0x100>;
141 interrupts = <3 4>; 141 interrupts = <3 4 1>;
142 #gpio-cells = <2>; 142 #gpio-cells = <2>;
143 gpio-controller; 143 gpio-controller;
144 interrupt-controller; 144 interrupt-controller;
@@ -147,14 +147,14 @@
147 dbgu: serial@fffff200 { 147 dbgu: serial@fffff200 {
148 compatible = "atmel,at91sam9260-usart"; 148 compatible = "atmel,at91sam9260-usart";
149 reg = <0xfffff200 0x200>; 149 reg = <0xfffff200 0x200>;
150 interrupts = <1 4>; 150 interrupts = <1 4 7>;
151 status = "disabled"; 151 status = "disabled";
152 }; 152 };
153 153
154 usart0: serial@f801c000 { 154 usart0: serial@f801c000 {
155 compatible = "atmel,at91sam9260-usart"; 155 compatible = "atmel,at91sam9260-usart";
156 reg = <0xf801c000 0x200>; 156 reg = <0xf801c000 0x200>;
157 interrupts = <5 4>; 157 interrupts = <5 4 5>;
158 atmel,use-dma-rx; 158 atmel,use-dma-rx;
159 atmel,use-dma-tx; 159 atmel,use-dma-tx;
160 status = "disabled"; 160 status = "disabled";
@@ -163,7 +163,7 @@
163 usart1: serial@f8020000 { 163 usart1: serial@f8020000 {
164 compatible = "atmel,at91sam9260-usart"; 164 compatible = "atmel,at91sam9260-usart";
165 reg = <0xf8020000 0x200>; 165 reg = <0xf8020000 0x200>;
166 interrupts = <6 4>; 166 interrupts = <6 4 5>;
167 atmel,use-dma-rx; 167 atmel,use-dma-rx;
168 atmel,use-dma-tx; 168 atmel,use-dma-tx;
169 status = "disabled"; 169 status = "disabled";
@@ -172,7 +172,7 @@
172 usart2: serial@f8024000 { 172 usart2: serial@f8024000 {
173 compatible = "atmel,at91sam9260-usart"; 173 compatible = "atmel,at91sam9260-usart";
174 reg = <0xf8024000 0x200>; 174 reg = <0xf8024000 0x200>;
175 interrupts = <7 4>; 175 interrupts = <7 4 5>;
176 atmel,use-dma-rx; 176 atmel,use-dma-rx;
177 atmel,use-dma-tx; 177 atmel,use-dma-tx;
178 status = "disabled"; 178 status = "disabled";
@@ -181,21 +181,21 @@
181 macb0: ethernet@f802c000 { 181 macb0: ethernet@f802c000 {
182 compatible = "cdns,at32ap7000-macb", "cdns,macb"; 182 compatible = "cdns,at32ap7000-macb", "cdns,macb";
183 reg = <0xf802c000 0x100>; 183 reg = <0xf802c000 0x100>;
184 interrupts = <24 4>; 184 interrupts = <24 4 3>;
185 status = "disabled"; 185 status = "disabled";
186 }; 186 };
187 187
188 macb1: ethernet@f8030000 { 188 macb1: ethernet@f8030000 {
189 compatible = "cdns,at32ap7000-macb", "cdns,macb"; 189 compatible = "cdns,at32ap7000-macb", "cdns,macb";
190 reg = <0xf8030000 0x100>; 190 reg = <0xf8030000 0x100>;
191 interrupts = <27 4>; 191 interrupts = <27 4 3>;
192 status = "disabled"; 192 status = "disabled";
193 }; 193 };
194 194
195 adc0: adc@f804c000 { 195 adc0: adc@f804c000 {
196 compatible = "atmel,at91sam9260-adc"; 196 compatible = "atmel,at91sam9260-adc";
197 reg = <0xf804c000 0x100>; 197 reg = <0xf804c000 0x100>;
198 interrupts = <19 4>; 198 interrupts = <19 4 0>;
199 atmel,adc-use-external; 199 atmel,adc-use-external;
200 atmel,adc-channels-used = <0xffff>; 200 atmel,adc-channels-used = <0xffff>;
201 atmel,adc-vref = <3300>; 201 atmel,adc-vref = <3300>;
@@ -249,14 +249,14 @@
249 usb0: ohci@00600000 { 249 usb0: ohci@00600000 {
250 compatible = "atmel,at91rm9200-ohci", "usb-ohci"; 250 compatible = "atmel,at91rm9200-ohci", "usb-ohci";
251 reg = <0x00600000 0x100000>; 251 reg = <0x00600000 0x100000>;
252 interrupts = <22 4>; 252 interrupts = <22 4 2>;
253 status = "disabled"; 253 status = "disabled";
254 }; 254 };
255 255
256 usb1: ehci@00700000 { 256 usb1: ehci@00700000 {
257 compatible = "atmel,at91sam9g45-ehci", "usb-ehci"; 257 compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
258 reg = <0x00700000 0x100000>; 258 reg = <0x00700000 0x100000>;
259 interrupts = <22 4>; 259 interrupts = <22 4 2>;
260 status = "disabled"; 260 status = "disabled";
261 }; 261 };
262 }; 262 };
diff --git a/arch/arm/mach-at91/include/mach/at91_aic.h b/arch/arm/mach-at91/include/mach/at91_aic.h
index c1413ed1172d..3af7272a4060 100644
--- a/arch/arm/mach-at91/include/mach/at91_aic.h
+++ b/arch/arm/mach-at91/include/mach/at91_aic.h
@@ -28,6 +28,9 @@ extern void __iomem *at91_aic_base;
28.extern at91_aic_base 28.extern at91_aic_base
29#endif 29#endif
30 30
31#define AT91_AIC_IRQ_MIN_PRIORITY 0
32#define AT91_AIC_IRQ_MAX_PRIORITY 7
33
31#define AT91_AIC_SMR(n) ((n) * 4) /* Source Mode Registers 0-31 */ 34#define AT91_AIC_SMR(n) ((n) * 4) /* Source Mode Registers 0-31 */
32#define AT91_AIC_PRIOR (7 << 0) /* Priority Level */ 35#define AT91_AIC_PRIOR (7 << 0) /* Priority Level */
33#define AT91_AIC_SRCTYPE (3 << 5) /* Interrupt Source Type */ 36#define AT91_AIC_SRCTYPE (3 << 5) /* Interrupt Source Type */
diff --git a/arch/arm/mach-at91/irq.c b/arch/arm/mach-at91/irq.c
index df8605fd7bad..db8e14112eda 100644
--- a/arch/arm/mach-at91/irq.c
+++ b/arch/arm/mach-at91/irq.c
@@ -30,6 +30,7 @@
30#include <linux/of_irq.h> 30#include <linux/of_irq.h>
31#include <linux/irqdomain.h> 31#include <linux/irqdomain.h>
32#include <linux/err.h> 32#include <linux/err.h>
33#include <linux/slab.h>
33 34
34#include <mach/hardware.h> 35#include <mach/hardware.h>
35#include <asm/irq.h> 36#include <asm/irq.h>
@@ -42,6 +43,7 @@
42void __iomem *at91_aic_base; 43void __iomem *at91_aic_base;
43static struct irq_domain *at91_aic_domain; 44static struct irq_domain *at91_aic_domain;
44static struct device_node *at91_aic_np; 45static struct device_node *at91_aic_np;
46static unsigned int *at91_aic_irq_priorities;
45 47
46static void at91_aic_mask_irq(struct irq_data *d) 48static void at91_aic_mask_irq(struct irq_data *d)
47{ 49{
@@ -177,8 +179,9 @@ static int at91_aic_irq_map(struct irq_domain *h, unsigned int virq,
177 /* Put virq number in Source Vector Register */ 179 /* Put virq number in Source Vector Register */
178 at91_aic_write(AT91_AIC_SVR(hw), virq); 180 at91_aic_write(AT91_AIC_SVR(hw), virq);
179 181
180 /* Active Low interrupt, without priority */ 182 /* Active Low interrupt, with priority */
181 at91_aic_write(AT91_AIC_SMR(hw), AT91_AIC_SRCTYPE_LOW); 183 at91_aic_write(AT91_AIC_SMR(hw),
184 AT91_AIC_SRCTYPE_LOW | at91_aic_irq_priorities[hw]);
182 185
183 irq_set_chip_and_handler(virq, &at91_aic_chip, handle_fasteoi_irq); 186 irq_set_chip_and_handler(virq, &at91_aic_chip, handle_fasteoi_irq);
184 set_irq_flags(virq, IRQF_VALID | IRQF_PROBE); 187 set_irq_flags(virq, IRQF_VALID | IRQF_PROBE);
@@ -186,9 +189,28 @@ static int at91_aic_irq_map(struct irq_domain *h, unsigned int virq,
186 return 0; 189 return 0;
187} 190}
188 191
192static int at91_aic_irq_domain_xlate(struct irq_domain *d, struct device_node *ctrlr,
193 const u32 *intspec, unsigned int intsize,
194 irq_hw_number_t *out_hwirq, unsigned int *out_type)
195{
196 if (WARN_ON(intsize < 3))
197 return -EINVAL;
198 if (WARN_ON(intspec[0] >= NR_AIC_IRQS))
199 return -EINVAL;
200 if (WARN_ON((intspec[2] < AT91_AIC_IRQ_MIN_PRIORITY)
201 || (intspec[2] > AT91_AIC_IRQ_MAX_PRIORITY)))
202 return -EINVAL;
203
204 *out_hwirq = intspec[0];
205 *out_type = intspec[1] & IRQ_TYPE_SENSE_MASK;
206 at91_aic_irq_priorities[*out_hwirq] = intspec[2];
207
208 return 0;
209}
210
189static struct irq_domain_ops at91_aic_irq_ops = { 211static struct irq_domain_ops at91_aic_irq_ops = {
190 .map = at91_aic_irq_map, 212 .map = at91_aic_irq_map,
191 .xlate = irq_domain_xlate_twocell, 213 .xlate = at91_aic_irq_domain_xlate,
192}; 214};
193 215
194int __init at91_aic_of_init(struct device_node *node, 216int __init at91_aic_of_init(struct device_node *node,
@@ -198,6 +220,12 @@ int __init at91_aic_of_init(struct device_node *node,
198 const __be32 *p; 220 const __be32 *p;
199 u32 val; 221 u32 val;
200 222
223 at91_aic_irq_priorities = kzalloc(NR_AIC_IRQS
224 * sizeof(*at91_aic_irq_priorities),
225 GFP_KERNEL);
226 if (!at91_aic_irq_priorities)
227 return -ENOMEM;
228
201 at91_aic_base = of_iomap(node, 0); 229 at91_aic_base = of_iomap(node, 0);
202 at91_aic_np = node; 230 at91_aic_np = node;
203 231