Skip to contentSkip to conversation

ARM: dts: add gpio-ranges property to iMX GPIO controllers

PATCH Superseded Vladimir Zapolskiy 3 participants 5 messages Sep 9, 2016

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

PATCH v3 1/1 ARM: dts: add gpio-ranges property to iMX GPIO controllers

To establish a connection between GPIO controllers and pin multiplexor controller add gpio-ranges properties to all GPIO controllers found on iMX50, iMX6Q/D, iMX6DL/S, iMX6SL, iMX6SX, iMX6UL and iMX7D/S SoCs. The change was done after human parsing of output from

% gawk -n '{ sub(/.*__/, ""); if ($1 ~ "^GPIO") print $1, $2/4}' imxXX-pinfunc.h | sort -n

---
Changes from v2 to v3:
* squashed patches against particular SoCs into one single change
* removed empty lines preceding to the added gpio-ranges property

Changes from v1 to v2:
* in copy-pasted commit messages corrected SoC names

 arch/arm/boot/dts/imx50.dtsi  | 10 ++++++++
 arch/arm/boot/dts/imx6dl.dtsi | 53 +++++++++++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/imx6q.dtsi  | 37 ++++++++++++++++++++++++++++++
 arch/arm/boot/dts/imx6sl.dtsi | 47 ++++++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/imx6sx.dtsi |  7 ++++++
 arch/arm/boot/dts/imx6ul.dtsi |  6 +++++
 arch/arm/boot/dts/imx7s.dtsi  |  7 ++++++
 7 files changed, 167 insertions(+)
arch/arm/boot/dts/imx50.dtsi +10 -0
index e2457138311f..8fe8beeb68a4 100644
@@ -227,6 +227,7 @@
 				#gpio-cells = <2>;
 				interrupt-controller;
 				#interrupt-cells = <2>;
+				gpio-ranges = <&iomuxc 0 151 28>;
 			};
 
 			gpio2: gpio at 53f88000 {
@@ -237,6 +238,10 @@
 				#gpio-cells = <2>;
 				interrupt-controller;
 				#interrupt-cells = <2>;
+				gpio-ranges = <&iomuxc  0 75 8>, <&iomuxc 8 100 8>,
+					      <&iomuxc 16 83 1>, <&iomuxc 17 85 1>,
+					      <&iomuxc 18 87 1>, <&iomuxc 19 84 1>,
+					      <&iomuxc 20 88 1>, <&iomuxc 21 86 1>;
 			};
 
 			gpio3: gpio at 53f8c000 {
@@ -247,6 +252,7 @@
 				#gpio-cells = <2>;
 				interrupt-controller;
 				#interrupt-cells = <2>;
+				gpio-ranges = <&iomuxc 0 108 32>;
 			};
 
 			gpio4: gpio at 53f90000 {
@@ -257,6 +263,8 @@
 				#gpio-cells = <2>;
 				interrupt-controller;
 				#interrupt-cells = <2>;
+				gpio-ranges = <&iomuxc  0   8  8>, <&iomuxc 8 45 12>,
+					      <&iomuxc 20 140 11>;
 			};
 
 			wdog1: wdog at 53f98000 {
@@ -346,6 +354,7 @@
 				#gpio-cells = <2>;
 				interrupt-controller;
 				#interrupt-cells = <2>;
+				gpio-ranges = <&iomuxc 0 57 18>, <&iomuxc 18 89 11>;
 			};
 
 			gpio6: gpio at 53fe0000 {
@@ -356,6 +365,7 @@
 				#gpio-cells = <2>;
 				interrupt-controller;
 				#interrupt-cells = <2>;
+				gpio-ranges = <&iomuxc 0 27 18>, <&iomuxc 18 16 11>;
 			};
 
 			i2c3: i2c at 53fec000 {
arch/arm/boot/dts/imx6dl.dtsi +53 -0

59 lines not on this page · raw message

arch/arm/boot/dts/imx6q.dtsi +37 -0
index c30c8368cae0..e9a5d0b8c7b0 100644
@@ -209,6 +209,43 @@
 	};
 };
 
+&gpio1 {
+	gpio-ranges = <&iomuxc  0 136  2>, <&iomuxc  2 141 1>, <&iomuxc  3 139 1>,
+		      <&iomuxc  4 142  2>, <&iomuxc  6 140 1>, <&iomuxc  7 144 2>,
+		      <&iomuxc  9 138  1>, <&iomuxc 10 213 3>, <&iomuxc 13  20 1>,
+		      <&iomuxc 14  19  1>, <&iomuxc 15  21 1>, <&iomuxc 16 208 1>,
+		      <&iomuxc 17 207  1>, <&iomuxc 18 210 3>, <&iomuxc 21 209 1>,
+		      <&iomuxc 22 116 10>;
+};
+
+&gpio2 {
+	gpio-ranges = <&iomuxc  0 191 16>, <&iomuxc 16 55 14>, <&iomuxc 30 35 1>,
+		      <&iomuxc 31  44  1>;
+};
+
+&gpio3 {
+	gpio-ranges = <&iomuxc 0 69 16>, <&iomuxc 16 36 8>, <&iomuxc 24 45 8>;
+};
+
+&gpio4 {
+	gpio-ranges = <&iomuxc 5 149 1>, <&iomuxc 6 126 10>, <&iomuxc 16 87 16>;
+};
+
+&gpio5 {
+	gpio-ranges = <&iomuxc 0  85  1>, <&iomuxc  2  34  1>, <&iomuxc 4 53 1>,
+		      <&iomuxc 5 103 13>, <&iomuxc 18 150 14>;
+};
+
+&gpio6 {
+	gpio-ranges = <&iomuxc  0 164 6>, <&iomuxc  6  54 1>, <&iomuxc  7 181  5>,
+		      <&iomuxc 14 186 3>, <&iomuxc 17 170 2>, <&iomuxc 19  22 12>,
+		      <&iomuxc 31  86 1>;
+};
+
+&gpio7 {
+	gpio-ranges = <&iomuxc 0 172 9>, <&iomuxc 9 189 2>, <&iomuxc 11 146 3>;
+};
+
 &hdmi {
 	compatible = "fsl,imx6q-hdmi";
 
arch/arm/boot/dts/imx6sl.dtsi +47 -0

77 lines not on this page · raw message

arch/arm/boot/dts/imx6sx.dtsi +7 -0
index 2863c52be6f5..1b62fa378161 100644
@@ -438,6 +438,7 @@
 				#gpio-cells = <2>;
 				interrupt-controller;
 				#interrupt-cells = <2>;
+				gpio-ranges = <&iomuxc 0 5 26>;
 			};
 
 			gpio2: gpio at 020a0000 {
@@ -449,6 +450,7 @@
 				#gpio-cells = <2>;
 				interrupt-controller;
 				#interrupt-cells = <2>;
+				gpio-ranges = <&iomuxc 0 31 20>;
 			};
 
 			gpio3: gpio at 020a4000 {
@@ -460,6 +462,7 @@
 				#gpio-cells = <2>;
 				interrupt-controller;
 				#interrupt-cells = <2>;
+				gpio-ranges = <&iomuxc 0 51 29>;
 			};
 
 			gpio4: gpio at 020a8000 {
@@ -471,6 +474,7 @@
 				#gpio-cells = <2>;
 				interrupt-controller;
 				#interrupt-cells = <2>;
+				gpio-ranges = <&iomuxc 0 80 32>;
 			};
 
 			gpio5: gpio at 020ac000 {
@@ -482,6 +486,7 @@
 				#gpio-cells = <2>;
 				interrupt-controller;
 				#interrupt-cells = <2>;
+				gpio-ranges = <&iomuxc 0 112 24>;
 			};
 
 			gpio6: gpio at 020b0000 {
@@ -493,6 +498,7 @@
 				#gpio-cells = <2>;
 				interrupt-controller;
 				#interrupt-cells = <2>;
+				gpio-ranges = <&iomuxc 0 136 12>, <&iomuxc 12 158 11>;
 			};
 
 			gpio7: gpio at 020b4000 {
@@ -504,6 +510,7 @@
 				#gpio-cells = <2>;
 				interrupt-controller;
 				#interrupt-cells = <2>;
+				gpio-ranges = <&iomuxc 0 148 10>, <&iomuxc 10 169 2>;
 			};
 
 			kpp: kpp at 020b8000 {
arch/arm/boot/dts/imx6ul.dtsi +6 -0
index 33b95d78831a..84c8be1e129f 100644
@@ -411,6 +411,8 @@
 				#gpio-cells = <2>;
 				interrupt-controller;
 				#interrupt-cells = <2>;
+				gpio-ranges = <&iomuxc  0 23 10>, <&iomuxc 10 17 6>,
+					      <&iomuxc 16 33 16>;
 			};
 
 			gpio2: gpio at 020a0000 {
@@ -422,6 +424,7 @@
 				#gpio-cells = <2>;
 				interrupt-controller;
 				#interrupt-cells = <2>;
+				gpio-ranges = <&iomuxc 0 49 16>, <&iomuxc 16 111 6>;
 			};
 
 			gpio3: gpio at 020a4000 {
@@ -433,6 +436,7 @@
 				#gpio-cells = <2>;
 				interrupt-controller;
 				#interrupt-cells = <2>;
+				gpio-ranges = <&iomuxc 0 65 29>;
 			};
 
 			gpio4: gpio at 020a8000 {
@@ -444,6 +448,7 @@
 				#gpio-cells = <2>;
 				interrupt-controller;
 				#interrupt-cells = <2>;
+				gpio-ranges = <&iomuxc 0 94 17>, <&iomuxc 17 117 12>;
 			};
 
 			gpio5: gpio at 020ac000 {
@@ -455,6 +460,7 @@
 				#gpio-cells = <2>;
 				interrupt-controller;
 				#interrupt-cells = <2>;
+				gpio-ranges = <&iomuxc 0 7 10>, <&iomuxc 10 5 2>;
 			};
 
 			fec2: ethernet at 020b4000 {
arch/arm/boot/dts/imx7s.dtsi +7 -0
index 1e90bdbe3a6e..fb4f9440d6df 100644
@@ -325,6 +325,7 @@
 				#gpio-cells = <2>;
 				interrupt-controller;
 				#interrupt-cells = <2>;
+				gpio-ranges = <&iomuxc_lpsr 0 0 8>, <&iomuxc 8 5 8>;
 			};
 
 			gpio2: gpio at 30210000 {
@@ -336,6 +337,7 @@
 				#gpio-cells = <2>;
 				interrupt-controller;
 				#interrupt-cells = <2>;
+				gpio-ranges = <&iomuxc 0 13 32>;
 			};
 
 			gpio3: gpio at 30220000 {
@@ -347,6 +349,7 @@
 				#gpio-cells = <2>;
 				interrupt-controller;
 				#interrupt-cells = <2>;
+				gpio-ranges = <&iomuxc 0 45 29>;
 			};
 
 			gpio4: gpio at 30230000 {
@@ -358,6 +361,7 @@
 				#gpio-cells = <2>;
 				interrupt-controller;
 				#interrupt-cells = <2>;
+				gpio-ranges = <&iomuxc 0 74 24>;
 			};
 
 			gpio5: gpio at 30240000 {
@@ -369,6 +373,7 @@
 				#gpio-cells = <2>;
 				interrupt-controller;
 				#interrupt-cells = <2>;
+				gpio-ranges = <&iomuxc 0 98 18>;
 			};
 
 			gpio6: gpio at 30250000 {
@@ -380,6 +385,7 @@
 				#gpio-cells = <2>;
 				interrupt-controller;
 				#interrupt-cells = <2>;
+				gpio-ranges = <&iomuxc 0 116 23>;
 			};
 
 			gpio7: gpio at 30260000 {
@@ -391,6 +397,7 @@
 				#gpio-cells = <2>;
 				interrupt-controller;
 				#interrupt-cells = <2>;
+				gpio-ranges = <&iomuxc 0 139 16>;
 			};
 
 			wdog1: wdog at 30280000 {
Signature · 1 line
2.8.1
Applied
#1 lore raw

PATCH v3 1/1 ARM: dts: add gpio-ranges property to iMX GPIO controllers

Quoted 8 lines · Vladimir Zapolskiy

To establish a connection between GPIO controllers and pin multiplexor controller add gpio-ranges properties to all GPIO controllers found on iMX50, iMX6Q/D, iMX6DL/S, iMX6SL, iMX6SX, iMX6UL and iMX7D/S SoCs. The change was done after human parsing of output from

% gawk -n '{ sub(/.*__/, ""); if ($1 ~ "^GPIO") print $1, $2/4}' imxXX-pinfunc.h | sort -n

Applied, thanks.

#2 lore raw

PATCH v3 1/1 ARM: dts: add gpio-ranges property to iMX GPIO controllers

In reply to Vladimir Zapolskiy
Quoted 4 lines · Vladimir Zapolskiy

To establish a connection between GPIO controllers and pin multiplexor controller add gpio-ranges properties to all GPIO controllers found on iMX50, iMX6Q/D, iMX6DL/S, iMX6SL, iMX6SX, iMX6UL and iMX7D/S SoCs. The change was done after human parsing of output from

When looking at doing the same for i.MX35 there are a few pin pairs that are driven by the same GPIO, e.g.:

	$ grep GPIO3_9 imx35-pinfunc.h 
	#define MX35_PAD_CTS1__GPIO3_9					0x194 0x5d8 0x918 0x5 0x0
	#define MX35_PAD_FEC_COL__GPIO3_9				0x2ec 0x750 0x918 0x5 0x1

With this it's not possible to correctly add a gpio-ranges, right?

i.MX1, i.MX21, i.MX25, i.MX27 and i.MX53 could benefit from such a change though. i.MX35 and i.MX51 have duplicates.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#3 lore raw

PATCH v3 1/1 ARM: dts: add gpio-ranges property to iMX GPIO controllers

Hi Uwe,

Quoted 6 lines · Uwe Kleine-K?nig
Quoted 4 lines · Vladimir Zapolskiy

To establish a connection between GPIO controllers and pin multiplexor controller add gpio-ranges properties to all GPIO controllers found on iMX50, iMX6Q/D, iMX6DL/S, iMX6SL, iMX6SX, iMX6UL and iMX7D/S SoCs. The change was done after human parsing of output from

Quoted 8 lines

When looking at doing the same for i.MX35 there are a few pin pairs that are driven by the same GPIO, e.g.:

	$ grep GPIO3_9 imx35-pinfunc.h
	#define MX35_PAD_CTS1__GPIO3_9					0x194 0x5d8 0x918 0x5 0x0
	#define MX35_PAD_FEC_COL__GPIO3_9				0x2ec 0x750 0x918 0x5 0x1

With this it's not possible to correctly add a gpio-ranges, right?

this is an interesting exceptional case, I don't think that pinctrl and gpio subsystems are ready to handle it.

If both pads are muxed to the same GPIO, then I presume on output it behaves like a tee, but do you know what would be the input value, if one line is driven high and another one is low?

Quoted 3 lines

i.MX1, i.MX21, i.MX25, i.MX27 and i.MX53 could benefit from such a change though. i.MX35 and i.MX51 have duplicates.

I keep my hands off it, because I don't have any boards powered by these SoCs to be able to test the change. FWIW I hold one i.MX31 powered board from old times, but I see that i.MX31 has poor DTS support in general, there is no GPIO controller device node to add the property.

--
With best wishes,
Vladimir

#4 lore raw

PATCH v3 1/1 ARM: dts: add gpio-ranges property to iMX GPIO controllers

Quoted 16 lines · Vladimir Zapolskiy

Hi Uwe,

Quoted 13 lines · Uwe Kleine-K?nig
Quoted 4 lines · Vladimir Zapolskiy

To establish a connection between GPIO controllers and pin multiplexor controller add gpio-ranges properties to all GPIO controllers found on iMX50, iMX6Q/D, iMX6DL/S, iMX6SL, iMX6SX, iMX6UL and iMX7D/S SoCs. The change was done after human parsing of output from

When looking at doing the same for i.MX35 there are a few pin pairs that are driven by the same GPIO, e.g.:

	$ grep GPIO3_9 imx35-pinfunc.h
	#define MX35_PAD_CTS1__GPIO3_9					0x194 0x5d8 0x918 0x5 0x0
	#define MX35_PAD_FEC_COL__GPIO3_9				0x2ec 0x750 0x918 0x5 0x1
Quoted 8 lines
Quoted 1 line

With this it's not possible to correctly add a gpio-ranges, right?

this is an interesting exceptional case, I don't think that pinctrl and gpio subsystems are ready to handle it.

If both pads are muxed to the same GPIO, then I presume on output it behaves like a tee, but do you know what would be the input value, if one line is driven high and another one is low?

That depends on the setting of register IOMUXC_GPIO3_IPP_IND_G_IN_9_SELECT_INPUT at offset 0x918 (third value in the constants). If it's 0 (fifth value) the value at MX35_PAD_CTS1 is read, if it's 1 MX35_PAD_FEC_COL is used.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |