Linux-Rockchip Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v13 0/3] arm64: dts: rockchip: add RK3568 XPCS nodes and enable SGMII on Photonicat
@ 2026-11-23 16:57 Coia Prant
  2026-11-23 16:57 ` [PATCH v13 1/3] arm64: dts: rockchip: rk3568: add XPCS node Coia Prant
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Coia Prant @ 2026-11-23 16:57 UTC (permalink / raw)
  To: heiko
  Cc: robh, krzk+dt, conor+dt, devicetree, linux-arm-kernel,
	linux-rockchip, Coia Prant

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

Changes since v12:

- Move the XPCS reference clock from the SoC dtsi to the Photonicat
  board dts (Heiko).
- Set rockchip,sgmii-mac-sel = <0> now that the PHY binding has landed
  in linux-next.
  https://patchwork.kernel.org/series/1180426/

Previous version:
- https://lore.kernel.org/all/20261023053548.1595033-1-coiaprant@gmail.com/

The XPCS node is disabled by default and is only enabled on boards that
use SGMII.

dtbs_check passes with the current linux-next.
---
Coia Prant (3):
  arm64: dts: rockchip: rk3568: add XPCS node
  arm64: dts: rockchip: rk3568-photonicat: add RGMII PHY LEDs
  arm64: dts: rockchip: rk3568-photonicat: enable SGMII LAN port

 .../boot/dts/rockchip/rk3568-photonicat.dts   | 75 ++++++++++++++++++-
 arch/arm64/boot/dts/rockchip/rk3568.dtsi      |  9 +++
 2 files changed, 82 insertions(+), 2 deletions(-)

-- 
2.47.3


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v13 1/3] arm64: dts: rockchip: rk3568: add XPCS node
  2026-11-23 16:57 [PATCH v13 0/3] arm64: dts: rockchip: add RK3568 XPCS nodes and enable SGMII on Photonicat Coia Prant
@ 2026-11-23 16:57 ` Coia Prant
  2026-11-23 16:57 ` [PATCH v13 2/3] arm64: dts: rockchip: rk3568-photonicat: add RGMII PHY LEDs Coia Prant
  2026-11-23 16:57 ` [PATCH v13 3/3] arm64: dts: rockchip: rk3568-photonicat: enable SGMII LAN port Coia Prant
  2 siblings, 0 replies; 4+ messages in thread
From: Coia Prant @ 2026-11-23 16:57 UTC (permalink / raw)
  To: heiko
  Cc: robh, krzk+dt, conor+dt, devicetree, linux-arm-kernel,
	linux-rockchip, Coia Prant

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.

The XPCS node is disabled by default and must be enabled at the board
level when 1000BASE-X, SGMII, or QSGMII is in use.

The XPCS node requires a reference to the appropriate Naneng Combo PHY
through the phys property. The SoC dtsi intentionally omits this
property, as the SerDes connection is a board-level design choice and
different boards route XPCS to different Combo PHY instances. Although
dtbs_check only validates required properties for enabled nodes, boards
that enable XPCS must provide the corresponding phys reference.

Signed-off-by: Coia Prant <coiaprant@gmail.com>
---
 arch/arm64/boot/dts/rockchip/rk3568.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3568.dtsi b/arch/arm64/boot/dts/rockchip/rk3568.dtsi
index 2f42bf26fd9b..c8f846e5ad9b 100644
--- a/arch/arm64/boot/dts/rockchip/rk3568.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3568.dtsi
@@ -110,6 +110,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>;
-- 
2.47.3


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v13 2/3] arm64: dts: rockchip: rk3568-photonicat: add RGMII PHY LEDs
  2026-11-23 16:57 [PATCH v13 0/3] arm64: dts: rockchip: add RK3568 XPCS nodes and enable SGMII on Photonicat Coia Prant
  2026-11-23 16:57 ` [PATCH v13 1/3] arm64: dts: rockchip: rk3568: add XPCS node Coia Prant
@ 2026-11-23 16:57 ` Coia Prant
  2026-11-23 16:57 ` [PATCH v13 3/3] arm64: dts: rockchip: rk3568-photonicat: enable SGMII LAN port Coia Prant
  2 siblings, 0 replies; 4+ messages in thread
From: Coia Prant @ 2026-11-23 16:57 UTC (permalink / raw)
  To: heiko
  Cc: robh, krzk+dt, conor+dt, devicetree, linux-arm-kernel,
	linux-rockchip, 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.

Signed-off-by: Coia Prant <coiaprant@gmail.com>
---
 .../boot/dts/rockchip/rk3568-photonicat.dts   | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3568-photonicat.dts b/arch/arm64/boot/dts/rockchip/rk3568-photonicat.dts
index 983cf3d0a135..3cc05f08f429 100644
--- a/arch/arm64/boot/dts/rockchip/rk3568-photonicat.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3568-photonicat.dts
@@ -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"
@@ -391,6 +392,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";
+			};
+		};
 	};
 };
 
-- 
2.47.3


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v13 3/3] arm64: dts: rockchip: rk3568-photonicat: enable SGMII LAN port
  2026-11-23 16:57 [PATCH v13 0/3] arm64: dts: rockchip: add RK3568 XPCS nodes and enable SGMII on Photonicat Coia Prant
  2026-11-23 16:57 ` [PATCH v13 1/3] arm64: dts: rockchip: rk3568: add XPCS node Coia Prant
  2026-11-23 16:57 ` [PATCH v13 2/3] arm64: dts: rockchip: rk3568-photonicat: add RGMII PHY LEDs Coia Prant
@ 2026-11-23 16:57 ` Coia Prant
  2 siblings, 0 replies; 4+ messages in thread
From: Coia Prant @ 2026-11-23 16:57 UTC (permalink / raw)
  To: heiko
  Cc: robh, krzk+dt, conor+dt, devicetree, linux-arm-kernel,
	linux-rockchip, Coia Prant

The Ariaboard Photonicat connects a Motorcomm YT8521SC Gigabit Ethernet
PHY to GMAC0 through the RK3568 XPCS using an SGMII link. Enable the
required DT nodes to make this port operational.

The 125 MHz GMAC reference clock is generated internally by combphy2 and
is modelled as a board-level fixed-clock, since it is specific to this
board's SGMII wiring. Configure GMAC0 to use it as the RX/TX reference
clock.

Enable the XPCS node, route combphy2 to GMAC0 through
rockchip,sgmii-mac-sel, and reference combphy2 as the SerDes PHY.

Add the MDIO description for the YT8521SC PHY, including its reset GPIO
and LED configuration.

Signed-off-by: Coia Prant <coiaprant@gmail.com>
---
 .../boot/dts/rockchip/rk3568-photonicat.dts   | 55 ++++++++++++++++++-
 1 file changed, 53 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3568-photonicat.dts b/arch/arm64/boot/dts/rockchip/rk3568-photonicat.dts
index 3cc05f08f429..522778a36423 100644
--- a/arch/arm64/boot/dts/rockchip/rk3568-photonicat.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3568-photonicat.dts
@@ -41,6 +41,13 @@ chosen: chosen {
 		stdout-path = "serial2:1500000n8";
 	};
 
+	clk_gmac0_xpcs_mii: clock-xpcs-gmac0 {
+		compatible = "fixed-clock";
+		clock-frequency = <125000000>;
+		clock-output-names = "clk_gmac0_xpcs_mii";
+		#clock-cells = <0>;
+	};
+
 	hdmi_con: hdmi-con {
 		compatible = "hdmi-connector";
 		type = "a";
@@ -283,6 +290,7 @@ &combphy1 {
 };
 
 &combphy2 {
+	rockchip,sgmii-mac-sel = <0>;
 	status = "okay";
 };
 
@@ -302,9 +310,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 */
@@ -383,6 +400,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";
@@ -653,3 +699,8 @@ &xin32k {
 	pinctrl-names = "default";
 	pinctrl-0 = <&clk32k_out1>;
 };
+
+&xpcs {
+	phys = <&combphy2 PHY_TYPE_SGMII>;
+	status = "okay";
+};
-- 
2.47.3


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-23 16:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23 16:57 [PATCH v13 0/3] arm64: dts: rockchip: add RK3568 XPCS nodes and enable SGMII on Photonicat Coia Prant
2026-11-23 16:57 ` [PATCH v13 1/3] arm64: dts: rockchip: rk3568: add XPCS node Coia Prant
2026-11-23 16:57 ` [PATCH v13 2/3] arm64: dts: rockchip: rk3568-photonicat: add RGMII PHY LEDs Coia Prant
2026-11-23 16:57 ` [PATCH v13 3/3] arm64: dts: rockchip: rk3568-photonicat: enable SGMII LAN port Coia Prant

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox