Skip to contentSkip to conversation

Cleanup DT description of NanoPC-T6

PATCH Applied Diederik de Haas 2 participants 9 messages Aug 28 – Sep 2

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

cover Cleanup DT description of NanoPC-T6

This series cleans up the DT description of NanoPC-T6 devices by
- Remove unneeded nodes
- Align pinctrl names with names used in the schematics
- Fix sorting of various nodes and their properties
- Fix an unneeded pull_up
- Switch to using I2S0_8CH_MCLKOUT_TO_IO for audio

Diederik de Haas (7):
arm64: dts: rockchip: Remove unneeded vcc_3v3_pcie20 on NanoPC-T6
arm64: dts: rockchip: Fix PCIe 2 pinctrl names and sorting on NanoPC-T6
arm64: dts: rockchip: Fix hym8563 pinctrl name and sorting on NanoPC-T6
arm64: dts: rockchip: Don't pull up rtc int pin on NanoPC-T6
arm64: dts: rockchip: Sort usb nodes on NanoPC-T6
arm64: dts: rockchip: Improve sound config on NanoPC-T6
arm64: dts: rockchip: Drop duplicate USB nodes on NanoPC-T6 LTS

 .../dts/rockchip/rk3588-nanopc-t6-lts.dts     |  17 --
 .../boot/dts/rockchip/rk3588-nanopc-t6.dtsi   | 165 ++++++++----------
 2 files changed, 69 insertions(+), 113 deletions(-)
Signature · 1 line
2.55.0
#1 lore raw

PATCH 1/7 arm64: dts: rockchip: Remove unneeded vcc_3v3_pcie20 on NanoPC-T6

The ``vcc_3v3_pcie20`` regulator, identified in the schematic with ``VDD3V3_25GLAN[_B]`` is only separated from ``VCC_3V3_S3`` with a ferrite bead. So there's no need to define a separate regulator for that.

---
 arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dtsi | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)
arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dtsi +2 -12
index cfdb5c13f860..fc49b927ef73 100644
@@ -167,16 +167,6 @@ vcc_1v1_nldo_s3: regulator-vcc-1v1-nldo-s3 {
 		vin-supply = <&vcc4v0_sys>;
 	};
 
-	vcc_3v3_pcie20: regulator-vcc3v3-pcie20 {
-		compatible = "regulator-fixed";
-		regulator-name = "vcc_3v3_pcie20";
-		regulator-always-on;
-		regulator-boot-on;
-		regulator-min-microvolt = <3300000>;
-		regulator-max-microvolt = <3300000>;
-		vin-supply = <&vcc_3v3_s3>;
-	};
-
 	vbus5v0_typec: regulator-vbus5v0-typec {
 		compatible = "regulator-fixed";
 		enable-active-high;
@@ -640,7 +630,7 @@ map1 {
 
 &pcie2x1l0 {
 	reset-gpios = <&gpio4 RK_PB3 GPIO_ACTIVE_HIGH>;
-	vpcie3v3-supply = <&vcc_3v3_pcie20>;
+	vpcie3v3-supply = <&vcc_3v3_s3>;
 	pinctrl-names = "default";
 	pinctrl-0 = <&pcie2_0_rst>;
 	status = "okay";
@@ -656,7 +646,7 @@ &pcie2x1l1 {
 
 &pcie2x1l2 {
 	reset-gpios = <&gpio4 RK_PA4 GPIO_ACTIVE_HIGH>;
-	vpcie3v3-supply = <&vcc_3v3_pcie20>;
+	vpcie3v3-supply = <&vcc_3v3_s3>;
 	pinctrl-names = "default";
 	pinctrl-0 = <&pcie2_2_rst>;
 	status = "okay";
Signature · 1 line
2.55.0
#2 lore raw

PATCH 2/7 arm64: dts: rockchip: Fix PCIe 2 pinctrl names and sorting on NanoPC-T6

In reply to Diederik de Haas

Use the pinctrl names as used in the schematics and use natural sort order by property names for the PCIe 2 nodes.

---
 .../boot/dts/rockchip/rk3588-nanopc-t6.dtsi   | 36 +++++++++----------
 1 file changed, 18 insertions(+), 18 deletions(-)
arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dtsi +18 -18
index fc49b927ef73..16c35250bacf 100644
@@ -195,8 +195,8 @@ vdd_mpcie_3v3: regulator-vdd-mpcie-3v3 {
 		compatible = "regulator-fixed";
 		enable-active-high;
 		gpio = <&gpio4 RK_PC2 GPIO_ACTIVE_HIGH>;
+		pinctrl-0 = <&pcie_m2_1_pwren_pin>;
 		pinctrl-names = "default";
-		pinctrl-0 = <&pcie_m2_1_pwren>;
 		regulator-name = "vdd_mpcie_3v3";
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
@@ -207,8 +207,8 @@ vcc3v3_pcie_m2_0: regulator-vcc3v3-pcie-m2-0 {
 		compatible = "regulator-fixed";
 		enable-active-high;
 		gpios = <&gpio2 RK_PC5 GPIO_ACTIVE_HIGH>;
+		pinctrl-0 = <&pcie_m2_0_pwren_pin>;
 		pinctrl-names = "default";
-		pinctrl-0 = <&pcie_m2_0_pwren>;
 		regulator-name = "vcc3v3_pcie_m2_0";
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
@@ -629,26 +629,26 @@ map1 {
 };
 
 &pcie2x1l0 {
+	pinctrl-0 = <&pcie_25glan_perstb_b_pin>;
+	pinctrl-names = "default";
 	reset-gpios = <&gpio4 RK_PB3 GPIO_ACTIVE_HIGH>;
 	vpcie3v3-supply = <&vcc_3v3_s3>;
-	pinctrl-names = "default";
-	pinctrl-0 = <&pcie2_0_rst>;
 	status = "okay";
 };
 
 &pcie2x1l1 {
+	pinctrl-0 = <&pcie_wifi_perstn_pin>;
+	pinctrl-names = "default";
 	reset-gpios = <&gpio4 RK_PA2 GPIO_ACTIVE_HIGH>;
 	vpcie3v3-supply = <&vdd_mpcie_3v3>;
-	pinctrl-names = "default";
-	pinctrl-0 = <&pcie2_1_rst>;
 	status = "okay";
 };
 
 &pcie2x1l2 {
+	pinctrl-0 = <&pcie_25glan_perstb_pin>;
+	pinctrl-names = "default";
 	reset-gpios = <&gpio4 RK_PA4 GPIO_ACTIVE_HIGH>;
 	vpcie3v3-supply = <&vcc_3v3_s3>;
-	pinctrl-names = "default";
-	pinctrl-0 = <&pcie2_2_rst>;
 	status = "okay";
 };
 
@@ -716,25 +716,25 @@ ir_receiver_pin: ir-receiver-pin {
 	};
 
 	pcie {
-		pcie2_0_rst: pcie2-0-rst {
-			rockchip,pins = <4 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
-		};
-
-		pcie2_1_rst: pcie2-1-rst {
-			rockchip,pins = <4 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
+		pcie_25glan_perstb_pin: pcie-25glan-perstb-pin {
+			rockchip,pins = <4 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
 		};
 
-		pcie2_2_rst: pcie2-2-rst {
-			rockchip,pins = <4 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
+		pcie_25glan_perstb_b_pin: pcie-25glan-perstb-b-pin {
+			rockchip,pins = <4 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
 		};
 
-		pcie_m2_0_pwren: pcie-m20-pwren {
+		pcie_m2_0_pwren_pin: pcie-m2-0-pwren-pin {
 			rockchip,pins = <2 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
 		};
 
-		pcie_m2_1_pwren: pcie-m21-pwren {
+		pcie_m2_1_pwren_pin: pcie-m2-1-pwren-pin {
 			rockchip,pins = <4 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
 		};
+
+		pcie_wifi_perstn_pin: pcie-wifi-perstn-pin {
+			rockchip,pins = <4 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
 	};
 
 	usb {
Signature · 1 line
2.55.0
#3 lore raw

PATCH 3/7 arm64: dts: rockchip: Fix hym8563 pinctrl name and sorting on NanoPC-T6

In reply to Diederik de Haas

Use the pinctrl names as used in the schematics and use natural sort order by property names for the hym8563 RTC node.

---
 arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dtsi | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dtsi +3 -3
index 16c35250bacf..84bfb33a4774 100644
@@ -536,10 +536,10 @@ hym8563: rtc@51 {
 		reg = <0x51>;
 		#clock-cells = <0>;
 		clock-output-names = "hym8563";
-		pinctrl-names = "default";
-		pinctrl-0 = <&hym8563_int>;
 		interrupt-parent = <&gpio0>;
 		interrupts = <RK_PB0 IRQ_TYPE_LEVEL_LOW>;
+		pinctrl-0 = <&rtc_int_l_pin>;
+		pinctrl-names = "default";
 		wakeup-source;
 	};
 };
@@ -704,7 +704,7 @@ hp_det: hp-det {
 	};
 
 	hym8563 {
-		hym8563_int: hym8563-int {
+		rtc_int_l_pin: rtc-int-l-pin {
 			rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_up>;
 		};
 	};
Signature · 1 line
2.55.0
#4 lore raw

PATCH 4/7 arm64: dts: rockchip: Don't pull up rtc int pin on NanoPC-T6

In reply to Diederik de Haas

All NanoPC-T6 boards have a pull up resistor for the RTC pin, so there's no need for the SoC to pull it up.

---
 arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dtsi +1 -1
index 84bfb33a4774..2c9390d2968c 100644
@@ -705,7 +705,7 @@ hp_det: hp-det {
 
 	hym8563 {
 		rtc_int_l_pin: rtc-int-l-pin {
-			rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_up>;
+			rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
 		};
 	};
 
Signature · 1 line
2.55.0
#5 lore raw

PATCH 5/7 arm64: dts: rockchip: Sort usb nodes on NanoPC-T6

In reply to Diederik de Haas

Nodes shall be ordered alpha-numerically by the node name.

---
 .../boot/dts/rockchip/rk3588-nanopc-t6.dtsi   | 72 +++++++++----------
 1 file changed, 36 insertions(+), 36 deletions(-)
arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dtsi +36 -36
index 2c9390d2968c..e42b2a14fc82 100644
@@ -1164,12 +1164,6 @@ &tsadc {
 	status = "okay";
 };
 
-&uart2 {
-	pinctrl-0 = <&uart2m0_xfer>;
-	pinctrl-names = "default";
-	status = "okay";
-};
-
 &u2phy0 {
 	status = "okay";
 };
@@ -1186,15 +1180,11 @@ &u2phy1_otg {
 	status = "okay";
 };
 
-&u2phy2_host {
-	status = "okay";
-};
-
-&u2phy3_host {
+&u2phy2 {
 	status = "okay";
 };
 
-&u2phy2 {
+&u2phy2_host {
 	status = "okay";
 };
 
@@ -1202,31 +1192,13 @@ &u2phy3 {
 	status = "okay";
 };
 
-&usbdp_phy0 {
-	mode-switch;
-	orientation-switch;
-	sbu1-dc-gpios = <&gpio4 RK_PA6 GPIO_ACTIVE_HIGH>;
-	sbu2-dc-gpios = <&gpio4 RK_PA7 GPIO_ACTIVE_HIGH>;
+&u2phy3_host {
 	status = "okay";
-
-	port {
-		#address-cells = <1>;
-		#size-cells = <0>;
-
-		usbdp_phy0_typec_ss: endpoint@0 {
-			reg = <0>;
-			remote-endpoint = <&usbc0_ss>;
-		};
-
-		usbdp_phy0_typec_sbu: endpoint@1 {
-			reg = <1>;
-			remote-endpoint = <&usbc0_sbu>;
-		};
-	};
 };
 
-&usbdp_phy1 {
-	phy-supply = <&vbus5v0_usb>;
+&uart2 {
+	pinctrl-0 = <&uart2m0_xfer>;
+	pinctrl-names = "default";
 	status = "okay";
 };
 
@@ -1249,16 +1221,44 @@ usb_host0_xhci_drd_sw: endpoint {
 	};
 };
 
+&usb_host1_ehci {
+	status = "okay";
+};
+
+&usb_host1_ohci {
+	status = "okay";
+};
+
 &usb_host1_xhci {
 	dr_mode = "host";
 	status = "okay";
 };
 
-&usb_host1_ehci {
+&usbdp_phy0 {
+	mode-switch;
+	orientation-switch;
+	sbu1-dc-gpios = <&gpio4 RK_PA6 GPIO_ACTIVE_HIGH>;
+	sbu2-dc-gpios = <&gpio4 RK_PA7 GPIO_ACTIVE_HIGH>;
 	status = "okay";
+
+	port {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		usbdp_phy0_typec_ss: endpoint@0 {
+			reg = <0>;
+			remote-endpoint = <&usbc0_ss>;
+		};
+
+		usbdp_phy0_typec_sbu: endpoint@1 {
+			reg = <1>;
+			remote-endpoint = <&usbc0_sbu>;
+		};
+	};
 };
 
-&usb_host1_ohci {
+&usbdp_phy1 {
+	phy-supply = <&vbus5v0_usb>;
 	status = "okay";
 };
 
Signature · 1 line
2.55.0
#6 lore raw

PATCH 6/7 arm64: dts: rockchip: Improve sound config on NanoPC-T6

In reply to Diederik de Haas

The kernel can manage the I2S MCLK output gates since commit 02b9b0bb6269 ("clk: rockchip: rk3588: add GATE_GRF clocks for I2S MCLK output to IO") So switch to I2S0_8CH_MCLKOUT_TO_IO to do exactly that.

The audio ports are used in audio-graph-card, but simple-audio-card uses sound-dai phandles to establish the DAI links. So drop the pointless ports.

Add a label to the soundcard to be used by tools like alsamixer.

Sort the various properties according to the DTS coding standard.

---
 .../boot/dts/rockchip/rk3588-nanopc-t6.dtsi   | 35 +++++--------------
 1 file changed, 9 insertions(+), 26 deletions(-)
arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dtsi +9 -26
index e42b2a14fc82..eb0eb124c4cd 100644
@@ -100,14 +100,14 @@ fan: pwm-fan {
 
 	sound {
 		compatible = "simple-audio-card";
-		pinctrl-names = "default";
+		label = "Onboard Analog Realtek ALC5616";
 		pinctrl-0 = <&hp_det>;
+		pinctrl-names = "default";
 
-		simple-audio-card,name = "realtek,rt5616-codec";
 		simple-audio-card,format = "i2s";
-		simple-audio-card,mclk-fs = <256>;
-
 		simple-audio-card,hp-det-gpios = <&gpio1 RK_PC4 GPIO_ACTIVE_LOW>;
+		simple-audio-card,mclk-fs = <256>;
+		simple-audio-card,name = "realtek,rt5616-codec";
 
 		simple-audio-card,widgets =
 			"Headphone", "Headphones",
@@ -121,6 +121,7 @@ sound {
 		simple-audio-card,cpu {
 			sound-dai = <&i2s0_8ch>;
 		};
+
 		simple-audio-card,codec {
 			sound-dai = <&rt5616>;
 		};
@@ -551,17 +552,11 @@ &i2c7 {
 	rt5616: codec@1b {
 		compatible = "realtek,rt5616";
 		reg = <0x1b>;
-		clocks = <&cru I2S0_8CH_MCLKOUT>;
+		assigned-clocks = <&cru I2S0_8CH_MCLKOUT_TO_IO>;
+		assigned-clock-rates = <12288000>;
+		clocks = <&cru I2S0_8CH_MCLKOUT_TO_IO>;
 		clock-names = "mclk";
 		#sound-dai-cells = <0>;
-		assigned-clocks = <&cru I2S0_8CH_MCLKOUT>;
-		assigned-clock-rates = <12288000>;
-
-		port {
-			rt5616_p0_0: endpoint {
-				remote-endpoint = <&i2s0_8ch_p0_0>;
-			};
-		};
 	};
 
 	/* connected with MIPI-CSI1 */
@@ -573,21 +568,9 @@ &i2c8 {
 };
 
 &i2s0_8ch {
+	pinctrl-0 = <&i2s0_lrck &i2s0_mclk &i2s0_sclk &i2s0_sdi0 &i2s0_sdo0>;
 	pinctrl-names = "default";
-	pinctrl-0 = <&i2s0_lrck
-		     &i2s0_mclk
-		     &i2s0_sclk
-		     &i2s0_sdi0
-		     &i2s0_sdo0>;
 	status = "okay";
-
-	i2s0_8ch_p0: port {
-		i2s0_8ch_p0_0: endpoint {
-			dai-format = "i2s";
-			mclk-fs = <256>;
-			remote-endpoint = <&rt5616_p0_0>;
-		};
-	};
 };
 
 &i2s5_8ch {
Signature · 1 line
2.55.0
#7 lore raw

PATCH 7/7 arm64: dts: rockchip: Drop duplicate USB nodes on NanoPC-T6 LTS

In reply to Diederik de Haas

Several USB nodes were enabled/configured on the NanoPC-T6 LTS first. Then those same nodes were enabled/configured in the NanoPC-T6 dtsi file, but the ones in the LTS dts file were not removed, so do that now.

---
 .../boot/dts/rockchip/rk3588-nanopc-t6-lts.dts  | 17 -----------------
 1 file changed, 17 deletions(-)
arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6-lts.dts +0 -17
index ff855064be08..0ee67ee24f3c 100644
@@ -38,23 +38,6 @@ usb20_host_pwren: usb20-host-pwren {
 	};
 };
 
-&u2phy1 {
-	status = "okay";
-};
-
-&u2phy1_otg {
-	status = "okay";
-};
-
 &u2phy2_host {
 	phy-supply = <&vcc5v0_usb20_host>;
 };
-
-&usbdp_phy1 {
-	status = "okay";
-};
-
-&usb_host1_xhci {
-	dr_mode = "host";
-	status = "okay";
-};
Signature · 1 line
2.55.0
maintainer Applied
#8 lore raw
In reply to Diederik de Haas
Quoted 8 lines · Diederik de Haas

This series cleans up the DT description of NanoPC-T6 devices by
- Remove unneeded nodes
- Align pinctrl names with names used in the schematics
- Fix sorting of various nodes and their properties
- Fix an unneeded pull_up
- Switch to using I2S0_8CH_MCLKOUT_TO_IO for audio

[...]

Applied, thanks!

[1/7] arm64: dts: rockchip: Remove unneeded vcc_3v3_pcie20 on NanoPC-T6

      commit: 05956cc8d96b41cee78322d5fd96365e1755cfd5
[2/7] arm64: dts: rockchip: Fix PCIe 2 pinctrl names and sorting on NanoPC-T6
      commit: d10b733bec0bb2949beec3bbc3625a9909711602
[3/7] arm64: dts: rockchip: Fix hym8563 pinctrl name and sorting on NanoPC-T6
      commit: 21431b76fc0380bb60ec6792492fbdc282847120
[4/7] arm64: dts: rockchip: Don't pull up rtc int pin on NanoPC-T6
      commit: d936b4164c9fef5e3d5a12a4f260c7bd2413f83c
[5/7] arm64: dts: rockchip: Sort usb nodes on NanoPC-T6
      commit: 6c4aacc5956924fd38703b95df7d67a650fb2db9
[6/7] arm64: dts: rockchip: Improve sound config on NanoPC-T6
      commit: 7ac01d4ea7a2c0074d3c92da0272baa6c1591b66
[7/7] arm64: dts: rockchip: Drop duplicate USB nodes on NanoPC-T6 LTS
      commit: e4392d3f56f686082f62e27131f4ac233ee05ac7

Best regards,

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

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