Skip to content

Commit

Permalink
ARM: at91/gpio: add irqdomain and DT support
Browse files Browse the repository at this point in the history
Add "legacy" type of irqdomain to preserve old-style numbering
and allow smooth transition for both DT and non-DT cases.

Original idea and code by Jean-Christophe Plagniol-Villard.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
  • Loading branch information
Nicolas Ferre committed Mar 1, 2012
1 parent 4340cde commit 21f8187
Show file tree
Hide file tree
Showing 5 changed files with 291 additions and 46 deletions.
20 changes: 20 additions & 0 deletions Documentation/devicetree/bindings/gpio/gpio_atmel.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
* Atmel GPIO controller (PIO)

Required properties:
- compatible: "atmel,at91rm9200-gpio"
- reg: Should contain GPIO controller registers location and length
- interrupts: Should be the port interrupt shared by all the pins.
- #gpio-cells: Should be two. The first cell is the pin number and
the second cell is used to specify optional parameters (currently
unused).
- gpio-controller: Marks the device node as a GPIO controller.

Example:
pioA: gpio@fffff200 {
compatible = "atmel,at91rm9200-gpio";
reg = <0xfffff200 0x100>;
interrupts = <2 4>;
#gpio-cells = <2>;
gpio-controller;
};

30 changes: 30 additions & 0 deletions arch/arm/boot/dts/at91sam9g20.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
serial4 = &usart3;
serial5 = &usart4;
serial6 = &usart5;
gpio0 = &pioA;
gpio1 = &pioB;
gpio2 = &pioC;
};
cpus {
cpu@0 {
Expand Down Expand Up @@ -54,6 +57,33 @@
reg = <0xfffff000 0x200>;
};

pioA: gpio@fffff400 {
compatible = "atmel,at91rm9200-gpio";
reg = <0xfffff400 0x100>;
interrupts = <2 4>;
#gpio-cells = <2>;
gpio-controller;
interrupt-controller;
};

pioB: gpio@fffff600 {
compatible = "atmel,at91rm9200-gpio";
reg = <0xfffff600 0x100>;
interrupts = <3 4>;
#gpio-cells = <2>;
gpio-controller;
interrupt-controller;
};

pioC: gpio@fffff800 {
compatible = "atmel,at91rm9200-gpio";
reg = <0xfffff800 0x100>;
interrupts = <4 4>;
#gpio-cells = <2>;
gpio-controller;
interrupt-controller;
};

dbgu: serial@fffff200 {
compatible = "atmel,at91sam9260-usart";
reg = <0xfffff200 0x200>;
Expand Down
50 changes: 50 additions & 0 deletions arch/arm/boot/dts/at91sam9g45.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
serial2 = &usart1;
serial3 = &usart2;
serial4 = &usart3;
gpio0 = &pioA;
gpio1 = &pioB;
gpio2 = &pioC;
gpio3 = &pioD;
gpio4 = &pioE;
};
cpus {
cpu@0 {
Expand Down Expand Up @@ -59,6 +64,51 @@
interrupts = <21 4>;
};

pioA: gpio@fffff200 {
compatible = "atmel,at91rm9200-gpio";
reg = <0xfffff200 0x100>;
interrupts = <2 4>;
#gpio-cells = <2>;
gpio-controller;
interrupt-controller;
};

pioB: gpio@fffff400 {
compatible = "atmel,at91rm9200-gpio";
reg = <0xfffff400 0x100>;
interrupts = <3 4>;
#gpio-cells = <2>;
gpio-controller;
interrupt-controller;
};

pioC: gpio@fffff600 {
compatible = "atmel,at91rm9200-gpio";
reg = <0xfffff600 0x100>;
interrupts = <4 4>;
#gpio-cells = <2>;
gpio-controller;
interrupt-controller;
};

pioD: gpio@fffff800 {
compatible = "atmel,at91rm9200-gpio";
reg = <0xfffff800 0x100>;
interrupts = <5 4>;
#gpio-cells = <2>;
gpio-controller;
interrupt-controller;
};

pioE: gpio@fffffa00 {
compatible = "atmel,at91rm9200-gpio";
reg = <0xfffffa00 0x100>;
interrupts = <5 4>;
#gpio-cells = <2>;
gpio-controller;
interrupt-controller;
};

dbgu: serial@ffffee00 {
compatible = "atmel,at91sam9260-usart";
reg = <0xffffee00 0x200>;
Expand Down
4 changes: 4 additions & 0 deletions arch/arm/boot/dts/at91sam9x5.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
interrupts = <2 4>;
#gpio-cells = <2>;
gpio-controller;
interrupt-controller;
};

pioB: gpio@fffff600 {
Expand All @@ -102,6 +103,7 @@
interrupts = <2 4>;
#gpio-cells = <2>;
gpio-controller;
interrupt-controller;
};

pioC: gpio@fffff800 {
Expand All @@ -110,6 +112,7 @@
interrupts = <3 4>;
#gpio-cells = <2>;
gpio-controller;
interrupt-controller;
};

pioD: gpio@fffffa00 {
Expand All @@ -118,6 +121,7 @@
interrupts = <3 4>;
#gpio-cells = <2>;
gpio-controller;
interrupt-controller;
};

dbgu: serial@fffff200 {
Expand Down
Loading

0 comments on commit 21f8187

Please sign in to comment.