aboutsummaryrefslogtreecommitdiffstats
path: root/patches.at91/0054-ARM-at91-add-of-irq-priorities-support.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches.at91/0054-ARM-at91-add-of-irq-priorities-support.patch')
-rw-r--r--patches.at91/0054-ARM-at91-add-of-irq-priorities-support.patch885
1 files changed, 885 insertions, 0 deletions
diff --git a/patches.at91/0054-ARM-at91-add-of-irq-priorities-support.patch b/patches.at91/0054-ARM-at91-add-of-irq-priorities-support.patch
new file mode 100644
index 00000000000000..b8df4e105d34d2
--- /dev/null
+++ b/patches.at91/0054-ARM-at91-add-of-irq-priorities-support.patch
@@ -0,0 +1,885 @@
+From 70df58d418b354d8e1ad6597463da2b3d32148c3 Mon Sep 17 00:00:00 2001
+From: Ludovic Desroches <ludovic.desroches@atmel.com>
+Date: Wed, 20 Jun 2012 16:13:30 +0200
+Subject: ARM: at91: add of irq priorities support
+
+commit f8a073ee378b9893aee0749c3868a6ecfb0c1636 upstream.
+
+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>
+
+Conflicts:
+ arch/arm/boot/dts/at91sam9260.dtsi
+ arch/arm/boot/dts/at91sam9g45.dtsi
+ arch/arm/boot/dts/at91sam9x5.dtsi
+---
+ .../devicetree/bindings/arm/atmel-aic.txt | 8 +++--
+ arch/arm/boot/dts/at91sam9260.dtsi | 34 ++++++++++----------
+ arch/arm/boot/dts/at91sam9263.dtsi | 30 +++++++++---------
+ arch/arm/boot/dts/at91sam9g45.dtsi | 36 +++++++++++-----------
+ arch/arm/boot/dts/at91sam9n12.dtsi | 30 +++++++++---------
+ arch/arm/boot/dts/at91sam9x5.dtsi | 36 +++++++++++-----------
+ arch/arm/mach-at91/include/mach/at91_aic.h | 3 ++
+ arch/arm/mach-at91/irq.c | 34 ++++++++++++++++++--
+ 8 files changed, 122 insertions(+), 89 deletions(-)
+
+diff --git a/Documentation/devicetree/bindings/arm/atmel-aic.txt b/Documentation/devicetree/bindings/arm/atmel-aic.txt
+index 1953b0c..19078bf 100644
+--- a/Documentation/devicetree/bindings/arm/atmel-aic.txt
++++ b/Documentation/devicetree/bindings/arm/atmel-aic.txt
+@@ -4,7 +4,7 @@ Required properties:
+ - compatible: Should be "atmel,<chip>-aic"
+ - interrupt-controller: Identifies the node as an interrupt controller.
+ - interrupt-parent: For single AIC system, it is an empty property.
+-- #interrupt-cells: The number of cells to define the interrupts. It sould be 2.
++- #interrupt-cells: The number of cells to define the interrupts. It sould be 3.
+ The first cell is the IRQ number (aka "Peripheral IDentifier" on datasheet).
+ The second cell is used to specify flags:
+ bits[3:0] trigger type and level flags:
+@@ -14,6 +14,8 @@ Required properties:
+ 8 = active low level-sensitive.
+ Valid combinations are 1, 2, 3, 4, 8.
+ Default flag for internal sources should be set to 4 (active high).
++ The third cell is used to specify the irq priority from 0 (lowest) to 7
++ (highest).
+ - reg: Should contain AIC registers location and length
+ - atmel,external-irqs: u32 array of external irqs.
+
+@@ -25,7 +27,7 @@ Examples:
+ compatible = "atmel,at91rm9200-aic";
+ interrupt-controller;
+ interrupt-parent;
+- #interrupt-cells = <2>;
++ #interrupt-cells = <3>;
+ reg = <0xfffff000 0x200>;
+ };
+
+@@ -35,5 +37,5 @@ Examples:
+ dma: dma-controller@ffffec00 {
+ compatible = "atmel,at91sam9g45-dma";
+ reg = <0xffffec00 0x200>;
+- interrupts = <21 4>;
++ interrupts = <21 4 5>;
+ };
+diff --git a/arch/arm/boot/dts/at91sam9260.dtsi b/arch/arm/boot/dts/at91sam9260.dtsi
+index fb86de0..12df8ca 100644
+--- a/arch/arm/boot/dts/at91sam9260.dtsi
++++ b/arch/arm/boot/dts/at91sam9260.dtsi
+@@ -52,7 +52,7 @@
+ ranges;
+
+ aic: interrupt-controller@fffff000 {
+- #interrupt-cells = <2>;
++ #interrupt-cells = <3>;
+ compatible = "atmel,at91rm9200-aic";
+ interrupt-controller;
+ reg = <0xfffff000 0x200>;
+@@ -82,25 +82,25 @@
+ pit: timer@fffffd30 {
+ compatible = "atmel,at91sam9260-pit";
+ reg = <0xfffffd30 0xf>;
+- interrupts = <1 4>;
++ interrupts = <1 4 7>;
+ };
+
+ tcb0: timer@fffa0000 {
+ compatible = "atmel,at91rm9200-tcb";
+ reg = <0xfffa0000 0x100>;
+- interrupts = <17 4 18 4 19 4>;
++ interrupts = <17 4 0 18 4 0 19 4 0>;
+ };
+
+ tcb1: timer@fffdc000 {
+ compatible = "atmel,at91rm9200-tcb";
+ reg = <0xfffdc000 0x100>;
+- interrupts = <26 4 27 4 28 4>;
++ interrupts = <26 4 0 27 4 0 28 4 0>;
+ };
+
+ pioA: gpio@fffff400 {
+ compatible = "atmel,at91rm9200-gpio";
+ reg = <0xfffff400 0x100>;
+- interrupts = <2 4>;
++ interrupts = <2 4 1>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ interrupt-controller;
+@@ -110,7 +110,7 @@
+ pioB: gpio@fffff600 {
+ compatible = "atmel,at91rm9200-gpio";
+ reg = <0xfffff600 0x100>;
+- interrupts = <3 4>;
++ interrupts = <3 4 1>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ interrupt-controller;
+@@ -120,7 +120,7 @@
+ pioC: gpio@fffff800 {
+ compatible = "atmel,at91rm9200-gpio";
+ reg = <0xfffff800 0x100>;
+- interrupts = <4 4>;
++ interrupts = <4 4 1>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ interrupt-controller;
+@@ -130,14 +130,14 @@
+ dbgu: serial@fffff200 {
+ compatible = "atmel,at91sam9260-usart";
+ reg = <0xfffff200 0x200>;
+- interrupts = <1 4>;
++ interrupts = <1 4 7>;
+ status = "disabled";
+ };
+
+ usart0: serial@fffb0000 {
+ compatible = "atmel,at91sam9260-usart";
+ reg = <0xfffb0000 0x200>;
+- interrupts = <6 4>;
++ interrupts = <6 4 5>;
+ atmel,use-dma-rx;
+ atmel,use-dma-tx;
+ status = "disabled";
+@@ -146,7 +146,7 @@
+ usart1: serial@fffb4000 {
+ compatible = "atmel,at91sam9260-usart";
+ reg = <0xfffb4000 0x200>;
+- interrupts = <7 4>;
++ interrupts = <7 4 5>;
+ atmel,use-dma-rx;
+ atmel,use-dma-tx;
+ status = "disabled";
+@@ -155,7 +155,7 @@
+ usart2: serial@fffb8000 {
+ compatible = "atmel,at91sam9260-usart";
+ reg = <0xfffb8000 0x200>;
+- interrupts = <8 4>;
++ interrupts = <8 4 5>;
+ atmel,use-dma-rx;
+ atmel,use-dma-tx;
+ status = "disabled";
+@@ -164,7 +164,7 @@
+ usart3: serial@fffd0000 {
+ compatible = "atmel,at91sam9260-usart";
+ reg = <0xfffd0000 0x200>;
+- interrupts = <23 4>;
++ interrupts = <23 4 5>;
+ atmel,use-dma-rx;
+ atmel,use-dma-tx;
+ status = "disabled";
+@@ -173,7 +173,7 @@
+ usart4: serial@fffd4000 {
+ compatible = "atmel,at91sam9260-usart";
+ reg = <0xfffd4000 0x200>;
+- interrupts = <24 4>;
++ interrupts = <24 4 5>;
+ atmel,use-dma-rx;
+ atmel,use-dma-tx;
+ status = "disabled";
+@@ -182,7 +182,7 @@
+ usart5: serial@fffd8000 {
+ compatible = "atmel,at91sam9260-usart";
+ reg = <0xfffd8000 0x200>;
+- interrupts = <25 4>;
++ interrupts = <25 4 5>;
+ atmel,use-dma-rx;
+ atmel,use-dma-tx;
+ status = "disabled";
+@@ -191,14 +191,14 @@
+ macb0: ethernet@fffc4000 {
+ compatible = "cdns,at32ap7000-macb", "cdns,macb";
+ reg = <0xfffc4000 0x100>;
+- interrupts = <21 4>;
++ interrupts = <21 4 3>;
+ status = "disabled";
+ };
+
+ usb1: gadget@fffa4000 {
+ compatible = "atmel,at91rm9200-udc";
+ reg = <0xfffa4000 0x4000>;
+- interrupts = <10 4>;
++ interrupts = <10 4 2>;
+ status = "disabled";
+ };
+ };
+@@ -222,7 +222,7 @@
+ usb0: ohci@00500000 {
+ compatible = "atmel,at91rm9200-ohci", "usb-ohci";
+ reg = <0x00500000 0x100000>;
+- interrupts = <20 4>;
++ interrupts = <20 4 2>;
+ status = "disabled";
+ };
+ };
+diff --git a/arch/arm/boot/dts/at91sam9263.dtsi b/arch/arm/boot/dts/at91sam9263.dtsi
+index 78b2808..195019b 100644
+--- a/arch/arm/boot/dts/at91sam9263.dtsi
++++ b/arch/arm/boot/dts/at91sam9263.dtsi
+@@ -48,7 +48,7 @@
+ ranges;
+
+ aic: interrupt-controller@fffff000 {
+- #interrupt-cells = <2>;
++ #interrupt-cells = <3>;
+ compatible = "atmel,at91rm9200-aic";
+ interrupt-controller;
+ reg = <0xfffff000 0x200>;
+@@ -69,13 +69,13 @@
+ pit: timer@fffffd30 {
+ compatible = "atmel,at91sam9260-pit";
+ reg = <0xfffffd30 0xf>;
+- interrupts = <1 4>;
++ interrupts = <1 4 7>;
+ };
+
+ tcb0: timer@fff7c000 {
+ compatible = "atmel,at91rm9200-tcb";
+ reg = <0xfff7c000 0x100>;
+- interrupts = <19 4>;
++ interrupts = <19 4 0>;
+ };
+
+ rstc@fffffd00 {
+@@ -91,7 +91,7 @@
+ pioA: gpio@fffff200 {
+ compatible = "atmel,at91rm9200-gpio";
+ reg = <0xfffff200 0x100>;
+- interrupts = <2 4>;
++ interrupts = <2 4 1>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ interrupt-controller;
+@@ -101,7 +101,7 @@
+ pioB: gpio@fffff400 {
+ compatible = "atmel,at91rm9200-gpio";
+ reg = <0xfffff400 0x100>;
+- interrupts = <3 4>;
++ interrupts = <3 4 1>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ interrupt-controller;
+@@ -111,7 +111,7 @@
+ pioC: gpio@fffff600 {
+ compatible = "atmel,at91rm9200-gpio";
+ reg = <0xfffff600 0x100>;
+- interrupts = <4 4>;
++ interrupts = <4 4 1>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ interrupt-controller;
+@@ -121,7 +121,7 @@
+ pioD: gpio@fffff800 {
+ compatible = "atmel,at91rm9200-gpio";
+ reg = <0xfffff800 0x100>;
+- interrupts = <4 4>;
++ interrupts = <4 4 1>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ interrupt-controller;
+@@ -131,7 +131,7 @@
+ pioE: gpio@fffffa00 {
+ compatible = "atmel,at91rm9200-gpio";
+ reg = <0xfffffa00 0x100>;
+- interrupts = <4 4>;
++ interrupts = <4 4 1>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ interrupt-controller;
+@@ -141,14 +141,14 @@
+ dbgu: serial@ffffee00 {
+ compatible = "atmel,at91sam9260-usart";
+ reg = <0xffffee00 0x200>;
+- interrupts = <1 4>;
++ interrupts = <1 4 7>;
+ status = "disabled";
+ };
+
+ usart0: serial@fff8c000 {
+ compatible = "atmel,at91sam9260-usart";
+ reg = <0xfff8c000 0x200>;
+- interrupts = <7 4>;
++ interrupts = <7 4 5>;
+ atmel,use-dma-rx;
+ atmel,use-dma-tx;
+ status = "disabled";
+@@ -157,7 +157,7 @@
+ usart1: serial@fff90000 {
+ compatible = "atmel,at91sam9260-usart";
+ reg = <0xfff90000 0x200>;
+- interrupts = <8 4>;
++ interrupts = <8 4 5>;
+ atmel,use-dma-rx;
+ atmel,use-dma-tx;
+ status = "disabled";
+@@ -166,7 +166,7 @@
+ usart2: serial@fff94000 {
+ compatible = "atmel,at91sam9260-usart";
+ reg = <0xfff94000 0x200>;
+- interrupts = <9 4>;
++ interrupts = <9 4 5>;
+ atmel,use-dma-rx;
+ atmel,use-dma-tx;
+ status = "disabled";
+@@ -175,14 +175,14 @@
+ macb0: ethernet@fffbc000 {
+ compatible = "cdns,at32ap7000-macb", "cdns,macb";
+ reg = <0xfffbc000 0x100>;
+- interrupts = <21 4>;
++ interrupts = <21 4 3>;
+ status = "disabled";
+ };
+
+ usb1: gadget@fff78000 {
+ compatible = "atmel,at91rm9200-udc";
+ reg = <0xfff78000 0x4000>;
+- interrupts = <24 4>;
++ interrupts = <24 4 2>;
+ status = "disabled";
+ };
+ };
+@@ -206,7 +206,7 @@
+ usb0: ohci@00a00000 {
+ compatible = "atmel,at91rm9200-ohci", "usb-ohci";
+ reg = <0x00a00000 0x100000>;
+- interrupts = <29 4>;
++ interrupts = <29 4 2>;
+ status = "disabled";
+ };
+ };
+diff --git a/arch/arm/boot/dts/at91sam9g45.dtsi b/arch/arm/boot/dts/at91sam9g45.dtsi
+index 779ffca..6a3ed54 100644
+--- a/arch/arm/boot/dts/at91sam9g45.dtsi
++++ b/arch/arm/boot/dts/at91sam9g45.dtsi
+@@ -53,7 +53,7 @@
+ ranges;
+
+ aic: interrupt-controller@fffff000 {
+- #interrupt-cells = <2>;
++ #interrupt-cells = <3>;
+ compatible = "atmel,at91rm9200-aic";
+ interrupt-controller;
+ reg = <0xfffff000 0x200>;
+@@ -79,7 +79,7 @@
+ pit: timer@fffffd30 {
+ compatible = "atmel,at91sam9260-pit";
+ reg = <0xfffffd30 0xf>;
+- interrupts = <1 4>;
++ interrupts = <1 4 7>;
+ };
+
+
+@@ -91,25 +91,25 @@
+ tcb0: timer@fff7c000 {
+ compatible = "atmel,at91rm9200-tcb";
+ reg = <0xfff7c000 0x100>;
+- interrupts = <18 4>;
++ interrupts = <18 4 0>;
+ };
+
+ tcb1: timer@fffd4000 {
+ compatible = "atmel,at91rm9200-tcb";
+ reg = <0xfffd4000 0x100>;
+- interrupts = <18 4>;
++ interrupts = <18 4 0>;
+ };
+
+ dma: dma-controller@ffffec00 {
+ compatible = "atmel,at91sam9g45-dma";
+ reg = <0xffffec00 0x200>;
+- interrupts = <21 4>;
++ interrupts = <21 4 0>;
+ };
+
+ pioA: gpio@fffff200 {
+ compatible = "atmel,at91rm9200-gpio";
+ reg = <0xfffff200 0x100>;
+- interrupts = <2 4>;
++ interrupts = <2 4 1>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ interrupt-controller;
+@@ -119,7 +119,7 @@
+ pioB: gpio@fffff400 {
+ compatible = "atmel,at91rm9200-gpio";
+ reg = <0xfffff400 0x100>;
+- interrupts = <3 4>;
++ interrupts = <3 4 1>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ interrupt-controller;
+@@ -129,7 +129,7 @@
+ pioC: gpio@fffff600 {
+ compatible = "atmel,at91rm9200-gpio";
+ reg = <0xfffff600 0x100>;
+- interrupts = <4 4>;
++ interrupts = <4 4 1>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ interrupt-controller;
+@@ -139,7 +139,7 @@
+ pioD: gpio@fffff800 {
+ compatible = "atmel,at91rm9200-gpio";
+ reg = <0xfffff800 0x100>;
+- interrupts = <5 4>;
++ interrupts = <5 4 1>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ interrupt-controller;
+@@ -149,7 +149,7 @@
+ pioE: gpio@fffffa00 {
+ compatible = "atmel,at91rm9200-gpio";
+ reg = <0xfffffa00 0x100>;
+- interrupts = <5 4>;
++ interrupts = <5 4 1>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ interrupt-controller;
+@@ -159,14 +159,14 @@
+ dbgu: serial@ffffee00 {
+ compatible = "atmel,at91sam9260-usart";
+ reg = <0xffffee00 0x200>;
+- interrupts = <1 4>;
++ interrupts = <1 4 7>;
+ status = "disabled";
+ };
+
+ usart0: serial@fff8c000 {
+ compatible = "atmel,at91sam9260-usart";
+ reg = <0xfff8c000 0x200>;
+- interrupts = <7 4>;
++ interrupts = <7 4 5>;
+ atmel,use-dma-rx;
+ atmel,use-dma-tx;
+ status = "disabled";
+@@ -175,7 +175,7 @@
+ usart1: serial@fff90000 {
+ compatible = "atmel,at91sam9260-usart";
+ reg = <0xfff90000 0x200>;
+- interrupts = <8 4>;
++ interrupts = <8 4 5>;
+ atmel,use-dma-rx;
+ atmel,use-dma-tx;
+ status = "disabled";
+@@ -184,7 +184,7 @@
+ usart2: serial@fff94000 {
+ compatible = "atmel,at91sam9260-usart";
+ reg = <0xfff94000 0x200>;
+- interrupts = <9 4>;
++ interrupts = <9 4 5>;
+ atmel,use-dma-rx;
+ atmel,use-dma-tx;
+ status = "disabled";
+@@ -193,7 +193,7 @@
+ usart3: serial@fff98000 {
+ compatible = "atmel,at91sam9260-usart";
+ reg = <0xfff98000 0x200>;
+- interrupts = <10 4>;
++ interrupts = <10 4 5>;
+ atmel,use-dma-rx;
+ atmel,use-dma-tx;
+ status = "disabled";
+@@ -202,7 +202,7 @@
+ macb0: ethernet@fffbc000 {
+ compatible = "cdns,at32ap7000-macb", "cdns,macb";
+ reg = <0xfffbc000 0x100>;
+- interrupts = <25 4>;
++ interrupts = <25 4 3>;
+ status = "disabled";
+ };
+ };
+@@ -226,14 +226,14 @@
+ usb0: ohci@00700000 {
+ compatible = "atmel,at91rm9200-ohci", "usb-ohci";
+ reg = <0x00700000 0x100000>;
+- interrupts = <22 4>;
++ interrupts = <22 4 2>;
+ status = "disabled";
+ };
+
+ usb1: ehci@00800000 {
+ compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
+ reg = <0x00800000 0x100000>;
+- interrupts = <22 4>;
++ interrupts = <22 4 2>;
+ status = "disabled";
+ };
+ };
+diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi
+index a69e89a..ef9336a 100644
+--- a/arch/arm/boot/dts/at91sam9n12.dtsi
++++ b/arch/arm/boot/dts/at91sam9n12.dtsi
+@@ -50,7 +50,7 @@
+ ranges;
+
+ aic: interrupt-controller@fffff000 {
+- #interrupt-cells = <2>;
++ #interrupt-cells = <3>;
+ compatible = "atmel,at91rm9200-aic";
+ interrupt-controller;
+ reg = <0xfffff000 0x200>;
+@@ -74,7 +74,7 @@
+ pit: timer@fffffe30 {
+ compatible = "atmel,at91sam9260-pit";
+ reg = <0xfffffe30 0xf>;
+- interrupts = <1 4>;
++ interrupts = <1 4 7>;
+ };
+
+ shdwc@fffffe10 {
+@@ -85,25 +85,25 @@
+ tcb0: timer@f8008000 {
+ compatible = "atmel,at91sam9x5-tcb";
+ reg = <0xf8008000 0x100>;
+- interrupts = <17 4>;
++ interrupts = <17 4 0>;
+ };
+
+ tcb1: timer@f800c000 {
+ compatible = "atmel,at91sam9x5-tcb";
+ reg = <0xf800c000 0x100>;
+- interrupts = <17 4>;
++ interrupts = <17 4 0>;
+ };
+
+ dma: dma-controller@ffffec00 {
+ compatible = "atmel,at91sam9g45-dma";
+ reg = <0xffffec00 0x200>;
+- interrupts = <20 4>;
++ interrupts = <20 4 0>;
+ };
+
+ pioA: gpio@fffff400 {
+ compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
+ reg = <0xfffff400 0x100>;
+- interrupts = <2 4>;
++ interrupts = <2 4 1>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ interrupt-controller;
+@@ -113,7 +113,7 @@
+ pioB: gpio@fffff600 {
+ compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
+ reg = <0xfffff600 0x100>;
+- interrupts = <2 4>;
++ interrupts = <2 4 1>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ interrupt-controller;
+@@ -123,7 +123,7 @@
+ pioC: gpio@fffff800 {
+ compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
+ reg = <0xfffff800 0x100>;
+- interrupts = <3 4>;
++ interrupts = <3 4 1>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ interrupt-controller;
+@@ -133,7 +133,7 @@
+ pioD: gpio@fffffa00 {
+ compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
+ reg = <0xfffffa00 0x100>;
+- interrupts = <3 4>;
++ interrupts = <3 4 1>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ interrupt-controller;
+@@ -143,14 +143,14 @@
+ dbgu: serial@fffff200 {
+ compatible = "atmel,at91sam9260-usart";
+ reg = <0xfffff200 0x200>;
+- interrupts = <1 4>;
++ interrupts = <1 4 7>;
+ status = "disabled";
+ };
+
+ usart0: serial@f801c000 {
+ compatible = "atmel,at91sam9260-usart";
+ reg = <0xf801c000 0x4000>;
+- interrupts = <5 4>;
++ interrupts = <5 4 5>;
+ atmel,use-dma-rx;
+ atmel,use-dma-tx;
+ status = "disabled";
+@@ -159,7 +159,7 @@
+ usart1: serial@f8020000 {
+ compatible = "atmel,at91sam9260-usart";
+ reg = <0xf8020000 0x4000>;
+- interrupts = <6 4>;
++ interrupts = <6 4 5>;
+ atmel,use-dma-rx;
+ atmel,use-dma-tx;
+ status = "disabled";
+@@ -168,7 +168,7 @@
+ usart2: serial@f8024000 {
+ compatible = "atmel,at91sam9260-usart";
+ reg = <0xf8024000 0x4000>;
+- interrupts = <7 4>;
++ interrupts = <7 4 5>;
+ atmel,use-dma-rx;
+ atmel,use-dma-tx;
+ status = "disabled";
+@@ -177,7 +177,7 @@
+ usart3: serial@f8028000 {
+ compatible = "atmel,at91sam9260-usart";
+ reg = <0xf8028000 0x4000>;
+- interrupts = <8 4>;
++ interrupts = <8 4 5>;
+ atmel,use-dma-rx;
+ atmel,use-dma-tx;
+ status = "disabled";
+@@ -205,7 +205,7 @@
+ usb0: ohci@00500000 {
+ compatible = "atmel,at91rm9200-ohci", "usb-ohci";
+ reg = <0x00500000 0x00100000>;
+- interrupts = <22 4>;
++ interrupts = <22 4 2>;
+ status = "disabled";
+ };
+ };
+diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi
+index 170b6f8..fc38d21 100644
+--- a/arch/arm/boot/dts/at91sam9x5.dtsi
++++ b/arch/arm/boot/dts/at91sam9x5.dtsi
+@@ -51,7 +51,7 @@
+ ranges;
+
+ aic: interrupt-controller@fffff000 {
+- #interrupt-cells = <2>;
++ #interrupt-cells = <3>;
+ compatible = "atmel,at91rm9200-aic";
+ interrupt-controller;
+ reg = <0xfffff000 0x200>;
+@@ -81,37 +81,37 @@
+ pit: timer@fffffe30 {
+ compatible = "atmel,at91sam9260-pit";
+ reg = <0xfffffe30 0xf>;
+- interrupts = <1 4>;
++ interrupts = <1 4 7>;
+ };
+
+ tcb0: timer@f8008000 {
+ compatible = "atmel,at91sam9x5-tcb";
+ reg = <0xf8008000 0x100>;
+- interrupts = <17 4>;
++ interrupts = <17 4 0>;
+ };
+
+ tcb1: timer@f800c000 {
+ compatible = "atmel,at91sam9x5-tcb";
+ reg = <0xf800c000 0x100>;
+- interrupts = <17 4>;
++ interrupts = <17 4 0>;
+ };
+
+ dma0: dma-controller@ffffec00 {
+ compatible = "atmel,at91sam9g45-dma";
+ reg = <0xffffec00 0x200>;
+- interrupts = <20 4>;
++ interrupts = <20 4 0>;
+ };
+
+ dma1: dma-controller@ffffee00 {
+ compatible = "atmel,at91sam9g45-dma";
+ reg = <0xffffee00 0x200>;
+- interrupts = <21 4>;
++ interrupts = <21 4 0>;
+ };
+
+ pioA: gpio@fffff400 {
+ compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
+ reg = <0xfffff400 0x100>;
+- interrupts = <2 4>;
++ interrupts = <2 4 1>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ interrupt-controller;
+@@ -121,7 +121,7 @@
+ pioB: gpio@fffff600 {
+ compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
+ reg = <0xfffff600 0x100>;
+- interrupts = <2 4>;
++ interrupts = <2 4 1>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ interrupt-controller;
+@@ -131,7 +131,7 @@
+ pioC: gpio@fffff800 {
+ compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
+ reg = <0xfffff800 0x100>;
+- interrupts = <3 4>;
++ interrupts = <3 4 1>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ interrupt-controller;
+@@ -141,7 +141,7 @@
+ pioD: gpio@fffffa00 {
+ compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
+ reg = <0xfffffa00 0x100>;
+- interrupts = <3 4>;
++ interrupts = <3 4 1>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ interrupt-controller;
+@@ -151,14 +151,14 @@
+ dbgu: serial@fffff200 {
+ compatible = "atmel,at91sam9260-usart";
+ reg = <0xfffff200 0x200>;
+- interrupts = <1 4>;
++ interrupts = <1 4 7>;
+ status = "disabled";
+ };
+
+ usart0: serial@f801c000 {
+ compatible = "atmel,at91sam9260-usart";
+ reg = <0xf801c000 0x200>;
+- interrupts = <5 4>;
++ interrupts = <5 4 5>;
+ atmel,use-dma-rx;
+ atmel,use-dma-tx;
+ status = "disabled";
+@@ -167,7 +167,7 @@
+ usart1: serial@f8020000 {
+ compatible = "atmel,at91sam9260-usart";
+ reg = <0xf8020000 0x200>;
+- interrupts = <6 4>;
++ interrupts = <6 4 5>;
+ atmel,use-dma-rx;
+ atmel,use-dma-tx;
+ status = "disabled";
+@@ -176,7 +176,7 @@
+ usart2: serial@f8024000 {
+ compatible = "atmel,at91sam9260-usart";
+ reg = <0xf8024000 0x200>;
+- interrupts = <7 4>;
++ interrupts = <7 4 5>;
+ atmel,use-dma-rx;
+ atmel,use-dma-tx;
+ status = "disabled";
+@@ -185,14 +185,14 @@
+ macb0: ethernet@f802c000 {
+ compatible = "cdns,at32ap7000-macb", "cdns,macb";
+ reg = <0xf802c000 0x100>;
+- interrupts = <24 4>;
++ interrupts = <24 4 3>;
+ status = "disabled";
+ };
+
+ macb1: ethernet@f8030000 {
+ compatible = "cdns,at32ap7000-macb", "cdns,macb";
+ reg = <0xf8030000 0x100>;
+- interrupts = <27 4>;
++ interrupts = <27 4 3>;
+ status = "disabled";
+ };
+ };
+@@ -215,14 +215,14 @@
+ usb0: ohci@00600000 {
+ compatible = "atmel,at91rm9200-ohci", "usb-ohci";
+ reg = <0x00600000 0x100000>;
+- interrupts = <22 4>;
++ interrupts = <22 4 2>;
+ status = "disabled";
+ };
+
+ usb1: ehci@00700000 {
+ compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
+ reg = <0x00700000 0x100000>;
+- interrupts = <22 4>;
++ interrupts = <22 4 2>;
+ status = "disabled";
+ };
+ };
+diff --git a/arch/arm/mach-at91/include/mach/at91_aic.h b/arch/arm/mach-at91/include/mach/at91_aic.h
+index c1413ed..3af7272 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;
+ .extern at91_aic_base
+ #endif
+
++#define AT91_AIC_IRQ_MIN_PRIORITY 0
++#define AT91_AIC_IRQ_MAX_PRIORITY 7
++
+ #define AT91_AIC_SMR(n) ((n) * 4) /* Source Mode Registers 0-31 */
+ #define AT91_AIC_PRIOR (7 << 0) /* Priority Level */
+ #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 df8605f..db8e141 100644
+--- a/arch/arm/mach-at91/irq.c
++++ b/arch/arm/mach-at91/irq.c
+@@ -30,6 +30,7 @@
+ #include <linux/of_irq.h>
+ #include <linux/irqdomain.h>
+ #include <linux/err.h>
++#include <linux/slab.h>
+
+ #include <mach/hardware.h>
+ #include <asm/irq.h>
+@@ -42,6 +43,7 @@
+ void __iomem *at91_aic_base;
+ static struct irq_domain *at91_aic_domain;
+ static struct device_node *at91_aic_np;
++static unsigned int *at91_aic_irq_priorities;
+
+ static void at91_aic_mask_irq(struct irq_data *d)
+ {
+@@ -177,8 +179,9 @@ static int at91_aic_irq_map(struct irq_domain *h, unsigned int virq,
+ /* Put virq number in Source Vector Register */
+ at91_aic_write(AT91_AIC_SVR(hw), virq);
+
+- /* Active Low interrupt, without priority */
+- at91_aic_write(AT91_AIC_SMR(hw), AT91_AIC_SRCTYPE_LOW);
++ /* Active Low interrupt, with priority */
++ at91_aic_write(AT91_AIC_SMR(hw),
++ AT91_AIC_SRCTYPE_LOW | at91_aic_irq_priorities[hw]);
+
+ irq_set_chip_and_handler(virq, &at91_aic_chip, handle_fasteoi_irq);
+ 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,
+ return 0;
+ }
+
++static int at91_aic_irq_domain_xlate(struct irq_domain *d, struct device_node *ctrlr,
++ const u32 *intspec, unsigned int intsize,
++ irq_hw_number_t *out_hwirq, unsigned int *out_type)
++{
++ if (WARN_ON(intsize < 3))
++ return -EINVAL;
++ if (WARN_ON(intspec[0] >= NR_AIC_IRQS))
++ return -EINVAL;
++ if (WARN_ON((intspec[2] < AT91_AIC_IRQ_MIN_PRIORITY)
++ || (intspec[2] > AT91_AIC_IRQ_MAX_PRIORITY)))
++ return -EINVAL;
++
++ *out_hwirq = intspec[0];
++ *out_type = intspec[1] & IRQ_TYPE_SENSE_MASK;
++ at91_aic_irq_priorities[*out_hwirq] = intspec[2];
++
++ return 0;
++}
++
+ static struct irq_domain_ops at91_aic_irq_ops = {
+ .map = at91_aic_irq_map,
+- .xlate = irq_domain_xlate_twocell,
++ .xlate = at91_aic_irq_domain_xlate,
+ };
+
+ int __init at91_aic_of_init(struct device_node *node,
+@@ -198,6 +220,12 @@ int __init at91_aic_of_init(struct device_node *node,
+ const __be32 *p;
+ u32 val;
+
++ at91_aic_irq_priorities = kzalloc(NR_AIC_IRQS
++ * sizeof(*at91_aic_irq_priorities),
++ GFP_KERNEL);
++ if (!at91_aic_irq_priorities)
++ return -ENOMEM;
++
+ at91_aic_base = of_iomap(node, 0);
+ at91_aic_np = node;
+
+--
+1.8.0.197.g5a90748
+