From 901ca8213c419921c2c422d42a596a7b814e8132 Mon Sep 17 00:00:00 2001 From: Harshal Gohel Date: Tue, 7 Apr 2026 13:39:27 +0000 Subject: [PATCH] realtek: Fix pair-order for rtl930x based plasmacloud devices This change is needed as we move towards removing rtk init from bootloader and makes it possible to initialize and configure RTL8224 phy driver Signed-off-by: Harshal Gohel Link: https://github.com/openwrt/openwrt/pull/22826 Signed-off-by: Robert Marko --- target/linux/realtek/dts/macros.dtsi | 7 +++++++ .../realtek/dts/rtl9302_plasmacloud_common.dtsi | 16 ++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/target/linux/realtek/dts/macros.dtsi b/target/linux/realtek/dts/macros.dtsi index 3cfac36730..c601a5fc1c 100644 --- a/target/linux/realtek/dts/macros.dtsi +++ b/target/linux/realtek/dts/macros.dtsi @@ -25,6 +25,13 @@ compatible = "ethernet-phy-ieee802.3-c45"; \ }; +#define PHY_C45_PAIR_ORDER(p, n, po) \ + phy##p: ethernet-phy@n { \ + reg = <##n>; \ + compatible = "ethernet-phy-ieee802.3-c45"; \ + enet-phy-pair-order = <##po>; \ + }; + #define EXTERNAL_SFP_PHY(n) \ phy##n: ethernet-phy@##n { \ compatible = "ethernet-phy-ieee802.3-c22"; \ diff --git a/target/linux/realtek/dts/rtl9302_plasmacloud_common.dtsi b/target/linux/realtek/dts/rtl9302_plasmacloud_common.dtsi index 8ec411837b..bd3845fac3 100644 --- a/target/linux/realtek/dts/rtl9302_plasmacloud_common.dtsi +++ b/target/linux/realtek/dts/rtl9302_plasmacloud_common.dtsi @@ -134,14 +134,14 @@ }; &mdio_bus0 { - PHY_C45(0, 0) - PHY_C45(1, 1) - PHY_C45(2, 2) - PHY_C45(3, 3) - PHY_C45(8, 4) - PHY_C45(9, 5) - PHY_C45(10, 6) - PHY_C45(11, 7) + PHY_C45_PAIR_ORDER(0, 0, 0) + PHY_C45_PAIR_ORDER(1, 1, 0) + PHY_C45_PAIR_ORDER(2, 2, 1) + PHY_C45_PAIR_ORDER(3, 3, 1) + PHY_C45_PAIR_ORDER(8, 4, 0) + PHY_C45_PAIR_ORDER(9, 5, 0) + PHY_C45_PAIR_ORDER(10, 6, 1) + PHY_C45_PAIR_ORDER(11, 7, 1) }; &switch0 {