Skip to contentSkip to conversation

i.MX: Add GPT devicetree nodes

PATCH New Sascha Hauer 3 participants 12 messages Mar 14, 2013 – Mar 15, 2013

Subsystems (3)
lore
Share & tools
lore

Sascha Hauer

author maintainer
#0 lore raw

PATCH 1/1 i.MX: Add GPT devicetree nodes

The GPT is the general purpose timer found on i.MX SoCs. The bindings are used on i.MX25 and i.MX6 already. The remaining i.MX SoCs still use a platform based timer. This is a first step to change this: We add the devicetree nodes for the other DT enabled SoCs (i.MX27, i.MX31, i.MX51 and i.MX53).

This series also adds the missing binding documentation for the GPT.

The series is based on Shawns imx/dt branch.

The last patch adds the clocks to the i.MX27 GPT. This is not applicable right now since it depends on the patch changing i.MX27 to devicetree based clock lookups.

Sascga

----------------------------------------------------------------
Sascha Hauer (7):
ARM: i.MX: Add GPT devicetree Documentation
ARM: i.MX27: Add GPT devicetree nodes
ARM: i.MX31: Add GPT devicetree node
ARM: i.MX51: Add GPT devicetree node
ARM: i.MX53: Add GPT devicetree node
ARM: i.MX6: Add clocks to GPT devicetree node
ARM: i.MX27: Add clocks to GPT devicetree nodes

 .../devicetree/bindings/timer/fsl,imxgpt.txt       | 18 ++++++++
 arch/arm/boot/dts/imx27.dtsip                      | 49 +++++++++++++++++++++-
 arch/arm/boot/dts/imx31.dtsip                      | 16 +++++++
 arch/arm/boot/dts/imx51.dtsip                      |  8 ++++
 arch/arm/boot/dts/imx53.dtsip                      |  8 ++++
 arch/arm/boot/dts/imx6qdl.dtsip                    |  2 +
 6 files changed, 100 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/timer/fsl,imxgpt.txt
author maintainer
#1 lore raw

PATCH 1/7 ARM: i.MX: Add GPT devicetree Documentation

The GPT binding is already used on i.MX6 and i.MX25, but not yet documented. Add a binding document for it.

---
 Documentation/devicetree/bindings/timer/fsl,imxgpt.txt | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/timer/fsl,imxgpt.txt
Documentation/devicetree/bindings/timer/fsl,imxgpt.txt new file +18 -0
new file mode 100644
index 0000000..544890a
@@ -0,0 +1,18 @@
+Freescale i.MX GPT
+
+Required properties:
+
+- compatible : should be "fsl,<soc>-gpt"
+- reg : Specifies base physical address and size of the registers.
+- interrupts : A list of 4 interrupts; one per timer channel.
+- clocks : The clocks provided by the SoC to drive the timer.
+
+Example:
+
+gpt1: timer at 10003000 {
+	compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
+	reg = <0x10003000 0x1000>;
+	interrupts = <26>;
+	clocks = <&clks 46>, <&clks 61>;
+	clock-names = "ipg", "per";
+};
Signature · 1 line
1.8.2.rc2
#2 lore raw

PATCH 1/7 ARM: i.MX: Add GPT devicetree Documentation

Documentation/devicetree/bindings/timer/fsl,imxgpt.txt

Quoted 6 lines · Sascha Hauer

The GPT binding is already used on i.MX6 and i.MX25, but not yet documented. Add a binding document for it.

Documentation/devicetree/bindings/timer/fsl,imxgpt.txt +1 -0
 
+Freescale i.MX GPT

You might want to mention what "GPT" is here, or at least expand the acronym. I first read this as "GUID Partition Table".

#3 lore raw

PATCH 1/7 ARM: i.MX: Add GPT devicetree Documentation

Quoted 10 lines · Stephen Warren

Documentation/devicetree/bindings/timer/fsl,imxgpt.txt

Quoted 6 lines · Sascha Hauer

The GPT binding is already used on i.MX6 and i.MX25, but not yet documented. Add a binding document for it.

Documentation/devicetree/bindings/timer/fsl,imxgpt.txt +1 -0
 
+Freescale i.MX GPT

You might want to mention what "GPT" is here, or at least expand the acronym. I first read this as "GUID Partition Table".

I just fixed it as below and applied the patch (actually the series).

Freescale i.MX General Purpose Timer (GPT)

Shawn

author maintainer
#4 lore raw

PATCH 1/7 ARM: i.MX: Add GPT devicetree Documentation

Quoted 7 lines · Shawn Guo
Quoted 6 lines · Stephen Warren
Quoted 4 lines · Sascha Hauer

The GPT binding is already used on i.MX6 and i.MX25, but not yet documented. Add a binding document for it.

Documentation/devicetree/bindings/timer/fsl,imxgpt.txt +0 -0
Quoted 8 lines
Quoted 4 lines
Quoted 1 line

+Freescale i.MX GPT

You might want to mention what "GPT" is here, or at least expand the acronym. I first read this as "GUID Partition Table".

I just fixed it as below and applied the patch (actually the series).

Freescale i.MX General Purpose Timer (GPT)

Thanks for fixing, Shawn.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
author maintainer
#5 lore raw

PATCH 2/7 ARM: i.MX27: Add GPT devicetree nodes

In reply to Sascha Hauer

The GPT is the GPT timer found on i.MX SoCs.

This adds the missing GPT devicetree nodes. Also fixup the watchdog register map size along the way. it's 0x1000, not 0x4000. This didn't hurt before as the region was not occupied by another device, but now overlaps with the GPT.

---
 arch/arm/boot/dts/imx27.dtsip | 37 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)
arch/arm/boot/dts/imx27.dtsip +36 -1
index 324130f..3e0585f 100644
@@ -60,10 +60,28 @@
 
 			wdog: wdog at 10002000 {
 				compatible = "fsl,imx27-wdt", "fsl,imx21-wdt";
-				reg = <0x10002000 0x4000>;
+				reg = <0x10002000 0x1000>;
 				interrupts = <27>;
 			};
 
+			gpt1: timer at 10003000 {
+				compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
+				reg = <0x10003000 0x1000>;
+				interrupts = <26>;
+			};
+
+			gpt2: timer at 10004000 {
+				compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
+				reg = <0x10004000 0x1000>;
+				interrupts = <25>;
+			};
+
+			gpt3: timer at 10005000 {
+				compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
+				reg = <0x10005000 0x1000>;
+				interrupts = <24>;
+			};
+
 			uart1: serial at 1000a000 {
 				compatible = "fsl,imx27-uart", "fsl,imx21-uart";
 				reg = <0x1000a000 0x1000>;
@@ -188,6 +206,18 @@
 				status = "disabled";
 			};
 
+			gpt4: timer at 10019000 {
+				compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
+				reg = <0x10019000 0x1000>;
+				interrupts = <4>;
+			};
+
+			gpt5: timer at 1001a000 {
+				compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
+				reg = <0x1001a000 0x1000>;
+				interrupts = <3>;
+			};
+
 			uart5: serial at 1001b000 {
 				compatible = "fsl,imx27-uart", "fsl,imx21-uart";
 				reg = <0x1001b000 0x1000>;
@@ -211,6 +241,11 @@
 				status = "disabled";
 			};
 
+			gpt6: timer at 1001f000 {
+				compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
+				reg = <0x1001f000 0x1000>;
+				interrupts = <2>;
+			};
 		};
 
 		aipi at 10020000 { /* AIPI2 */
Signature · 1 line
1.8.2.rc2
author maintainer
#6 lore raw

PATCH 3/7 ARM: i.MX31: Add GPT devicetree node

In reply to Sascha Hauer

The GPT is the GPT timer found on i.MX SoCs.

Since this is the first user of the AIPS2 this patch also adds it.

---
 arch/arm/boot/dts/imx31.dtsip | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
arch/arm/boot/dts/imx31.dtsip +16 -0
index aa488ac..c544925 100644
@@ -101,5 +101,21 @@
 				#clock-cells = <1>;
 			};
 		};
+
+		aips at 53f00000 { /* AIPS2 */
+			compatible = "fsl,aips-bus", "simple-bus";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			reg = <0x53f00000 0x100000>;
+			ranges;
+
+			gpt: timer at 53f90000 {
+				compatible = "fsl,imx31-gpt";
+				reg = <0x53f90000 0x4000>;
+				interrupts = <29>;
+				clocks = <&clks 10>, <&clks 22>;
+				clock-names = "ipg", "per";
+			};
+		};
 	};
 };
Signature · 1 line
1.8.2.rc2
author maintainer
#7 lore raw

PATCH 4/7 ARM: i.MX51: Add GPT devicetree node

In reply to Sascha Hauer

The GPT is the GPT timer found on i.MX SoCs. This patch adds the devicetree node for it.

---
 arch/arm/boot/dts/imx51.dtsip | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/imx51.dtsip +8 -0
index 6e14b75..fd3ddef 100644
@@ -245,6 +245,14 @@
 				status = "disabled";
 			};
 
+			gpt: timer at 73fa0000 {
+				compatible = "fsl,imx51-gpt", "fsl,imx31-gpt";
+				reg = <0x73fa0000 0x4000>;
+				interrupts = <39>;
+				clocks = <&clks 36>, <&clks 41>;
+				clock-names = "ipg", "per";
+			};
+
 			iomuxc: iomuxc at 73fa8000 {
 				compatible = "fsl,imx51-iomuxc";
 				reg = <0x73fa8000 0x4000>;
Signature · 1 line
1.8.2.rc2
author maintainer
#8 lore raw

PATCH 5/7 ARM: i.MX53: Add GPT devicetree node

In reply to Sascha Hauer

The GPT is the GPT timer found on i.MX SoCs. This patch adds the devicetree node for it.

---
 arch/arm/boot/dts/imx53.dtsip | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/imx53.dtsip +8 -0
index 98149ac..6c73bee 100644
@@ -243,6 +243,14 @@
 				status = "disabled";
 			};
 
+			gpt: timer at 53fa0000 {
+				compatible = "fsl,imx53-gpt", "fsl,imx31-gpt";
+				reg = <0x53fa0000 0x4000>;
+				interrupts = <39>;
+				clocks = <&clks 36>, <&clks 41>;
+				clock-names = "ipg", "per";
+			};
+
 			iomuxc: iomuxc at 53fa8000 {
 				compatible = "fsl,imx53-iomuxc";
 				reg = <0x53fa8000 0x4000>;
Signature · 1 line
1.8.2.rc2
author maintainer
#9 lore raw

PATCH 6/7 ARM: i.MX6: Add clocks to GPT devicetree node

In reply to Sascha Hauer

The i.MX6 already has a devicetree node for the GPT, but not yet has the clocks. Add them.

---
 arch/arm/boot/dts/imx6qdl.dtsip | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/boot/dts/imx6qdl.dtsip +2 -0
index 52b156f..aa92d43 100644
@@ -282,6 +282,8 @@
 				compatible = "fsl,imx6q-gpt";
 				reg = <0x02098000 0x4000>;
 				interrupts = <0 55 0x04>;
+				clocks = <&clks 119>, <&clks 120>;
+				clock-names = "ipg", "per";
 			};
 
 			gpio1: gpio at 0209c000 {
Signature · 1 line
1.8.2.rc2
author maintainer
#10 lore raw

PATCH 7/7 ARM: i.MX27: Add clocks to GPT devicetree nodes

In reply to Sascha Hauer
---
 arch/arm/boot/dts/imx27.dtsip | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm/boot/dts/imx27.dtsip +12 -0
index 3e0585f..3ea1f59 100644
@@ -68,18 +68,24 @@
 				compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
 				reg = <0x10003000 0x1000>;
 				interrupts = <26>;
+				clocks = <&clks 46>, <&clks 61>;
+				clock-names = "ipg", "per";
 			};
 
 			gpt2: timer at 10004000 {
 				compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
 				reg = <0x10004000 0x1000>;
 				interrupts = <25>;
+				clocks = <&clks 45>, <&clks 61>;
+				clock-names = "ipg", "per";
 			};
 
 			gpt3: timer at 10005000 {
 				compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
 				reg = <0x10005000 0x1000>;
 				interrupts = <24>;
+				clocks = <&clks 44>, <&clks 61>;
+				clock-names = "ipg", "per";
 			};
 
 			uart1: serial at 1000a000 {
@@ -210,12 +216,16 @@
 				compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
 				reg = <0x10019000 0x1000>;
 				interrupts = <4>;
+				clocks = <&clks 43>, <&clks 61>;
+				clock-names = "ipg", "per";
 			};
 
 			gpt5: timer at 1001a000 {
 				compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
 				reg = <0x1001a000 0x1000>;
 				interrupts = <3>;
+				clocks = <&clks 42>, <&clks 61>;
+				clock-names = "ipg", "per";
 			};
 
 			uart5: serial at 1001b000 {
@@ -245,6 +255,8 @@
 				compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
 				reg = <0x1001f000 0x1000>;
 				interrupts = <2>;
+				clocks = <&clks 41>, <&clks 61>;
+				clock-names = "ipg", "per";
 			};
 		};
 
Signature · 1 line
1.8.2.rc2
#11 lore raw

PATCH 1/1 i.MX: Add GPT devicetree nodes

In reply to Sascha Hauer
Quoted 6 lines · Sascha Hauer

The GPT is the general purpose timer found on i.MX SoCs. The bindings are used on i.MX25 and i.MX6 already. The remaining i.MX SoCs still use a platform based timer. This is a first step to change this: We add the devicetree nodes for the other DT enabled SoCs (i.MX27, i.MX31, i.MX51 and i.MX53).

Quoted 8 lines

This series also adds the missing binding documentation for the GPT.

The series is based on Shawns imx/dt branch.

The last patch adds the clocks to the i.MX27 GPT. This is not applicable right now since it depends on the patch changing i.MX27 to devicetree based clock lookups.

I just applied Fabio's clock lookup patch and the series to imx/dt branch.

Shawn