[openwrt/openwrt] realtek: add dts helper for internal phy with serdes

LEDE Commits lede-commits at lists.infradead.org
Sun Jun 22 07:37:38 PDT 2025


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/5703ca465cc1ac6ed354627a38b654dd68b9ec9e

commit 5703ca465cc1ac6ed354627a38b654dd68b9ec9e
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Tue May 20 03:37:10 2025 -0400

    realtek: add dts helper for internal phy with serdes
    
    Until now only the RTL930x devices make use of the following notation.
    
      phy8: ethernet-phy at 8 {
        compatible = "ethernet-phy-ieee802.3-c22";
        phy-is-integrated;
        reg = <8>;
        sds = <3>;
      };
    
    This indicates that the link is driven by a serdes directly without
    external phy. As the devices have multiple serdes it must be clarified
    what serdes is responsible for that port.
    
    Nevertheless all other devices have the same requirements. E.g. RTL838x
    usually drives port 24 from serdes 4 and port 26 from serdes 5. All this
    currently works because the driver has a lot of hardcoded port/serdes
    mapping.
    
    Make the situation better by adding dts helpers that can describe the
    topology as needed.
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/18851
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 target/linux/realtek/dts/rtl838x.dtsi |  8 ++++++++
 target/linux/realtek/dts/rtl839x.dtsi |  8 ++++++++
 target/linux/realtek/dts/rtl930x.dtsi |  8 ++++++++
 target/linux/realtek/dts/rtl931x.dtsi | 10 ++++++++++
 4 files changed, 34 insertions(+)

diff --git a/target/linux/realtek/dts/rtl838x.dtsi b/target/linux/realtek/dts/rtl838x.dtsi
index 8f44de8bdc..035ff029c9 100644
--- a/target/linux/realtek/dts/rtl838x.dtsi
+++ b/target/linux/realtek/dts/rtl838x.dtsi
@@ -16,6 +16,14 @@
 		phy-is-integrated; \
 	};
 
+#define INTERNAL_PHY_SDS(n, s) \
+	phy##n: ethernet-phy@##n { \
+		reg = <##n>; \
+		compatible = "ethernet-phy-ieee802.3-c22"; \
+		phy-is-integrated; \
+		sds = <##s>; \
+	};
+
 #define EXTERNAL_PHY(n) \
 	phy##n: ethernet-phy@##n { \
 		reg = <##n>; \
diff --git a/target/linux/realtek/dts/rtl839x.dtsi b/target/linux/realtek/dts/rtl839x.dtsi
index 98c69a5d34..29458269fa 100644
--- a/target/linux/realtek/dts/rtl839x.dtsi
+++ b/target/linux/realtek/dts/rtl839x.dtsi
@@ -15,6 +15,14 @@
 		phy-is-integrated; \
 	};
 
+#define INTERNAL_PHY_SDS(n, s) \
+	phy##n: ethernet-phy@##n { \
+		reg = <##n>; \
+		compatible = "ethernet-phy-ieee802.3-c22"; \
+		phy-is-integrated; \
+		sds = <##s>; \
+	};
+
 #define EXTERNAL_PHY(n) \
 	phy##n: ethernet-phy@##n { \
 		reg = <##n>; \
diff --git a/target/linux/realtek/dts/rtl930x.dtsi b/target/linux/realtek/dts/rtl930x.dtsi
index 34d1ede54c..947f0d9be5 100644
--- a/target/linux/realtek/dts/rtl930x.dtsi
+++ b/target/linux/realtek/dts/rtl930x.dtsi
@@ -2,6 +2,14 @@
 
 /dts-v1/;
 
+#define INTERNAL_PHY_SDS(n, s) \
+	phy##n: ethernet-phy@##n { \
+		reg = <##n>; \
+		compatible = "ethernet-phy-ieee802.3-c22"; \
+		phy-is-integrated; \
+		sds = <##s>; \
+	};
+
 / {
 	#address-cells = <1>;
 	#size-cells = <1>;
diff --git a/target/linux/realtek/dts/rtl931x.dtsi b/target/linux/realtek/dts/rtl931x.dtsi
index 7ecfd2a0c6..c7feef4724 100644
--- a/target/linux/realtek/dts/rtl931x.dtsi
+++ b/target/linux/realtek/dts/rtl931x.dtsi
@@ -2,6 +2,16 @@
 
 #include <dt-bindings/interrupt-controller/mips-gic.h>
 
+/dts-v1/;
+
+#define INTERNAL_PHY_SDS(n, s) \
+	phy##n: ethernet-phy@##n { \
+		reg = <##n>; \
+		compatible = "ethernet-phy-ieee802.3-c22"; \
+		phy-is-integrated; \
+		sds = <##s>; \
+	};
+
 / {
 	#address-cells = <1>;
 	#size-cells = <1>;




More information about the lede-commits mailing list