Skip to contentSkip to conversation

metag: tz1090: add irq-pdc, pinctrl and gpio to DT

PATCH In review James Hogan 4 participants 11 messages Jun 20, 2013 – Jun 27, 2013

Subsystems (2)
lore
Share & tools
lore
#1 lore raw

PATCH 1/7 metag: add <dt-bindings/> symlink

In reply to James Hogan

Add symlink to include/dt-bindings from arch/metag/boot/dts/include/ to match the one in arch/arm/... (see the commit below) so that preprocessed device tree files can include various useful constant definitions.

Commit c58299aa87544a590c62bda0bf52b69fa56cb8d5 ("kbuild: create an "include chroot" for DT bindings") merged in v3.10-rc1.

---
 arch/metag/boot/dts/include/dt-bindings | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 arch/metag/boot/dts/include/dt-bindings
arch/metag/boot/dts/include/dt-bindings new file +1 -0
new file mode 120000
index 0000000..08c00e4
@@ -0,0 +1 @@
+../../../../../include/dt-bindings
\ No newline at end of file
Signature · 1 line
1.8.1.2
#3 lore raw

PATCH 2/7 metag: *.dts: include using preprocessor

In reply to James Hogan

Include *.dtsi files from *.dts using the preprocessor to set a good example for future device tree files. Files included in the old way don't get pre-processed.

Cc devicetree-discuss-uLR06cmDAlY/[email protected]
---
 arch/metag/boot/dts/skeleton.dts       | 2 +-
 arch/metag/boot/dts/tz1090.dtsi        | 2 +-
 arch/metag/boot/dts/tz1090_generic.dts | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
arch/metag/boot/dts/skeleton.dts +1 -1
index 7244d1f..7a49aeb 100644
@@ -7,4 +7,4 @@
  */
 /dts-v1/;
 
-/include/ "skeleton.dtsi"
+#include "skeleton.dtsi"
arch/metag/boot/dts/tz1090.dtsi +1 -1
index ca057f0..ff7bb74 100644
@@ -6,7 +6,7 @@
  * published by the Free Software Foundation.
  */
 
-/include/ "skeleton.dtsi"
+#include "skeleton.dtsi"
 
 / {
 	compatible = "toumaz,tz1090", "img,meta";
arch/metag/boot/dts/tz1090_generic.dts +1 -1
index aa826cb..f960909 100644
@@ -7,4 +7,4 @@
  */
 /dts-v1/;
 
-/include/ "tz1090.dtsi"
+#include "tz1090.dtsi"
Signature · 1 line
1.8.1.2
#5 lore raw

PATCH 4/7 metag: tz1090: select and instantiate pinctrl-tz1090

In reply to James Hogan

Select PINCTRL and PINCTRL_TZ1090 from SOC_TZ1090 to enable the main pin controller driver once it is merged, and instantiate it from tz1090.dtsi.

---
 arch/metag/Kconfig.soc          | 2 ++
 arch/metag/boot/dts/tz1090.dtsi | 6 ++++++
 2 files changed, 8 insertions(+)
arch/metag/Kconfig.soc +2 -0
index 433befd..944dc30 100644
@@ -20,6 +20,8 @@ config SOC_TZ1090
 	select METAG_LNKGET_AROUND_CACHE
 	select METAG_META21
 	select METAG_SMP_WRITE_REORDERING
+	select PINCTRL
+	select PINCTRL_TZ1090
 	help
 	  This is a Toumaz Technology Xenif TZ1090 (A.K.A. Comet) SoC containing
 	  a 2-threaded HTP.
arch/metag/boot/dts/tz1090.dtsi +6 -0
index 0ed8023..f9cb189 100644
@@ -43,5 +43,11 @@
 			             <29 IRQ_TYPE_LEVEL_HIGH>, /* Perip 1 (IR) */
 			             <31 IRQ_TYPE_LEVEL_HIGH>; /* Perip 2 (WDT) */
 		};
+
+		pinctrl: pinctrl@02005800 {
+			#gpio-range-cells = <3>;
+			compatible = "img,tz1090-pinctrl";
+			reg = <0x02005800 0xe4>;
+		};
 	};
 };
Signature · 1 line
1.8.1.2
#0 lore raw

cover metag: tz1090: add irq-pdc, pinctrl and gpio to DT

This patchset, based on and for the metag tree, adds the necessary device tree nodes and selects the necessary Kconfig symbols in order to enable the irq-imgpdc, {pinctrl,gpio}-tz1090[-pdc] drivers once they are accepted and merged.

The first two patches set things up for metag so that we can include <dt-bindings/*> files from device tree files.

I plan on applying the first two patches soon, and the others after the corresponding drivers have been accepted into the appropriate trees on which they depend.

Cc Thomas Gleixner <[email protected]>
Cc Linus Walleij <[email protected]>

James Hogan (7):
metag: add <dt-bindings/> symlink
metag: *.dts: include using preprocessor
metag: tz1090: select and instantiate irq-imgpdc
metag: tz1090: select and instantiate pinctrl-tz1090
metag: tz1090: select and instantiate gpio-tz1090
metag: tz1090: select and instantiate pinctrl-tz1090-pdc
metag: tz1090: instantiate gpio-tz1090-pdc

 arch/metag/Kconfig.soc                  |  5 ++
 arch/metag/boot/dts/include/dt-bindings |  1 +
 arch/metag/boot/dts/skeleton.dts        |  2 +-
 arch/metag/boot/dts/tz1090.dtsi         | 81 ++++++++++++++++++++++++++++++++-
 arch/metag/boot/dts/tz1090_generic.dts  |  2 +-
 5 files changed, 88 insertions(+), 3 deletions(-)
 create mode 120000 arch/metag/boot/dts/include/dt-bindings
Signature · 1 line
1.8.1.2
#6 lore raw

PATCH 5/7 metag: tz1090: select and instantiate gpio-tz1090

Select ARCH_WANT_OPTIONAL_GPIOLIB from SOC_TZ1090 to allow GPIOLIB and GPIO_TZ1090 (the main gpio driver) to be enabled once it is merged, and instantiate it from tz1090.dtsi.

---
 arch/metag/Kconfig.soc          |  1 +
 arch/metag/boot/dts/tz1090.dtsi | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+)
arch/metag/Kconfig.soc +1 -0
index 944dc30..d61d687 100644
@@ -16,6 +16,7 @@ config META21_FPGA
 
 config SOC_TZ1090
 	bool "Toumaz Xenif TZ1090 SoC (Comet)"
+	select ARCH_WANT_OPTIONAL_GPIOLIB
 	select IMGPDC_IRQ
 	select METAG_LNKGET_AROUND_CACHE
 	select METAG_META21
arch/metag/boot/dts/tz1090.dtsi +35 -0
index f9cb189..d9e537e 100644
@@ -49,5 +49,40 @@
 			compatible = "img,tz1090-pinctrl";
 			reg = <0x02005800 0xe4>;
 		};
+
+		gpios: gpios@02005800 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "img,tz1090-gpio";
+			reg = <0x02005800 0x90>;
+
+			gpios0: bank@0 {
+				gpio-controller;
+				interrupt-controller;
+				#gpio-cells = <2>;
+				#interrupt-cells = <2>;
+				reg = <0>;
+				interrupts = <13 IRQ_TYPE_LEVEL_HIGH>;
+				gpio-ranges = <&pinctrl 0 0 30>;
+			};
+			gpios1: bank@1 {
+				gpio-controller;
+				interrupt-controller;
+				#gpio-cells = <2>;
+				#interrupt-cells = <2>;
+				reg = <1>;
+				interrupts = <14 IRQ_TYPE_LEVEL_HIGH>;
+				gpio-ranges = <&pinctrl 0 30 30>;
+			};
+			gpios2: bank@2 {
+				gpio-controller;
+				interrupt-controller;
+				#gpio-cells = <2>;
+				#interrupt-cells = <2>;
+				reg = <2>;
+				interrupts = <15 IRQ_TYPE_LEVEL_HIGH>;
+				gpio-ranges = <&pinctrl 0 60 30>;
+			};
+		};
 	};
 };
Signature · 1 line
1.8.1.2
#8 lore raw

PATCH 7/7 metag: tz1090: instantiate gpio-tz1090-pdc

In reply to James Hogan

Instantiate the PDC GPIO controller driver from tz1090.dtsi ready for when it is merged.

---
 arch/metag/boot/dts/tz1090.dtsi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/metag/boot/dts/tz1090.dtsi +14 -0
index 66cf55d..24ea7d2 100644
@@ -90,5 +90,19 @@
 				gpio-ranges = <&pinctrl 0 60 30>;
 			};
 		};
+
+		pdc_gpios: gpios@02006500 {
+			gpio-controller;
+			#gpio-cells = <2>;
+
+			compatible = "img,tz1090-pdc-gpio";
+			reg = <0x02006500 0x100>;
+
+			interrupt-parent = <&pdc>;
+			interrupts =	<8  IRQ_TYPE_NONE>,
+					<9  IRQ_TYPE_NONE>,
+					<10 IRQ_TYPE_NONE>;
+			gpio-ranges = <&pdc_pinctrl 0 0 7>;
+		};
 	};
 };
Signature · 1 line
1.8.1.2
#7 lore raw

PATCH 6/7 metag: tz1090: select and instantiate pinctrl-tz1090-pdc

In reply to James Hogan

Select PINCTRL_TZ1090_PDC from SOC_TZ1090 to enable the PDC pin controller driver once it is merged, and instantiate it from tz1090.dtsi.

---
 arch/metag/Kconfig.soc          | 1 +
 arch/metag/boot/dts/tz1090.dtsi | 6 ++++++
 2 files changed, 7 insertions(+)
arch/metag/Kconfig.soc +1 -0
index d61d687..973640f 100644
@@ -23,6 +23,7 @@ config SOC_TZ1090
 	select METAG_SMP_WRITE_REORDERING
 	select PINCTRL
 	select PINCTRL_TZ1090
+	select PINCTRL_TZ1090_PDC
 	help
 	  This is a Toumaz Technology Xenif TZ1090 (A.K.A. Comet) SoC containing
 	  a 2-threaded HTP.
arch/metag/boot/dts/tz1090.dtsi +6 -0
index d9e537e..66cf55d 100644
@@ -50,6 +50,12 @@
 			reg = <0x02005800 0xe4>;
 		};
 
+		pdc_pinctrl: pinctrl@02006500 {
+			#gpio-range-cells = <3>;
+			compatible = "img,tz1090-pdc-pinctrl";
+			reg = <0x02006500 0x100>;
+		};
+
 		gpios: gpios@02005800 {
 			#address-cells = <1>;
 			#size-cells = <0>;
Signature · 1 line
1.8.1.2
#4 lore raw

PATCH 3/7 metag: tz1090: select and instantiate irq-imgpdc

In reply to James Hogan

Select IMGPDC_IRQ from SOC_TZ1090 to enable the PDC interrupt controller driver once it is merged, and instantiate it from tz1090.dtsi.

Cc Thomas Gleixner <[email protected]>
---
 arch/metag/Kconfig.soc          |  1 +
 arch/metag/boot/dts/tz1090.dtsi | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+)
arch/metag/Kconfig.soc +1 -0
index 653b479..433befd 100644
@@ -16,6 +16,7 @@ config META21_FPGA
 
 config SOC_TZ1090
 	bool "Toumaz Xenif TZ1090 SoC (Comet)"
+	select IMGPDC_IRQ
 	select METAG_LNKGET_AROUND_CACHE
 	select METAG_META21
 	select METAG_SMP_WRITE_REORDERING
arch/metag/boot/dts/tz1090.dtsi +18 -0
index ff7bb74..0ed8023 100644
@@ -8,6 +8,8 @@
 
 #include "skeleton.dtsi"
 
+#include <dt-bindings/interrupt-controller/irq.h>
+
 / {
 	compatible = "toumaz,tz1090", "img,meta";
 
@@ -25,5 +27,21 @@
 		#address-cells = <1>;
 		#size-cells = <1>;
 		ranges;
+
+		pdc: pdc@0x02006000 {
+			interrupt-controller;
+			#interrupt-cells = <2>;
+
+			reg = <0x02006000 0x1000>;
+			compatible = "img,pdc-intc";
+
+			num-perips = <3>;
+			num-syswakes = <3>;
+
+			interrupts = <18 IRQ_TYPE_LEVEL_HIGH>, /* Syswakes */
+			             <30 IRQ_TYPE_LEVEL_HIGH>, /* Perip 0 (RTC) */
+			             <29 IRQ_TYPE_LEVEL_HIGH>, /* Perip 1 (IR) */
+			             <31 IRQ_TYPE_LEVEL_HIGH>; /* Perip 2 (WDT) */
+		};
 	};
 };
Signature · 1 line
1.8.1.2
Reviewed-by on v1 1/7
#2 lore raw

Re: [PATCH 1/7] metag: add <dt-bindings/> symlink

In reply to James Hogan
Quoted 7 lines · James Hogan

Add symlink to include/dt-bindings from arch/metag/boot/dts/include/ to match the one in arch/arm/... (see the commit below) so that preprocessed device tree files can include various useful constant definitions.

Commit c58299aa87544a590c62bda0bf52b69fa56cb8d5 ("kbuild: create an "include chroot" for DT bindings") merged in v3.10-rc1.

Acked-by on the v1 series
#9 lore raw
In reply to James Hogan
Quoted 8 lines · James Hogan

This patchset, based on and for the metag tree, adds the necessary device tree nodes and selects the necessary Kconfig symbols in order to enable the irq-imgpdc, {pinctrl,gpio}-tz1090[-pdc] drivers once they are accepted and merged.

The first two patches set things up for metag so that we can include <dt-bindings/*> files from device tree files.

Quoted 6 lines

I plan on applying the first two patches soon, and the others after the corresponding drivers have been accepted into the appropriate trees on which they depend.

Cc Thomas Gleixner <[email protected]>
Cc Linus Walleij <[email protected]>

The series:

Yours,
Linus Walleij

Acked-by
#10 lore raw
Quoted 14 lines · Linus Walleij
Quoted 12 lines · James Hogan

This patchset, based on and for the metag tree, adds the necessary device tree nodes and selects the necessary Kconfig symbols in order to enable the irq-imgpdc, {pinctrl,gpio}-tz1090[-pdc] drivers once they are accepted and merged.

The first two patches set things up for metag so that we can include <dt-bindings/*> files from device tree files.

I plan on applying the first two patches soon, and the others after the corresponding drivers have been accepted into the appropriate trees on which they depend.

Quoted 5 lines
Quoted 2 lines
Cc Thomas Gleixner <[email protected]>
Cc Linus Walleij <[email protected]>

The series:

Me too, for the series: