[openwrt/openwrt] realtek: fix SFP ports on the dlink 10port switch

LEDE Commits lede-commits at lists.infradead.org
Wed Dec 2 04:44:18 EST 2020


blogic pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/9aabd934a98ca894dc178d875f6ca6ea14ce427d

commit 9aabd934a98ca894dc178d875f6ca6ea14ce427d
Author: John Crispin <john at phrozen.org>
AuthorDate: Wed Dec 2 10:41:19 2020 +0100

    realtek: fix SFP ports on the dlink 10port switch
    
    Signed-off-by: John Crispin <john at phrozen.org>
---
 target/linux/realtek/dts/rtl8382_d-link_dgs-1210-10p.dts |  4 ++--
 target/linux/realtek/dts/rtl838x.dtsi                    | 12 ++++++++++++
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-10p.dts b/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-10p.dts
index 9987316c21..05010ffc0d 100644
--- a/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-10p.dts
+++ b/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-10p.dts
@@ -132,8 +132,8 @@
 		SWITCH_PORT(13, 6, internal)
 		SWITCH_PORT(14, 7, internal)
 		SWITCH_PORT(15, 8, internal)
-		SWITCH_PORT(24, 9, internal)
-		SWITCH_PORT(26, 10, internal)
+		SWITCH_SFP_PORT(24, 9, rgmii-id)
+		SWITCH_SFP_PORT(26, 10, rgmii-id)
 
 		port at 28 {
 			ethernet = <&ethernet0>;
diff --git a/target/linux/realtek/dts/rtl838x.dtsi b/target/linux/realtek/dts/rtl838x.dtsi
index f48d759a10..15d518578b 100644
--- a/target/linux/realtek/dts/rtl838x.dtsi
+++ b/target/linux/realtek/dts/rtl838x.dtsi
@@ -35,6 +35,18 @@
 		phy-mode = #m ; \
 	};
 
+#define SWITCH_SFP_PORT(n, s, m) \
+	port@##n { \
+		reg = <##n>; \
+		label = SWITCH_PORT_LABEL(s) ; \
+		phy-handle = <&phy##n>; \
+		phy-mode = #m ; \
+		fixed-link { \
+			speed = <1000>; \
+			full-duplex; \
+		}; \
+	};
+
 / {
 	#address-cells = <1>;
 	#size-cells = <1>;



More information about the lede-commits mailing list