Skip to contentSkip to conversation

arm64: dts: allwinner: a64: pinmux cleanups

PATCH New Chen-Yu Tsai 2 participants 6 messages Aug 28, 2018 – Sep 3, 2018

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

cover arm64: dts: allwinner: a64: pinmux cleanups

Hi,

This series does some cleanup of the Allwinner A64 pinmux groups.

The first addresses a limitation on the A64 where we have the eMMC's DS in always muxed in. The DS pin is shared with SPI0's MISO, thereby preventing SPI0 from being used. In this patch we split out the DS pin into a separate group for boards that actually utilize it to select on their own.

The other two patches just rename pinmux group node names and labels from <func>_pins_<[a-z]> to <func>_<pingroup/pin names>_pins. The latter is the style we adopted later on, and is easier to know which pins they correspond to, i.e. easier to review.

Please have a look.

While I want to do some more cleanup, I realized that the label and/or node names might be used by distro (Armbian comes to mind) or personal device tree overlay files. Do we need to have these remain fixed? Do we or can we provide a fallback? (Is that even possible?)

Regards
ChenYu

Chen-Yu Tsai (3):
arm64: dts: allwinner: a64: Split out data strobe pin from mmc2 pinmux
arm64: dts: allwinner: a64: Rename uart0_pins_a label to uart0_pb_pins
arm64: dts: allwinner: a64: Rename r_i2c_pins_a label to

    r_i2c_pl89_pins
 .../boot/dts/allwinner/sun50i-a64-amarula-relic.dts |  2 +-
 .../boot/dts/allwinner/sun50i-a64-bananapi-m64.dts  |  4 ++--
 .../boot/dts/allwinner/sun50i-a64-nanopi-a64.dts    |  2 +-
 .../boot/dts/allwinner/sun50i-a64-olinuxino.dts     |  2 +-
 .../boot/dts/allwinner/sun50i-a64-orangepi-win.dts  |  2 +-
 arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts |  2 +-
 .../boot/dts/allwinner/sun50i-a64-pinebook.dts      |  6 +++---
 .../dts/allwinner/sun50i-a64-sopine-baseboard.dts   |  2 +-
 .../arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts |  2 +-
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi       | 13 ++++++++++---
 10 files changed, 22 insertions(+), 15 deletions(-)
Signature · 1 line
2.18.0
#1 lore raw

PATCH 1/3 arm64: dts: allwinner: a64: Split out data strobe pin from mmc2 pinmux

The eMMC 5.0 standard introduced the data strobe (DS) pin. This pin is not used for pre-5.0 data modes, nor is it found on pre-5.0 eMMC chips. On the A64, this pin is muxed with spi0's MISO pin. If the DS pin is included in the mmc2 pinmux by default, this wil prevent the usage of both mmc2 and spi0 together.

Instead, split out the DS pin to a separate pinmux that only gets used by boards that actually have it wired up. Currently supported ones include the Bananapi M64 and Pine64 Pinebook. These are fixed up.

Fixes a3e8f4926248 ("arm64: allwinner: a64: Add MMC pinctrl nodes")
Fixes b8bcf0e1b212 ("arm64: allwinner: add BananaPi-M64 support")
Fixes df35fbcfa398 ("arm64: dts: allwinner: add support for Pinebook")
---
 .../arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts | 2 +-
 arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts    | 2 +-
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi            | 9 ++++++++-
 3 files changed, 10 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts +1 -1
index 094cfed13df9..e643e453ec68 100644
@@ -151,7 +151,7 @@
 
 &mmc2 {
 	pinctrl-names = "default";
-	pinctrl-0 = <&mmc2_pins>;
+	pinctrl-0 = <&mmc2_pins>, <&mmc2_ds_pin>;
 	vmmc-supply = <&reg_dcdc1>;
 	bus-width = <8>;
 	non-removable;
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts +1 -1
index 4b8fe453bacd..73f14d7f915a 100644
@@ -103,7 +103,7 @@
 
 &mmc2 {
 	pinctrl-names = "default";
-	pinctrl-0 = <&mmc2_pins>;
+	pinctrl-0 = <&mmc2_pins>, <&mmc2_ds_pin>;
 	vmmc-supply = <&reg_dcdc1>;
 	vqmmc-supply = <&reg_eldo1>;
 	bus-width = <8>;
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +8 -1
index b73f9287c3f0..364b7a499f7c 100644
@@ -413,7 +413,7 @@
 			};
 
 			mmc2_pins: mmc2-pins {
-				pins = "PC1", "PC5", "PC6", "PC8", "PC9",
+				pins = "PC5", "PC6", "PC8", "PC9",
 				       "PC10","PC11", "PC12", "PC13",
 				       "PC14", "PC15", "PC16";
 				function = "mmc2";
@@ -421,6 +421,13 @@
 				bias-pull-up;
 			};
 
+			mmc2_ds_pin: mmc2-ds-pin {
+				pins = "PC1";
+				function = "mmc2";
+				drive-strength = <30>;
+				bias-pull-up;
+			};
+
 			pwm_pin: pwm_pin {
 				pins = "PD22";
 				function = "pwm";
Signature · 1 line
2.18.0
#2 lore raw

PATCH 2/3 arm64: dts: allwinner: a64: Rename uart0_pins_a label to uart0_pb_pins

In reply to Chen-Yu Tsai

The pinmux name and label for a specific function should denote which pingroup it is on, or if there is only one option for the function, have not enumerating prefix/suffix at all.

The "uart0_pins_a" label is renamed to "uart0_pb_pins" to fit our current style. The node name "uart0" is also changed to "uart0-pb-pins" to match.

---
 arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts    | 2 +-
 arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts     | 2 +-
 arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts       | 2 +-
 arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts        | 2 +-
 arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts     | 2 +-
 arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts           | 2 +-
 arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts         | 2 +-
 arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts | 2 +-
 arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts          | 2 +-
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi                 | 2 +-
 10 files changed, 10 insertions(+), 10 deletions(-)
arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts +1 -1
index eac4793c8502..6cb2b7f0c817 100644
@@ -203,7 +203,7 @@
 
 &uart0 {
 	pinctrl-names = "default";
-	pinctrl-0 = <&uart0_pins_a>;
+	pinctrl-0 = <&uart0_pb_pins>;
 	status = "okay";
 };
 
arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts +1 -1
index e643e453ec68..846c350decb4 100644
@@ -302,7 +302,7 @@
 
 &uart0 {
 	pinctrl-names = "default";
-	pinctrl-0 = <&uart0_pins_a>;
+	pinctrl-0 = <&uart0_pb_pins>;
 	status = "okay";
 };
 
arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +1 -1
index 0ee915d8eb24..a0ac1390270e 100644
@@ -252,7 +252,7 @@
 
 &uart0 {
 	pinctrl-names = "default";
-	pinctrl-0 = <&uart0_pins_a>;
+	pinctrl-0 = <&uart0_pb_pins>;
 	status = "okay";
 };
 
arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts +1 -1
index a1c2f06ed474..657f58def54c 100644
@@ -274,7 +274,7 @@
 
 &uart0 {
 	pinctrl-names = "default";
-	pinctrl-0 = <&uart0_pins_a>;
+	pinctrl-0 = <&uart0_pb_pins>;
 	status = "okay";
 };
 
arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +1 -1
index c879aa8d8d1b..dc9a8d77f693 100644
@@ -299,7 +299,7 @@
 /* On debug connector */
 &uart0 {
 	pinctrl-names = "default";
-	pinctrl-0 = <&uart0_pins_a>;
+	pinctrl-0 = <&uart0_pb_pins>;
 	status = "okay";
 };
 
arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts +1 -1
index 1b9b92e541d2..d3d5282b0ba8 100644
@@ -241,7 +241,7 @@
 /* On Exp and Euler connectors */
 &uart0 {
 	pinctrl-names = "default";
-	pinctrl-0 = <&uart0_pins_a>;
+	pinctrl-0 = <&uart0_pb_pins>;
 	status = "okay";
 };
 
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts +1 -1
index 73f14d7f915a..25683a7ac64f 100644
@@ -269,7 +269,7 @@
 
 &uart0 {
 	pinctrl-names = "default";
-	pinctrl-0 = <&uart0_pins_a>;
+	pinctrl-0 = <&uart0_pb_pins>;
 	status = "okay";
 };
 
arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts +1 -1
index c21f2331add6..beaa092976d7 100644
@@ -140,7 +140,7 @@
 
 &uart0 {
 	pinctrl-names = "default";
-	pinctrl-0 = <&uart0_pins_a>;
+	pinctrl-0 = <&uart0_pb_pins>;
 	status = "okay";
 };
 
arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts +1 -1
index 81f8e0098699..c455b24dd079 100644
@@ -260,7 +260,7 @@
 
 &uart0 {
 	pinctrl-names = "default";
-	pinctrl-0 = <&uart0_pins_a>;
+	pinctrl-0 = <&uart0_pb_pins>;
 	status = "okay";
 };
 
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +1 -1
index 364b7a499f7c..e3eda63230a6 100644
@@ -463,7 +463,7 @@
 				function = "spi1";
 			};
 
-			uart0_pins_a: uart0 {
+			uart0_pb_pins: uart0-pb-pins {
 				pins = "PB8", "PB9";
 				function = "uart0";
 			};
Signature · 1 line
2.18.0
#3 lore raw

PATCH 3/3 arm64: dts: allwinner: a64: Rename r_i2c_pins_a label to r_i2c_pl89_pins

In reply to Chen-Yu Tsai

The pinmux name and label for a specific function should denote which pingroup it is on, or if there is only one option for the function, have not enumerating prefix/suffix at all.

The "r_i2c_pins_a" label is renamed to "r_i2c_pl89_pins" to fit our current style. The node name "i2c" is also changed to "r-i2c-pl89-pins" to match. The reason for the peculiar name is that the other option for muxing R_I2C is on the PL0/PL1 pins, so the name has to mention the pin numbers in addition to the pingroup.

---
 arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts | 2 +-
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts +1 -1
index 25683a7ac64f..77fac84797e9 100644
@@ -142,7 +142,7 @@
 &r_i2c {
 	clock-frequency = <100000>;
 	pinctrl-names = "default";
-	pinctrl-0 = <&r_i2c_pins_a>;
+	pinctrl-0 = <&r_i2c_pl89_pins>;
 	status = "okay";
 };
 
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +1 -1
index e3eda63230a6..e4cfa8778623 100644
@@ -770,7 +770,7 @@
 			interrupt-controller;
 			#interrupt-cells = <3>;
 
-			r_i2c_pins_a: i2c-a {
+			r_i2c_pl89_pins: r-i2c-pl89-pins {
 				pins = "PL8", "PL9";
 				function = "s_i2c";
 			};
Signature · 1 line
2.18.0
#4 lore raw

cover arm64: dts: allwinner: a64: pinmux cleanups

In reply to Chen-Yu Tsai
Quoted 10 lines · Chen-Yu Tsai

Hi,

This series does some cleanup of the Allwinner A64 pinmux groups.

The first addresses a limitation on the A64 where we have the eMMC's DS in always muxed in. The DS pin is shared with SPI0's MISO, thereby preventing SPI0 from being used. In this patch we split out the DS pin into a separate group for boards that actually utilize it to select on their own.

Quoted 6 lines

The other two patches just rename pinmux group node names and labels from <func>_pins_<[a-z]> to <func>_<pingroup/pin names>_pins. The latter is the style we adopted later on, and is easier to know which pins they correspond to, i.e. easier to review.

Please have a look.

Quoted 4 lines

While I want to do some more cleanup, I realized that the label and/or node names might be used by distro (Armbian comes to mind) or personal device tree overlay files. Do we need to have these remain fixed? Do we or can we provide a fallback? (Is that even possible?)

I wouldn't worry too much about this. We broke it a number of times already, and we probably will in the future for other stuff, I'm not sure we have to provide any guarantee there, as long as the old, compiled, dt still works.

Maxime

Signature · 10 lines
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180828/cca1a80d/attachment.sig>
author Applied
#5 lore raw

cover arm64: dts: allwinner: a64: pinmux cleanups

Quoted 12 lines · Maxime Ripard
Quoted 10 lines · Chen-Yu Tsai

Hi,

This series does some cleanup of the Allwinner A64 pinmux groups.

The first addresses a limitation on the A64 where we have the eMMC's DS in always muxed in. The DS pin is shared with SPI0's MISO, thereby preventing SPI0 from being used. In this patch we split out the DS pin into a separate group for boards that actually utilize it to select on their own.

Quoted 8 lines
Quoted 6 lines

The other two patches just rename pinmux group node names and labels from <func>_pins_<[a-z]> to <func>_<pingroup/pin names>_pins. The latter is the style we adopted later on, and is easier to know which pins they correspond to, i.e. easier to review.

Please have a look.

Applied.

Quoted 9 lines
Quoted 4 lines

While I want to do some more cleanup, I realized that the label and/or node names might be used by distro (Armbian comes to mind) or personal device tree overlay files. Do we need to have these remain fixed? Do we or can we provide a fallback? (Is that even possible?)

I wouldn't worry too much about this. We broke it a number of times already, and we probably will in the future for other stuff, I'm not sure we have to provide any guarantee there, as long as the old, compiled, dt still works.

OK :)