From: Markus Stockhausen Date: Mon, 8 Sep 2025 05:51:21 +0000 (-0400) Subject: realtek: dts: add mdio controller device nodes X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=13b6c62b758612256c5379c88a4171bcfe7049f3;p=openwrt%2Fopenwrt.git realtek: dts: add mdio controller device nodes Until now the mdio bus is a subnode of the ethernet device. This coupling is different from upstream and wrong. Ethernet and mdio are different devices. Additionally differentiate between mdio controller and mdio bus. To make it clear: - There is one mdio controller - With up to 4 busses (on RTL93xx) Prepare new mdio controller and bus nodes with SoC specific compatibles. These will be used later when refactoring the mdio driver probing. Remark! For now only define the first bus for the RTL93xx targets. So the driver still relies on "rtl9300,smi-address = ;". It will need much more refactoring to get totally aligned with upstream. Signed-off-by: Markus Stockhausen Link: https://github.com/openwrt/openwrt/pull/19986 Signed-off-by: Hauke Mehrtens --- diff --git a/target/linux/realtek/dts/rtl838x.dtsi b/target/linux/realtek/dts/rtl838x.dtsi index 2b9938899b..f4b629033b 100644 --- a/target/linux/realtek/dts/rtl838x.dtsi +++ b/target/linux/realtek/dts/rtl838x.dtsi @@ -203,6 +203,18 @@ compatible = "syscon", "simple-mfd"; reg = <0x1b000000 0x10000>; + mdio_ctrl: mdio-controller { + compatible = "realtek,rtl8380-mdio", "realtek,otto-mdio"; + #address-cells = <1>; + #size-cells = <0>; + + mdio_bus0: mdio-bus@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + mdio_aux: mdio-aux { compatible = "realtek,rtl8380-aux-mdio"; #address-cells = <1>; diff --git a/target/linux/realtek/dts/rtl839x.dtsi b/target/linux/realtek/dts/rtl839x.dtsi index 24b178c723..256ee0bc30 100644 --- a/target/linux/realtek/dts/rtl839x.dtsi +++ b/target/linux/realtek/dts/rtl839x.dtsi @@ -211,6 +211,18 @@ compatible = "syscon", "simple-mfd"; reg = <0x1b000000 0x10000>; + mdio_ctrl: mdio-controller { + compatible = "realtek,rtl8392-mdio", "realtek,otto-mdio"; + #address-cells = <1>; + #size-cells = <0>; + + mdio_bus0: mdio-bus@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + mdio_aux: mdio-aux { compatible = "realtek,rtl8390-aux-mdio"; #address-cells = <1>; diff --git a/target/linux/realtek/dts/rtl930x.dtsi b/target/linux/realtek/dts/rtl930x.dtsi index 312cc77956..13c6fad5a1 100644 --- a/target/linux/realtek/dts/rtl930x.dtsi +++ b/target/linux/realtek/dts/rtl930x.dtsi @@ -179,6 +179,18 @@ status = "disabled"; }; + mdio_ctrl: mdio-controller { + compatible = "realtek,rtl9301-mdio", "realtek,otto-mdio"; + #address-cells = <1>; + #size-cells = <0>; + + mdio_bus0: mdio-bus@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + mdio_aux: mdio-aux { compatible = "realtek,rtl9300-aux-mdio"; #address-cells = <1>; diff --git a/target/linux/realtek/dts/rtl931x.dtsi b/target/linux/realtek/dts/rtl931x.dtsi index c048485c1b..27f12df2b8 100644 --- a/target/linux/realtek/dts/rtl931x.dtsi +++ b/target/linux/realtek/dts/rtl931x.dtsi @@ -211,6 +211,18 @@ status = "disabled"; }; + mdio_ctrl: mdio-controller { + compatible = "realtek,rtl9311-mdio", "realtek,otto-mdio"; + #address-cells = <1>; + #size-cells = <0>; + + mdio_bus0: mdio-bus@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + mdio_aux: mdio-aux { compatible = "realtek,rtl9310-aux-mdio"; #address-cells = <1>;