From e0287f7aba6dc3178a72e066c73971e9eb753ebf Mon Sep 17 00:00:00 2001 From: Markus Stockhausen Date: Tue, 31 Mar 2026 17:40:31 +0200 Subject: [PATCH] realtek: dts: add PHY_C45() macro Like the PHY_C22() macro before add a helper that allows to define a C45 based phy. It works basically the same with two parameters PHY_C45(port_number, bus_address) where - port_number is the absolute overall unique phy number - bus_address is the location of the phy on the bus As a first consumer adapt the Xikestor SKS8300-8T devicetree. Signed-off-by: Markus Stockhausen Link: https://github.com/openwrt/openwrt/pull/22715 Signed-off-by: Robert Marko --- target/linux/realtek/dts/macros.dtsi | 6 +++ .../dts/rtl9303_xikestor_sks8300-8t.dts | 46 ++++--------------- 2 files changed, 14 insertions(+), 38 deletions(-) diff --git a/target/linux/realtek/dts/macros.dtsi b/target/linux/realtek/dts/macros.dtsi index eeabf0069e..3cfac36730 100644 --- a/target/linux/realtek/dts/macros.dtsi +++ b/target/linux/realtek/dts/macros.dtsi @@ -19,6 +19,12 @@ compatible = "ethernet-phy-ieee802.3-c22"; \ }; +#define PHY_C45(p, n) \ + phy##p: ethernet-phy@n { \ + reg = <##n>; \ + compatible = "ethernet-phy-ieee802.3-c45"; \ + }; + #define EXTERNAL_SFP_PHY(n) \ phy##n: ethernet-phy@##n { \ compatible = "ethernet-phy-ieee802.3-c22"; \ diff --git a/target/linux/realtek/dts/rtl9303_xikestor_sks8300-8t.dts b/target/linux/realtek/dts/rtl9303_xikestor_sks8300-8t.dts index bb9616816e..e7bde814dc 100644 --- a/target/linux/realtek/dts/rtl9303_xikestor_sks8300-8t.dts +++ b/target/linux/realtek/dts/rtl9303_xikestor_sks8300-8t.dts @@ -130,47 +130,17 @@ }; &mdio_bus0 { - phy0: ethernet-phy@0 { - compatible = "ethernet-phy-ieee802.3-c45"; - reg = <0>; - }; - - phy8: ethernet-phy@1 { - compatible = "ethernet-phy-ieee802.3-c45"; - reg = <1>; - }; - - phy16: ethernet-phy@2 { - compatible = "ethernet-phy-ieee802.3-c45"; - reg = <2>; - }; - - phy20: ethernet-phy@3 { - compatible = "ethernet-phy-ieee802.3-c45"; - reg = <3>; - }; + PHY_C45(0, 0) + PHY_C45(8, 1) + PHY_C45(16, 2) + PHY_C45(20, 3) }; &mdio_bus1 { - phy24: ethernet-phy@0 { - compatible = "ethernet-phy-ieee802.3-c45"; - reg = <0>; - }; - - phy25: ethernet-phy@1 { - compatible = "ethernet-phy-ieee802.3-c45"; - reg = <1>; - }; - - phy26: ethernet-phy@2 { - compatible = "ethernet-phy-ieee802.3-c45"; - reg = <2>; - }; - - phy27: ethernet-phy@3 { - compatible = "ethernet-phy-ieee802.3-c45"; - reg = <3>; - }; + PHY_C45(24, 0) + PHY_C45(25, 1) + PHY_C45(26, 2) + PHY_C45(27, 3) }; ðernet0 {