Skip to contentSkip to conversation

arm64: dts: rockchip: add RK3568 XPCS nodes and enable SGMII on Photonicat

PATCH In review Coia Prant 2 participants 7 messages Oct 23 – Nov 1

Subsystems (2)
lore
Share & tools
lore

Coia Prant

author
#0 lore raw

v12 cover arm64: dts: rockchip: add RK3568 XPCS nodes and enable SGMII on Photonicat

This series adds the RK3568 XPCS and fixed-clock nodes, describes the RGMII PHY LEDs on the Ariaboard Photonicat, and enables the SGMII LAN port on the same board.

Changes since v11:

- Drop max-speed = <1000> from the SGMII PHY node. SGMII is 1000Mbps-only, so the limit is redundant (Andrew).

Dependencies:
- XPCS binding and driver (rockchip,rk3568-xpcs, XPCS glue, dwmac-rk SGMII, pcs-handle binding): merged in net-next and present in linux-next.
https://git.kernel.org/netdev/net-next/c/5e91edfb0e45

- PHY binding+driver (rockchip,sgmii-mac-sel): still in review on linux-phy. Not required for this version to compile or pass dtbs_check; only needed for the follow-up that sets the property explicitly.

- Generic PM domain (genpd) changes: runtime-only, not a DTS dependency.

The XPCS node is disabled by default and only enabled on boards that use SGMII. The fixed-clock nodes are always present, as they are static clock sources.

dtbs_check passes with the current linux-next, since the XPCS binding is already merged.
---
Coia Prant (3):
arm64: dts: rockchip: rk3568: add XPCS and fixed-clock nodes
arm64: dts: rockchip: rk3568-photonicat: add RGMII PHY LEDs
arm64: dts: rockchip: rk3568-photonicat: enable SGMII LAN port

 .../boot/dts/rockchip/rk3568-photonicat.dts   | 67 ++++++++++++++++++-
 arch/arm64/boot/dts/rockchip/rk3568.dtsi      | 23 +++++++
 2 files changed, 88 insertions(+), 2 deletions(-)
Signature · 1 line
2.47.3
author
#1 lore raw

PATCH v12 1/3 arm64: dts: rockchip: rk3568: add XPCS and fixed-clock nodes

The RK3568 SoC integrates a Synopsys DesignWare XPCS that provides the Physical Coding Sublayer for 1000BASE-X, SGMII, and QSGMII interfaces via its four MII ports. Add the XPCS device node to the SoC device tree.

The XPCS device is accessed via the APB3 bus at 0xfda00000 and requires the CSR clock (PCLK_XPCS) for register access and the EEE clock (CLK_XPCS_EEE) for Energy Efficient Ethernet operation. The PD_PIPE power domain must be enabled before any register access.

Also add two fixed-clock nodes (clock-xpcs-gmac0 and clock-xpcs-gmac1, labelled clk_gmac0_xpcs_mii and clk_gmac1_xpcs_mii) providing the 125 MHz reference clock for the GMACs when operating with XPCS. Their clock-output-names match the CRU mux parent names in clk-rk3568.c, so boards can reparent SCLK_GMAC0_RX_TX / SCLK_GMAC1_RX_TX through assigned-clock-parents.

The XPCS node is disabled by default and must be enabled at the board level when 1000BASE-X/SGMII/QSGMII is in use. The fixed-clock nodes are always present and do not have a status property, as they are static clock sources.

The XPCS node requires a reference to the appropriate Naneng Combo PHY via the phys property. dtbs_check only validates required properties for enabled nodes, so the SoC dtsi does not provide phys: boards that enable the XPCS must supply it, since the SerDes link is a board-level design choice (combphy1 on some boards, combphy2 on others).

---
 arch/arm64/boot/dts/rockchip/rk3568.dtsi | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
arch/arm64/boot/dts/rockchip/rk3568.dtsi +23 -0
index 3bc653f027f1f..20a72785adbc2 100644
@@ -8,6 +8,20 @@
 / {
 	compatible = "rockchip,rk3568";
 
+	clk_gmac0_xpcs_mii: clock-xpcs-gmac0 {
+		compatible = "fixed-clock";
+		clock-frequency = <125000000>;
+		clock-output-names = "clk_gmac0_xpcs_mii";
+		#clock-cells = <0>;
+	};
+
+	clk_gmac1_xpcs_mii: clock-xpcs-gmac1 {
+		compatible = "fixed-clock";
+		clock-frequency = <125000000>;
+		clock-output-names = "clk_gmac1_xpcs_mii";
+		#clock-cells = <0>;
+	};
+
 	cpu0_opp_table: opp-table-0 {
 		compatible = "operating-points-v2";
 		opp-shared;
@@ -110,6 +124,15 @@ sata0: sata@fc000000 {
 		status = "disabled";
 	};
 
+	xpcs: ethernet-pcs@fda00000 {
+		compatible = "rockchip,rk3568-xpcs";
+		reg = <0x0 0xfda00000 0x0 0x200000>;
+		clocks = <&cru PCLK_XPCS>, <&cru CLK_XPCS_EEE>;
+		clock-names = "csr", "eee";
+		power-domains = <&power RK3568_PD_PIPE>;
+		status = "disabled";
+	};
+
 	pipe_phy_grf0: syscon@fdc70000 {
 		compatible = "rockchip,rk3568-pipe-phy-grf", "syscon";
 		reg = <0x0 0xfdc70000 0x0 0x1000>;
Signature · 1 line
2.47.3
maintainer
#2 lore raw

Re: [PATCH v12 1/3] arm64: dts: rockchip: rk3568: add XPCS and fixed-clock nodes

Hi,

Am Freitag, 23. Oktober 2026, 07:35:46 Mitteleuropäische Normalzeit schrieb Coia Prant:

Quoted 45 lines

The RK3568 SoC integrates a Synopsys DesignWare XPCS that provides the Physical Coding Sublayer for 1000BASE-X, SGMII, and QSGMII interfaces via its four MII ports. Add the XPCS device node to the SoC device tree.

The XPCS device is accessed via the APB3 bus at 0xfda00000 and requires the CSR clock (PCLK_XPCS) for register access and the EEE clock (CLK_XPCS_EEE) for Energy Efficient Ethernet operation. The PD_PIPE power domain must be enabled before any register access.

Also add two fixed-clock nodes (clock-xpcs-gmac0 and clock-xpcs-gmac1, labelled clk_gmac0_xpcs_mii and clk_gmac1_xpcs_mii) providing the 125 MHz reference clock for the GMACs when operating with XPCS. Their clock-output-names match the CRU mux parent names in clk-rk3568.c, so boards can reparent SCLK_GMAC0_RX_TX / SCLK_GMAC1_RX_TX through assigned-clock-parents.

The XPCS node is disabled by default and must be enabled at the board level when 1000BASE-X/SGMII/QSGMII is in use. The fixed-clock nodes are always present and do not have a status property, as they are static clock sources.

The XPCS node requires a reference to the appropriate Naneng Combo PHY via the phys property. dtbs_check only validates required properties for enabled nodes, so the SoC dtsi does not provide phys: boards that enable the XPCS must supply it, since the SerDes link is a board-level design choice (combphy1 on some boards, combphy2 on others).

---
 arch/arm64/boot/dts/rockchip/rk3568.dtsi | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
arch/arm64/boot/dts/rockchip/rk3568.dtsi +4 -0
index 3bc653f027f1f..20a72785adbc2 100644
@@ -8,6 +8,20 @@
 / {
 	compatible = "rockchip,rk3568";
 
+	clk_gmac0_xpcs_mii: clock-xpcs-gmac0 {
+		compatible = "fixed-clock";
+		clock-frequency = <125000000>;
+		clock-output-names = "clk_gmac0_xpcs_mii";

arch/arm64/boot/dts/rockchip/rk3568.dtsi line 24

Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk3568.dtsi +10 -0
+		#clock-cells = <0>;
+	};
+
+	clk_gmac1_xpcs_mii: clock-xpcs-gmac1 {
+		compatible = "fixed-clock";
+		clock-frequency = <125000000>;
+		clock-output-names = "clk_gmac1_xpcs_mii";
+		#clock-cells = <0>;
+	};
+

these clocks don't belong here.

When you place these nodes in the main, they seem to come out of thin air, while that might be true for some boards, that they have dedicated oscillators for that, this will likely not be true for all.

So these should be defined in the board dts, to match the actual hardware.

Heiko

author
#3 lore raw

Re: [PATCH v12 1/3] arm64: dts: rockchip: rk3568: add XPCS and fixed-clock nodes

Quoted 67 lines · Heiko Stuebner <[email protected]> 于2026年11月1日周日 22:06写道:

Hi,

Am Freitag, 23. Oktober 2026, 07:35:46 Mitteleuropäische Normalzeit schrieb Coia Prant:

Quoted 45 lines

The RK3568 SoC integrates a Synopsys DesignWare XPCS that provides the Physical Coding Sublayer for 1000BASE-X, SGMII, and QSGMII interfaces via its four MII ports. Add the XPCS device node to the SoC device tree.

The XPCS device is accessed via the APB3 bus at 0xfda00000 and requires the CSR clock (PCLK_XPCS) for register access and the EEE clock (CLK_XPCS_EEE) for Energy Efficient Ethernet operation. The PD_PIPE power domain must be enabled before any register access.

Also add two fixed-clock nodes (clock-xpcs-gmac0 and clock-xpcs-gmac1, labelled clk_gmac0_xpcs_mii and clk_gmac1_xpcs_mii) providing the 125 MHz reference clock for the GMACs when operating with XPCS. Their clock-output-names match the CRU mux parent names in clk-rk3568.c, so boards can reparent SCLK_GMAC0_RX_TX / SCLK_GMAC1_RX_TX through assigned-clock-parents.

The XPCS node is disabled by default and must be enabled at the board level when 1000BASE-X/SGMII/QSGMII is in use. The fixed-clock nodes are always present and do not have a status property, as they are static clock sources.

The XPCS node requires a reference to the appropriate Naneng Combo PHY via the phys property. dtbs_check only validates required properties for enabled nodes, so the SoC dtsi does not provide phys: boards that enable the XPCS must supply it, since the SerDes link is a board-level design choice (combphy1 on some boards, combphy2 on others).

---
 arch/arm64/boot/dts/rockchip/rk3568.dtsi | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
arch/arm64/boot/dts/rockchip/rk3568.dtsi +4 -0
index 3bc653f027f1f..20a72785adbc2 100644
@@ -8,6 +8,20 @@
 / {
      compatible = "rockchip,rk3568";
 
+     clk_gmac0_xpcs_mii: clock-xpcs-gmac0 {
+             compatible = "fixed-clock";
+             clock-frequency = <125000000>;
+             clock-output-names = "clk_gmac0_xpcs_mii";

arch/arm64/boot/dts/rockchip/rk3568.dtsi line 24

Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk3568.dtsi +10 -0
+             #clock-cells = <0>;
+     };
+
+     clk_gmac1_xpcs_mii: clock-xpcs-gmac1 {
+             compatible = "fixed-clock";
+             clock-frequency = <125000000>;
+             clock-output-names = "clk_gmac1_xpcs_mii";
+             #clock-cells = <0>;
+     };
+

these clocks don't belong here.

When you place these nodes in the main, they seem to come out of thin air, while that might be true for some boards, that they have dedicated oscillators for that, this will likely not be true for all.

Quoted 6 lines

So these should be defined in the board dts, to match the actual hardware.

Heiko

Hi Heiko,

Okay, these are board-level clock sources, not something the SoC provides. Moving both fixed-clock nodes to the Photonicat DTS and leaving only the xpcs node in rk3568.dtsi.

I'll respin.

Coia

maintainer
#4 lore raw

Re: [PATCH v12 1/3] arm64: dts: rockchip: rk3568: add XPCS and fixed-clock nodes

Am Sonntag, 1. November 2026, 21:11:56 Mitteleuropäische Normalzeit schrieb Coia Prant:

Quoted 75 lines
Quoted 67 lines · Heiko Stuebner <[email protected]> 于2026年11月1日周日 22:06写道:

Hi,

Am Freitag, 23. Oktober 2026, 07:35:46 Mitteleuropäische Normalzeit schrieb Coia Prant:

Quoted 45 lines

The RK3568 SoC integrates a Synopsys DesignWare XPCS that provides the Physical Coding Sublayer for 1000BASE-X, SGMII, and QSGMII interfaces via its four MII ports. Add the XPCS device node to the SoC device tree.

The XPCS device is accessed via the APB3 bus at 0xfda00000 and requires the CSR clock (PCLK_XPCS) for register access and the EEE clock (CLK_XPCS_EEE) for Energy Efficient Ethernet operation. The PD_PIPE power domain must be enabled before any register access.

Also add two fixed-clock nodes (clock-xpcs-gmac0 and clock-xpcs-gmac1, labelled clk_gmac0_xpcs_mii and clk_gmac1_xpcs_mii) providing the 125 MHz reference clock for the GMACs when operating with XPCS. Their clock-output-names match the CRU mux parent names in clk-rk3568.c, so boards can reparent SCLK_GMAC0_RX_TX / SCLK_GMAC1_RX_TX through assigned-clock-parents.

The XPCS node is disabled by default and must be enabled at the board level when 1000BASE-X/SGMII/QSGMII is in use. The fixed-clock nodes are always present and do not have a status property, as they are static clock sources.

The XPCS node requires a reference to the appropriate Naneng Combo PHY via the phys property. dtbs_check only validates required properties for enabled nodes, so the SoC dtsi does not provide phys: boards that enable the XPCS must supply it, since the SerDes link is a board-level design choice (combphy1 on some boards, combphy2 on others).

---
 arch/arm64/boot/dts/rockchip/rk3568.dtsi | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
arch/arm64/boot/dts/rockchip/rk3568.dtsi +4 -0
index 3bc653f027f1f..20a72785adbc2 100644
@@ -8,6 +8,20 @@
 / {
      compatible = "rockchip,rk3568";
 
+     clk_gmac0_xpcs_mii: clock-xpcs-gmac0 {
+             compatible = "fixed-clock";
+             clock-frequency = <125000000>;
+             clock-output-names = "clk_gmac0_xpcs_mii";

arch/arm64/boot/dts/rockchip/rk3568.dtsi line 24

Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk3568.dtsi +10 -0
+             #clock-cells = <0>;
+     };
+
+     clk_gmac1_xpcs_mii: clock-xpcs-gmac1 {
+             compatible = "fixed-clock";
+             clock-frequency = <125000000>;
+             clock-output-names = "clk_gmac1_xpcs_mii";
+             #clock-cells = <0>;
+     };
+

these clocks don't belong here.

When you place these nodes in the main, they seem to come out of thin air, while that might be true for some boards, that they have dedicated oscillators for that, this will likely not be true for all.

Quoted 6 lines

So these should be defined in the board dts, to match the actual hardware.

Heiko

Quoted 7 lines

Hi Heiko,

Okay, these are board-level clock sources, not something the SoC provides. Moving both fixed-clock nodes to the Photonicat DTS and leaving only the xpcs node in rk3568.dtsi.

I'll respin.

please also at least describe in the commit message, where the board generates these clocks.

Thanks
Heiko

author
#5 lore raw

PATCH v12 2/3 arm64: dts: rockchip: rk3568-photonicat: add RGMII PHY LEDs

In reply to Coia Prant

The Motorcomm YT8521SC RGMII PHY on the Ariaboard Photonicat has two front-panel LEDs wired to it. Describe them in the device tree so that userspace can control and monitor them through the LED class.

Both LEDs use the "keep" default state, so the PHY's built-in LED behaviour is preserved until userspace overrides the trigger.

---
 .../boot/dts/rockchip/rk3568-photonicat.dts   | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)
arch/arm64/boot/dts/rockchip/rk3568-photonicat.dts +20 -0
index 58c1052ba8ef3..12ae9159bea87 100644
@@ -3,6 +3,7 @@
 /dts-v1/;
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
 #include <dt-bindings/pinctrl/rockchip.h>
 #include <dt-bindings/soc/rockchip,vop2.h>
 #include "rk3568.dtsi"
@@ -350,6 +351,25 @@ rgmii_phy: ethernet-phy@3 {
 		reset-gpios = <&gpio4 RK_PC0 GPIO_ACTIVE_LOW>;
 		rx-internal-delay-ps = <1500>;
 		tx-internal-delay-ps = <1500>;
+
+		leds {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			led@1 {
+				reg = <1>;
+				color = <LED_COLOR_ID_AMBER>;
+				function = LED_FUNCTION_WAN;
+				default-state = "keep";
+			};
+
+			led@2 {
+				reg = <2>;
+				color = <LED_COLOR_ID_GREEN>;
+				function = LED_FUNCTION_WAN;
+				default-state = "keep";
+			};
+		};
 	};
 };
 
Signature · 1 line
2.47.3
author
#6 lore raw

PATCH v12 3/3 arm64: dts: rockchip: rk3568-photonicat: enable SGMII LAN port

In reply to Coia Prant

The Ariaboard Photonicat has a Motorcomm YT8521SC Gigabit Ethernet PHY connected to GMAC0 via XPCS SGMII. Enable the necessary nodes to make this port functional.

Enable the xpcs node, referencing combphy2 as the SerDes PHY.

The rockchip,sgmii-mac-sel property on combphy2 is not set here. The property is tri-state: when absent, the driver leaves the routing unchanged. If the bootloader has already routed combphy2 SGMII to GMAC0, the link works without the explicit property. A follow-up will add rockchip,sgmii-mac-sel = <0> once the PHY binding lands in linux-next, removing the dependency on the bootloader default.

RK3568 has three Combo PHYs that can carry SGMII; which one is wired to the XPCS is a board-level choice, and Photonicat uses combphy2.

Add the mdio0 node with the YT8521SC PHY at address 3, including its reset GPIO and LED configuration.

---
 .../boot/dts/rockchip/rk3568-photonicat.dts   | 47 ++++++++++++++++++-
 1 file changed, 45 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/rockchip/rk3568-photonicat.dts +45 -2
index 12ae9159bea87..22cbfc95ff2ce 100644
@@ -261,9 +261,18 @@ &cpu3 {
 	cpu-supply = <&vdd_cpu>;
 };
 
-/* Motorcomm YT8521SC LAN port (require SGMII) */
+/* Motorcomm YT8521SC LAN port */
 &gmac0 {
-	status = "disabled";
+	assigned-clocks = <&cru SCLK_GMAC0_RX_TX>;
+	assigned-clock-parents = <&clk_gmac0_xpcs_mii>;
+	managed = "in-band-status";
+	pcs-handle = <&xpcs>;
+	phy-handle = <&sgmii_phy>;
+	phy-mode = "sgmii";
+	phy-supply = <&vcc_3v3>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&gmac0_miim>;
+	status = "okay";
 };
 
 /* Motorcomm YT8521SC WAN port */
@@ -342,6 +351,35 @@ &i2s0_8ch {
 	status = "okay";
 };
 
+&mdio0 {
+	sgmii_phy: ethernet-phy@3 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <0x3>;
+		reset-assert-us = <20000>;
+		reset-deassert-us = <100000>;
+		reset-gpios = <&gpio3 RK_PC6 GPIO_ACTIVE_LOW>;
+
+		leds {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			led@1 {
+				reg = <1>;
+				color = <LED_COLOR_ID_AMBER>;
+				function = LED_FUNCTION_LAN;
+				default-state = "keep";
+			};
+
+			led@2 {
+				reg = <2>;
+				color = <LED_COLOR_ID_GREEN>;
+				function = LED_FUNCTION_LAN;
+				default-state = "keep";
+			};
+		};
+	};
+};
+
 &mdio1 {
 	rgmii_phy: ethernet-phy@3 {
 		compatible = "ethernet-phy-ieee802.3-c22";
@@ -606,3 +644,8 @@ &xin32k {
 	pinctrl-names = "default";
 	pinctrl-0 = <&clk32k_out1>;
 };
+
+&xpcs {
+	phys = <&combphy2 PHY_TYPE_SGMII>;
+	status = "okay";
+};
Signature · 1 line
2.47.3