Skip to contentSkip to conversation

arm64: dts: rockchip: aliases for core busses in main dtsi

PATCH Applied Heiko Stuebner 1 participant 6 messages Dec 5, 2023 – Dec 6, 2023

Subsystems (2)
lore
Share & tools
lore

Heiko Stuebner

author maintainer
#0 lore raw

v2 cover arm64: dts: rockchip: aliases for core busses in main dtsi

Placement of aliases is cause for a lot of discussion :-). Most recently in [0]. And while devices such as mmc controllers do have names not following any numbers, this is different for the core busses/devices like serial, i2c, gpio, spi.

All of those start at number 0 and increment then. And all pieces of documentation like soc manuals, device schematics as well as pin-header descriptions for SBCs also use these numbers to identify the controller instance.

All previous Rockchip socs also carry those core busses in the main dtsi so that not every board needs to have the exact same aliases defined.

changes in v2:
- reword commit messages to make move vs define explicti (Diederik)
- add review from Dragan

[0] https://lore.kernel.org/all/4762834.KRxA6XjA2N@diego/

Heiko Stuebner (4):
arm64: dts: rockchip: move rk3588 serial aliases to soc dtsi
arm64: dts: rockchip: add rk3588 i2c aliases to soc dtsi
arm64: dts: rockchip: add rk3588 gpio aliases to soc dtsi
arm64: dts: rockchip: add rk3588 spi aliases to soc dtsi

 .../dts/rockchip/rk3588-edgeble-neu6a-io.dts  |  4 ---
 .../dts/rockchip/rk3588-edgeble-neu6b-io.dts  |  4 ---
 .../boot/dts/rockchip/rk3588-evb1-v10.dts     |  1 -
 .../boot/dts/rockchip/rk3588-nanopc-t6.dts    |  1 -
 .../dts/rockchip/rk3588-orangepi-5-plus.dts   |  1 -
 .../boot/dts/rockchip/rk3588-quartzpro64.dts  |  1 -
 .../boot/dts/rockchip/rk3588-rock-5b.dts      |  1 -
 .../boot/dts/rockchip/rk3588-turing-rk1.dtsi  |  2 --
 .../dts/rockchip/rk3588s-indiedroid-nova.dts  |  1 -
 .../dts/rockchip/rk3588s-khadas-edge2.dts     |  1 -
 .../boot/dts/rockchip/rk3588s-orangepi-5.dts  |  1 -
 .../boot/dts/rockchip/rk3588s-rock-5a.dts     |  1 -
 arch/arm64/boot/dts/rockchip/rk3588s.dtsi     | 32 +++++++++++++++++++
 13 files changed, 32 insertions(+), 19 deletions(-)
Signature · 7 lines
2.39.2


_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
author maintainer
#1 lore raw

PATCH v2 1/4 arm64: dts: rockchip: move rk3588 serial aliases to soc dtsi

From: Heiko Stuebner <[email protected]>

The serial ports on rk3588 are named uart0 - uart9. Board schematics also use these exact numbers and we want those names to also reflect in the OS devices because everything else would just cause confusion.

To prevent each board repeating their list of serial aliases, move them to the soc dtsi, as all previous Rockchip soc do already.

---
 .../boot/dts/rockchip/rk3588-edgeble-neu6a-io.dts   |  4 ----
 .../boot/dts/rockchip/rk3588-edgeble-neu6b-io.dts   |  4 ----
 arch/arm64/boot/dts/rockchip/rk3588-evb1-v10.dts    |  1 -
 arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts   |  1 -
 .../boot/dts/rockchip/rk3588-orangepi-5-plus.dts    |  1 -
 arch/arm64/boot/dts/rockchip/rk3588-quartzpro64.dts |  1 -
 arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts     |  1 -
 arch/arm64/boot/dts/rockchip/rk3588-turing-rk1.dtsi |  2 --
 .../boot/dts/rockchip/rk3588s-indiedroid-nova.dts   |  1 -
 .../boot/dts/rockchip/rk3588s-khadas-edge2.dts      |  1 -
 arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dts |  1 -
 arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts    |  1 -
 arch/arm64/boot/dts/rockchip/rk3588s.dtsi           | 13 +++++++++++++
 13 files changed, 13 insertions(+), 19 deletions(-)
arch/arm64/boot/dts/rockchip/rk3588-edgeble-neu6a-io.dts +0 -4
index b51543892078..be6a4f4f90f6 100644
@@ -12,10 +12,6 @@ / {
 	compatible = "edgeble,neural-compute-module-6a-io",
 		     "edgeble,neural-compute-module-6a", "rockchip,rk3588";
 
-	aliases {
-		serial2 = &uart2;
-	};
-
 	chosen {
 		stdout-path = "serial2:1500000n8";
 	};
arch/arm64/boot/dts/rockchip/rk3588-edgeble-neu6b-io.dts +0 -4
index 9933765e4097..96a18077f26f 100644
@@ -12,10 +12,6 @@ / {
 	compatible = "edgeble,neural-compute-module-6b-io",
 		     "edgeble,neural-compute-module-6b", "rockchip,rk3588";
 
-	aliases {
-		serial2 = &uart2;
-	};
-
 	chosen {
 		stdout-path = "serial2:1500000n8";
 	};
arch/arm64/boot/dts/rockchip/rk3588-evb1-v10.dts +0 -1
index b9d789d57862..a36d4fcd9b1d 100644
@@ -17,7 +17,6 @@ / {
 
 	aliases {
 		mmc0 = &sdhci;
-		serial2 = &uart2;
 	};
 
 	chosen {
arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts +0 -1
index 97af4f912828..612107615e66 100644
@@ -19,7 +19,6 @@ / {
 	aliases {
 		mmc0 = &sdhci;
 		mmc1 = &sdmmc;
-		serial2 = &uart2;
 	};
 
 	chosen {
arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-plus.dts +0 -1
index 298c183d6f4f..3e660ff6cd5f 100644
@@ -19,7 +19,6 @@ / {
 	aliases {
 		mmc0 = &sdhci;
 		mmc1 = &sdmmc;
-		serial2 = &uart2;
 	};
 
 	chosen {
arch/arm64/boot/dts/rockchip/rk3588-quartzpro64.dts +0 -1
index 5c59f9571dce..c7cd57609bc2 100644
@@ -19,7 +19,6 @@ / {
 	aliases {
 		mmc0 = &sdhci;
 		mmc1 = &sdmmc;
-		serial2 = &uart2;
 	};
 
 	chosen {
arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts +0 -1
index 741f631db345..e302eeb6ce5a 100644
@@ -14,7 +14,6 @@ aliases {
 		mmc0 = &sdhci;
 		mmc1 = &sdmmc;
 		mmc2 = &sdio;
-		serial2 = &uart2;
 	};
 
 	chosen {
arch/arm64/boot/dts/rockchip/rk3588-turing-rk1.dtsi +0 -2
index 9570b34aca2e..25a0ca73a8f7 100644
@@ -19,8 +19,6 @@ / {
 	aliases {
 		ethernet0 = &gmac1;
 		mmc0 = &sdhci;
-		serial2 = &uart2;
-		serial9 = &uart9;
 	};
 
 	fan: pwm-fan {
arch/arm64/boot/dts/rockchip/rk3588s-indiedroid-nova.dts +0 -1
index 60f00ceb630e..dc677f29a9c7 100644
@@ -44,7 +44,6 @@ aliases {
 		mmc0 = &sdhci;
 		mmc1 = &sdmmc;
 		mmc2 = &sdio;
-		serial2 = &uart2;
 	};
 
 	chosen {
arch/arm64/boot/dts/rockchip/rk3588s-khadas-edge2.dts +0 -1
index 82478a452533..f53e993c785e 100644
@@ -12,7 +12,6 @@ / {
 
 	aliases {
 		mmc0 = &sdhci;
-		serial2 = &uart2;
 	};
 
 	chosen {
arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dts +0 -1
index 8f399c4317bd..52ec9cb38f57 100644
@@ -14,7 +14,6 @@ / {
 
 	aliases {
 		mmc0 = &sdmmc;
-		serial2 = &uart2;
 	};
 
 	chosen {
arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts +0 -1
index 8347adcbd003..73cf97062a09 100644
@@ -14,7 +14,6 @@ / {
 	aliases {
 		mmc0 = &sdhci;
 		mmc1 = &sdmmc;
-		serial2 = &uart2;
 	};
 
 	analog-sound {
arch/arm64/boot/dts/rockchip/rk3588s.dtsi +13 -0
index 8aa0499f9b03..d854536a44b8 100644
@@ -18,6 +18,19 @@ / {
 	#address-cells = <2>;
 	#size-cells = <2>;
 
+	aliases {
+		serial0 = &uart0;
+		serial1 = &uart1;
+		serial2 = &uart2;
+		serial3 = &uart3;
+		serial4 = &uart4;
+		serial5 = &uart5;
+		serial6 = &uart6;
+		serial7 = &uart7;
+		serial8 = &uart8;
+		serial9 = &uart9;
+	};
+
 	cpus {
 		#address-cells = <1>;
 		#size-cells = <0>;
Signature · 7 lines
2.39.2


_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
author maintainer
#2 lore raw

PATCH v2 2/4 arm64: dts: rockchip: add rk3588 i2c aliases to soc dtsi

In reply to Heiko Stuebner

From: Heiko Stuebner <[email protected]>

The i2c controllers on rk3588 are named i2c0 - i2c8. Board schematics also use these exact numbers and we want those names to also reflect in the OS devices because everything else would just cause confusion. Userspace i2c access is a thing afterall.

To prevent each board repeating their list of i2c aliases, define them in the soc dtsi, as all previous Rockchip soc do already.

---
 arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm64/boot/dts/rockchip/rk3588s.dtsi +9 -0
index d854536a44b8..47512c39e55a 100644
@@ -19,6 +19,15 @@ / {
 	#size-cells = <2>;
 
 	aliases {
+		i2c0 = &i2c0;
+		i2c1 = &i2c1;
+		i2c2 = &i2c2;
+		i2c3 = &i2c3;
+		i2c4 = &i2c4;
+		i2c5 = &i2c5;
+		i2c6 = &i2c6;
+		i2c7 = &i2c7;
+		i2c8 = &i2c8;
 		serial0 = &uart0;
 		serial1 = &uart1;
 		serial2 = &uart2;
Signature · 7 lines
2.39.2


_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
author maintainer
#3 lore raw

PATCH v2 3/4 arm64: dts: rockchip: add rk3588 gpio aliases to soc dtsi

In reply to Heiko Stuebner

From: Heiko Stuebner <[email protected]>

The gpio controllers on rk3588 are named gpio0 - gpio4. Board schematics also use these exact numbers and we want those names to also reflect in the OS devices because everything else would just cause confusion. Userspace gpio access is a thing afterall.

To prevent each board repeating their list of gpio aliases, define them in the soc dtsi, as previous Rockchip soc like the rk356x do already.

---
 arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm64/boot/dts/rockchip/rk3588s.dtsi +5 -0
index 47512c39e55a..a59407466746 100644
@@ -19,6 +19,11 @@ / {
 	#size-cells = <2>;
 
 	aliases {
+		gpio0 = &gpio0;
+		gpio1 = &gpio1;
+		gpio2 = &gpio2;
+		gpio3 = &gpio3;
+		gpio4 = &gpio4;
 		i2c0 = &i2c0;
 		i2c1 = &i2c1;
 		i2c2 = &i2c2;
Signature · 7 lines
2.39.2


_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
author maintainer
#4 lore raw

PATCH v2 4/4 arm64: dts: rockchip: add rk3588 spi aliases to soc dtsi

In reply to Heiko Stuebner

From: Heiko Stuebner <[email protected]>

The spi controllers on rk3588 are named spi0 - spi4. Board schematics also use these exact numbers and we want those names to also reflect in the OS devices because everything else would just cause confusion. Userspace spi access is a thing afterall.

To prevent each board repeating their list of spi aliases, define them in the soc dtsi, as previous Rockchip soc like the rk356x do already.

---
 arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm64/boot/dts/rockchip/rk3588s.dtsi +5 -0
index a59407466746..7863aded672b 100644
@@ -43,6 +43,11 @@ aliases {
 		serial7 = &uart7;
 		serial8 = &uart8;
 		serial9 = &uart9;
+		spi0 = &spi0;
+		spi1 = &spi1;
+		spi2 = &spi2;
+		spi3 = &spi3;
+		spi4 = &spi4;
 	};
 
 	cpus {
Signature · 7 lines
2.39.2


_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
author maintainer Applied
#5 lore raw
In reply to Heiko Stuebner
Quoted 11 lines · Heiko Stuebner

Placement of aliases is cause for a lot of discussion :-). Most recently in [0]. And while devices such as mmc controllers do have names not following any numbers, this is different for the core busses/devices like serial, i2c, gpio, spi.

All of those start at number 0 and increment then. And all pieces of documentation like soc manuals, device schematics as well as pin-header descriptions for SBCs also use these numbers to identify the controller instance.

[...]

Applied, thanks!

[1/4] arm64: dts: rockchip: move rk3588 serial aliases to soc dtsi

      commit: 0aab62502c372e8c1fc83e4b44ed6c0b29a1e10b
[2/4] arm64: dts: rockchip: add rk3588 i2c aliases to soc dtsi
      commit: 4660763f93e089468457fe0c5396301511ec496f
[3/4] arm64: dts: rockchip: add rk3588 gpio aliases to soc dtsi
      commit: 092900cb2cac154f714aa7c24f30329ac3d5e255
[4/4] arm64: dts: rockchip: add rk3588 spi aliases to soc dtsi
      commit: ca1dcb7b914f50f18984628844b627b1226a4b01

Best regards,

Signature · 6 lines
Heiko Stuebner <[email protected]>

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip