From 7e39a2d4857b0f001c78740b6bd72d8221f06566 Mon Sep 17 00:00:00 2001 From: Markus Stockhausen Date: Mon, 12 Jan 2026 17:56:31 +0100 Subject: [PATCH] realtek: mdio: derive phy smi-bus from parent node The dts for RTL93xx devices has duplicate data about the smi bus of a phy node. The parent node declares the number of the bus and the realtek,smi-address attribute does the same. Remove the bus part from the realtek,smi-address attribute and lookup the bus from the parent node. While we are here remove all realtek,smi-address attributes where phy id matches the bus address. The driver will use that as a fallback. Signed-off-by: Markus Stockhausen Link: https://github.com/openwrt/openwrt/pull/21438 Signed-off-by: Hauke Mehrtens --- .../realtek/dts/rtl9301_linksys_lgs328c.dts | 24 ------- .../dts/rtl9302_plasmacloud_common.dtsi | 12 ++-- .../realtek/dts/rtl9302_plasmacloud_mcx3.dts | 2 - .../dts/rtl9302_zyxel_xgs1010-12-a1.dts | 4 +- .../dts/rtl9302_zyxel_xgs1210-12-a1.dts | 4 +- .../dts/rtl9302_zyxel_xgs1210-12-b1.dts | 4 +- .../dts/rtl9302_zyxel_xgs1250-12-a1.dts | 6 +- .../dts/rtl9302_zyxel_xgs1250-12-b1.dts | 6 +- .../dts/rtl9302_zyxel_xgs1250-12-common.dtsi | 8 --- .../dts/rtl9302_zyxel_xgs1x10-12-common.dtsi | 8 --- .../dts/rtl9303_hasivo_s1100w-8xgt-se.dts | 15 ++-- .../realtek/dts/rtl9311_linksys_lgs352c.dts | 72 +++++++------------ .../dts/rtl9312_plasmacloud_common.dtsi | 46 ++++++------ .../drivers/net/mdio/mdio-realtek-otto.c | 14 ++-- 14 files changed, 73 insertions(+), 152 deletions(-) diff --git a/target/linux/realtek/dts/rtl9301_linksys_lgs328c.dts b/target/linux/realtek/dts/rtl9301_linksys_lgs328c.dts index 462bf0b3fc5..6440616b52c 100644 --- a/target/linux/realtek/dts/rtl9301_linksys_lgs328c.dts +++ b/target/linux/realtek/dts/rtl9301_linksys_lgs328c.dts @@ -69,42 +69,34 @@ phy0: ethernet-phy@0 { reg = <0>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 0>; }; phy1: ethernet-phy@1 { reg = <1>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 1>; }; phy2: ethernet-phy@2 { reg = <2>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 2>; }; phy3: ethernet-phy@3 { reg = <3>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 3>; }; phy4: ethernet-phy@4 { reg = <4>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 4>; }; phy5: ethernet-phy@5 { reg = <5>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 5>; }; phy6: ethernet-phy@6 { reg = <6>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 6>; }; phy7: ethernet-phy@7 { reg = <7>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 7>; }; }; @@ -112,42 +104,34 @@ phy8: ethernet-phy@8 { reg = <8>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 8>; }; phy9: ethernet-phy@9 { reg = <9>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 9>; }; phy10: ethernet-phy@10 { reg = <10>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 10>; }; phy11: ethernet-phy@11 { reg = <11>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 11>; }; phy12: ethernet-phy@12 { reg = <12>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 12>; }; phy13: ethernet-phy@13 { reg = <13>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 13>; }; phy14: ethernet-phy@14 { reg = <14>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 14>; }; phy15: ethernet-phy@15 { reg = <15>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 15>; }; }; @@ -155,42 +139,34 @@ phy16: ethernet-phy@16 { reg = <16>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <2 16>; }; phy17: ethernet-phy@17 { reg = <17>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <2 17>; }; phy18: ethernet-phy@18 { reg = <18>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <2 18>; }; phy19: ethernet-phy@19 { reg = <19>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <2 19>; }; phy20: ethernet-phy@20 { reg = <20>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <2 20>; }; phy21: ethernet-phy@21 { reg = <21>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <2 21>; }; phy22: ethernet-phy@22 { reg = <22>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <2 22>; }; phy23: ethernet-phy@23 { reg = <23>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <2 23>; }; }; diff --git a/target/linux/realtek/dts/rtl9302_plasmacloud_common.dtsi b/target/linux/realtek/dts/rtl9302_plasmacloud_common.dtsi index 682e01a9bfe..afba3652671 100644 --- a/target/linux/realtek/dts/rtl9302_plasmacloud_common.dtsi +++ b/target/linux/realtek/dts/rtl9302_plasmacloud_common.dtsi @@ -138,49 +138,45 @@ phy0: ethernet-phy@0 { reg = <0>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <0 0>; }; phy1: ethernet-phy@1 { reg = <1>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <0 1>; }; phy2: ethernet-phy@2 { reg = <2>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <0 2>; }; phy3: ethernet-phy@3 { reg = <3>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <0 3>; }; phy8: ethernet-phy@8 { reg = <8>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <0 4>; + realtek,smi-address = <4>; }; phy9: ethernet-phy@9 { reg = <9>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <0 5>; + realtek,smi-address = <5>; }; phy10: ethernet-phy@10 { reg = <10>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <0 6>; + realtek,smi-address = <6>; }; phy11: ethernet-phy@11 { reg = <11>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <0 7>; + realtek,smi-address = <7>; }; }; diff --git a/target/linux/realtek/dts/rtl9302_plasmacloud_mcx3.dts b/target/linux/realtek/dts/rtl9302_plasmacloud_mcx3.dts index 2a68a2d6329..f9d55803255 100644 --- a/target/linux/realtek/dts/rtl9302_plasmacloud_mcx3.dts +++ b/target/linux/realtek/dts/rtl9302_plasmacloud_mcx3.dts @@ -155,13 +155,11 @@ phy0: ethernet-phy@0 { reg = <0>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <0 0>; }; phy1: ethernet-phy@1 { reg = <1>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <0 1>; }; }; diff --git a/target/linux/realtek/dts/rtl9302_zyxel_xgs1010-12-a1.dts b/target/linux/realtek/dts/rtl9302_zyxel_xgs1010-12-a1.dts index 7a7adbcfc4f..e0a308cdd74 100644 --- a/target/linux/realtek/dts/rtl9302_zyxel_xgs1010-12-a1.dts +++ b/target/linux/realtek/dts/rtl9302_zyxel_xgs1010-12-a1.dts @@ -104,9 +104,9 @@ }; &phy24 { - realtek,smi-address = <1 8>; + realtek,smi-address = <8>; }; &phy25 { - realtek,smi-address = <2 9>; + realtek,smi-address = <9>; }; diff --git a/target/linux/realtek/dts/rtl9302_zyxel_xgs1210-12-a1.dts b/target/linux/realtek/dts/rtl9302_zyxel_xgs1210-12-a1.dts index 5bdf6039e68..dc8e55b772e 100644 --- a/target/linux/realtek/dts/rtl9302_zyxel_xgs1210-12-a1.dts +++ b/target/linux/realtek/dts/rtl9302_zyxel_xgs1210-12-a1.dts @@ -9,9 +9,9 @@ }; &phy24 { - realtek,smi-address = <1 8>; + realtek,smi-address = <8>; }; &phy25 { - realtek,smi-address = <2 9>; + realtek,smi-address = <9>; }; diff --git a/target/linux/realtek/dts/rtl9302_zyxel_xgs1210-12-b1.dts b/target/linux/realtek/dts/rtl9302_zyxel_xgs1210-12-b1.dts index a0735a442a2..2a9eeda64a6 100644 --- a/target/linux/realtek/dts/rtl9302_zyxel_xgs1210-12-b1.dts +++ b/target/linux/realtek/dts/rtl9302_zyxel_xgs1210-12-b1.dts @@ -9,9 +9,9 @@ }; &phy24 { - realtek,smi-address = <1 1>; + realtek,smi-address = <1>; }; &phy25 { - realtek,smi-address = <2 2>; + realtek,smi-address = <2>; }; diff --git a/target/linux/realtek/dts/rtl9302_zyxel_xgs1250-12-a1.dts b/target/linux/realtek/dts/rtl9302_zyxel_xgs1250-12-a1.dts index decd007d1f0..7de9e072dbc 100644 --- a/target/linux/realtek/dts/rtl9302_zyxel_xgs1250-12-a1.dts +++ b/target/linux/realtek/dts/rtl9302_zyxel_xgs1250-12-a1.dts @@ -13,7 +13,7 @@ phy24: ethernet-phy@24 { reg = <24>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <1 8>; + realtek,smi-address = <8>; // Disabled because we do not know how to bring up again // reset-gpios = <&gpio0 21 GPIO_ACTIVE_LOW>; #thermal-sensor-cells = <0>; @@ -24,7 +24,7 @@ phy25: ethernet-phy@25 { reg = <25>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <2 8>; + realtek,smi-address = <8>; // Disabled because we do not know how to bring up again // reset-gpios = <&gpio0 21 GPIO_ACTIVE_LOW>; #thermal-sensor-cells = <0>; @@ -35,7 +35,7 @@ phy26: ethernet-phy@26 { reg = <26>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <3 8>; + realtek,smi-address = <8>; // Disabled because we do not know how to bring up again // reset-gpios = <&gpio0 21 GPIO_ACTIVE_LOW>; #thermal-sensor-cells = <0>; diff --git a/target/linux/realtek/dts/rtl9302_zyxel_xgs1250-12-b1.dts b/target/linux/realtek/dts/rtl9302_zyxel_xgs1250-12-b1.dts index 30e19445b27..739f056370a 100644 --- a/target/linux/realtek/dts/rtl9302_zyxel_xgs1250-12-b1.dts +++ b/target/linux/realtek/dts/rtl9302_zyxel_xgs1250-12-b1.dts @@ -12,7 +12,7 @@ phy24: ethernet-phy@24 { reg = <24>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <1 0>; + realtek,smi-address = <0>; // Disabled because we do not know how to bring up again // reset-gpios = <&gpio0 21 GPIO_ACTIVE_LOW>; #thermal-sensor-cells = <0>; @@ -23,7 +23,7 @@ phy25: ethernet-phy@25 { reg = <25>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <2 1>; + realtek,smi-address = <1>; // Disabled because we do not know how to bring up again // reset-gpios = <&gpio0 21 GPIO_ACTIVE_LOW>; #thermal-sensor-cells = <0>; @@ -34,7 +34,7 @@ phy26: ethernet-phy@26 { reg = <26>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <3 2>; + realtek,smi-address = <2>; // Disabled because we do not know how to bring up again // reset-gpios = <&gpio0 21 GPIO_ACTIVE_LOW>; #thermal-sensor-cells = <0>; diff --git a/target/linux/realtek/dts/rtl9302_zyxel_xgs1250-12-common.dtsi b/target/linux/realtek/dts/rtl9302_zyxel_xgs1250-12-common.dtsi index 4719cae6960..2d20bfc3c23 100644 --- a/target/linux/realtek/dts/rtl9302_zyxel_xgs1250-12-common.dtsi +++ b/target/linux/realtek/dts/rtl9302_zyxel_xgs1250-12-common.dtsi @@ -222,44 +222,36 @@ phy0: ethernet-phy@0 { reg = <0>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 0>; // Disabled because we do not know how to bring up again // reset-gpios = <&gpio0 21 GPIO_ACTIVE_LOW>; }; phy1: ethernet-phy@1 { reg = <1>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 1>; }; phy2: ethernet-phy@2 { reg = <2>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 2>; }; phy3: ethernet-phy@3 { reg = <3>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 3>; }; phy4: ethernet-phy@4 { reg = <4>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 4>; }; phy5: ethernet-phy@5 { reg = <5>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 5>; }; phy6: ethernet-phy@6 { reg = <6>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 6>; }; phy7: ethernet-phy@7 { reg = <7>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 7>; }; }; diff --git a/target/linux/realtek/dts/rtl9302_zyxel_xgs1x10-12-common.dtsi b/target/linux/realtek/dts/rtl9302_zyxel_xgs1x10-12-common.dtsi index 61f6109262a..c1471b1a009 100644 --- a/target/linux/realtek/dts/rtl9302_zyxel_xgs1x10-12-common.dtsi +++ b/target/linux/realtek/dts/rtl9302_zyxel_xgs1x10-12-common.dtsi @@ -91,44 +91,36 @@ phy0: ethernet-phy@0 { reg = <0>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 0>; // Disabled because we do not know how to bring up again // reset-gpios = <&gpio0 21 GPIO_ACTIVE_LOW>; }; phy1: ethernet-phy@1 { reg = <1>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 1>; }; phy2: ethernet-phy@2 { reg = <2>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 2>; }; phy3: ethernet-phy@3 { reg = <3>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 3>; }; phy4: ethernet-phy@4 { reg = <4>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 4>; }; phy5: ethernet-phy@5 { reg = <5>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 5>; }; phy6: ethernet-phy@6 { reg = <6>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 6>; }; phy7: ethernet-phy@7 { reg = <7>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 7>; }; }; diff --git a/target/linux/realtek/dts/rtl9303_hasivo_s1100w-8xgt-se.dts b/target/linux/realtek/dts/rtl9303_hasivo_s1100w-8xgt-se.dts index b16e669aa00..781e452fa21 100644 --- a/target/linux/realtek/dts/rtl9303_hasivo_s1100w-8xgt-se.dts +++ b/target/linux/realtek/dts/rtl9303_hasivo_s1100w-8xgt-se.dts @@ -129,25 +129,24 @@ &mdio_bus0 { phy0: ethernet-phy@0 { compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <0 0>; reg = <0>; }; phy8: ethernet-phy@8 { compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <0 1>; + realtek,smi-address = <1>; reg = <8>; }; phy16: ethernet-phy@16 { compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <0 2>; + realtek,smi-address = <2>; reg = <16>; }; phy20: ethernet-phy@20 { compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <0 3>; + realtek,smi-address = <3>; reg = <20>; }; }; @@ -155,25 +154,25 @@ &mdio_bus3 { phy24: ethernet-phy@24 { compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <3 16>; + realtek,smi-address = <16>; reg = <24>; }; phy25: ethernet-phy@25 { compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <3 17>; + realtek,smi-address = <17>; reg = <25>; }; phy26: ethernet-phy@26 { compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <3 18>; + realtek,smi-address = <18>; reg = <26>; }; phy27: ethernet-phy@27 { compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <3 19>; + realtek,smi-address = <19>; reg = <27>; }; }; diff --git a/target/linux/realtek/dts/rtl9311_linksys_lgs352c.dts b/target/linux/realtek/dts/rtl9311_linksys_lgs352c.dts index c1d82012976..80c34659f50 100644 --- a/target/linux/realtek/dts/rtl9311_linksys_lgs352c.dts +++ b/target/linux/realtek/dts/rtl9311_linksys_lgs352c.dts @@ -83,122 +83,98 @@ phy0: ethernet-phy@0 { reg = <0>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 0>; }; phy1: ethernet-phy@1 { reg = <1>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 1>; }; phy2: ethernet-phy@2 { reg = <2>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 2>; }; phy3: ethernet-phy@3 { reg = <3>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 3>; }; phy4: ethernet-phy@4 { reg = <4>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 4>; }; phy5: ethernet-phy@5 { reg = <5>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 5>; }; phy6: ethernet-phy@6 { reg = <6>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 6>; }; phy7: ethernet-phy@7 { reg = <7>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 7>; }; phy8: ethernet-phy@8 { reg = <8>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 8>; }; phy9: ethernet-phy@9 { reg = <9>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 9>; }; phy10: ethernet-phy@10 { reg = <10>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 10>; }; phy11: ethernet-phy@11 { reg = <11>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 11>; }; phy12: ethernet-phy@12 { reg = <12>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 12>; }; phy13: ethernet-phy@13 { reg = <13>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 13>; }; phy14: ethernet-phy@14 { reg = <14>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 14>; }; phy15: ethernet-phy@15 { reg = <15>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 15>; }; phy16: ethernet-phy@16 { reg = <16>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 16>; }; phy17: ethernet-phy@17 { reg = <17>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 17>; }; phy18: ethernet-phy@18 { reg = <18>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 18>; }; phy19: ethernet-phy@19 { reg = <19>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 19>; }; phy20: ethernet-phy@20 { reg = <20>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 20>; }; phy21: ethernet-phy@21 { reg = <21>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 21>; }; phy22: ethernet-phy@22 { reg = <22>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 22>; }; phy23: ethernet-phy@23 { reg = <23>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <0 23>; }; }; @@ -206,122 +182,122 @@ phy24: ethernet-phy@24 { reg = <24>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 0>; + realtek,smi-address = <0>; }; phy25: ethernet-phy@25 { reg = <25>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 1>; + realtek,smi-address = <1>; }; phy26: ethernet-phy@26 { reg = <26>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 2>; + realtek,smi-address = <2>; }; phy27: ethernet-phy@27 { reg = <27>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 3>; + realtek,smi-address = <3>; }; phy28: ethernet-phy@28 { reg = <28>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 4>; + realtek,smi-address = <4>; }; phy29: ethernet-phy@29 { reg = <29>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 5>; + realtek,smi-address = <5>; }; phy30: ethernet-phy@30 { reg = <30>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 6>; + realtek,smi-address = <6>; }; phy31: ethernet-phy@31 { reg = <31>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 7>; + realtek,smi-address = <7>; }; phy32: ethernet-phy@32 { reg = <32>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 8>; + realtek,smi-address = <8>; }; phy33: ethernet-phy@33 { reg = <33>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 9>; + realtek,smi-address = <9>; }; phy34: ethernet-phy@34 { reg = <34>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 10>; + realtek,smi-address = <10>; }; phy35: ethernet-phy@35 { reg = <35>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 11>; + realtek,smi-address = <11>; }; phy36: ethernet-phy@36 { reg = <36>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 12>; + realtek,smi-address = <12>; }; phy37: ethernet-phy@37 { reg = <37>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 13>; + realtek,smi-address = <13>; }; phy38: ethernet-phy@38 { reg = <38>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 14>; + realtek,smi-address = <14>; }; phy39: ethernet-phy@39 { reg = <39>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 15>; + realtek,smi-address = <15>; }; phy40: ethernet-phy@40 { reg = <40>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 16>; + realtek,smi-address = <16>; }; phy41: ethernet-phy@41 { reg = <41>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 17>; + realtek,smi-address = <17>; }; phy42: ethernet-phy@42 { reg = <42>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 18>; + realtek,smi-address = <18>; }; phy43: ethernet-phy@43 { reg = <43>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 19>; + realtek,smi-address = <19>; }; phy44: ethernet-phy@44 { reg = <44>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 20>; + realtek,smi-address = <20>; }; phy45: ethernet-phy@45 { reg = <45>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 21>; + realtek,smi-address = <21>; }; phy46: ethernet-phy@46 { reg = <46>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 22>; + realtek,smi-address = <22>; }; phy47: ethernet-phy@47 { reg = <47>; compatible = "ethernet-phy-ieee802.3-c22"; - realtek,smi-address = <1 23>; + realtek,smi-address = <23>; }; }; diff --git a/target/linux/realtek/dts/rtl9312_plasmacloud_common.dtsi b/target/linux/realtek/dts/rtl9312_plasmacloud_common.dtsi index b7de43ce1ad..e1b4a49c9f0 100644 --- a/target/linux/realtek/dts/rtl9312_plasmacloud_common.dtsi +++ b/target/linux/realtek/dts/rtl9312_plasmacloud_common.dtsi @@ -243,73 +243,71 @@ phy0: ethernet-phy@0 { reg = <0>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <0 0>; }; phy1: ethernet-phy@1 { reg = <1>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <0 1>; }; phy4: ethernet-phy@4 { reg = <4>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <0 2>; + realtek,smi-address = <2>; }; phy5: ethernet-phy@5 { reg = <5>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <0 3>; + realtek,smi-address = <3>; }; phy8: ethernet-phy@8 { reg = <8>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <0 4>; + realtek,smi-address = <4>; }; phy9: ethernet-phy@9 { reg = <9>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <0 5>; + realtek,smi-address = <5>; }; phy12: ethernet-phy@12 { reg = <12>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <0 6>; + realtek,smi-address = <6>; }; phy13: ethernet-phy@13 { reg = <13>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <0 7>; + realtek,smi-address = <7>; }; phy16: ethernet-phy@16 { reg = <16>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <0 8>; + realtek,smi-address = <8>; }; phy17: ethernet-phy@17 { reg = <17>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <0 9>; + realtek,smi-address = <9>; }; phy20: ethernet-phy@20 { reg = <20>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <0 10>; + realtek,smi-address = <10>; }; phy21: ethernet-phy@21 { reg = <21>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <0 11>; + realtek,smi-address = <11>; }; }; @@ -317,73 +315,73 @@ phy24: ethernet-phy@24 { reg = <24>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <1 12>; + realtek,smi-address = <12>; }; phy25: ethernet-phy@25 { reg = <25>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <1 13>; + realtek,smi-address = <13>; }; phy28: ethernet-phy@28 { reg = <28>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <1 14>; + realtek,smi-address = <14>; }; phy29: ethernet-phy@29 { reg = <29>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <1 15>; + realtek,smi-address = <15>; }; phy32: ethernet-phy@32 { reg = <32>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <1 16>; + realtek,smi-address = <16>; }; phy33: ethernet-phy@33 { reg = <33>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <1 17>; + realtek,smi-address = <17>; }; phy36: ethernet-phy@36 { reg = <36>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <1 18>; + realtek,smi-address = <18>; }; phy37: ethernet-phy@37 { reg = <37>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <1 19>; + realtek,smi-address = <19>; }; phy40: ethernet-phy@40 { reg = <40>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <1 20>; + realtek,smi-address = <20>; }; phy41: ethernet-phy@41 { reg = <41>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <1 21>; + realtek,smi-address = <21>; }; phy44: ethernet-phy@44 { reg = <44>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <1 22>; + realtek,smi-address = <22>; }; phy45: ethernet-phy@45 { reg = <45>; compatible = "ethernet-phy-ieee802.3-c45"; - realtek,smi-address = <1 23>; + realtek,smi-address = <23>; }; }; diff --git a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c index 20e3f555c25..44216fe2d98 100644 --- a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c +++ b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c @@ -149,7 +149,7 @@ struct rtmdio_bus_priv { int page[RTMDIO_MAX_PORT]; bool raw[RTMDIO_MAX_PORT]; int smi_bus[RTMDIO_MAX_PORT]; - u8 smi_addr[RTMDIO_MAX_PORT]; + int smi_addr[RTMDIO_MAX_PORT]; struct device_node *dn[RTMDIO_MAX_PORT]; bool smi_bus_isc45[RTMDIO_MAX_SMI_BUS]; }; @@ -1030,8 +1030,6 @@ static int rtmdio_probe(struct platform_device *pdev) priv->smi_bus[addr] = -1; for_each_node_by_name(dn, "ethernet-phy") { - u32 smi_addr[2]; - if (of_property_read_u32(dn, "reg", &addr)) continue; @@ -1040,14 +1038,10 @@ static int rtmdio_probe(struct platform_device *pdev) return -ENODEV; } - if (of_property_read_u32_array(dn, "realtek,smi-address", &smi_addr[0], 2)) { - priv->smi_bus[addr] = 0; + of_property_read_u32(dn->parent, "reg", &priv->smi_bus[addr]); + if (of_property_read_u32(dn, "realtek,smi-address", &priv->smi_addr[addr])) priv->smi_addr[addr] = addr; - } else { - priv->smi_bus[addr] = smi_addr[0]; - priv->smi_addr[addr] = smi_addr[1]; - } - + if (priv->smi_bus[addr] >= RTMDIO_MAX_SMI_BUS) { pr_err("%s: illegal SMI bus number %d\n", __func__, priv->smi_bus[addr]); return -ENODEV; -- 2.47.3