The Orange Pi 4 Pro connects A733 GMAC0 to a Motorcomm YT8531 Gigabit PHY over RGMII without PCB trace delays. Use phy-mode = "rgmii" rather than "rgmii-id" so PHY-side delays stay disabled and the MAC applies the calibrated TX (2160 ps) and RX (3780 ps) delays directly. Because mainline motorcomm.c disables CLK_OUT unless requested, specify motorcomm,clk-out-frequency-hz = <125000000> to provide the external GMII TX clock while CLK_GMAC0_PHY supplies the 25 MHz PHY reference. Enable GMAC0 with its reset GPIO and 3.3V reg_swout1/reg_swout2 supplies. Assisted-by: LLM Signed-off-by: Alastair D'Silva --- .../allwinner/sun60i-a733-orangepi-4-pro.dts | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun60i-a733-orangepi-4-pro.dts b/arch/arm64/boot/dts/allwinner/sun60i-a733-orangepi-4-pro.dts index df70967264ed..26f97318b842 100644 --- a/arch/arm64/boot/dts/allwinner/sun60i-a733-orangepi-4-pro.dts +++ b/arch/arm64/boot/dts/allwinner/sun60i-a733-orangepi-4-pro.dts @@ -14,6 +14,7 @@ / { compatible = "xunlong,orangepi-4-pro", "allwinner,sun60i-a733"; aliases { + ethernet0 = &gmac0; serial0 = &uart0; }; @@ -27,6 +28,29 @@ memory@40000000 { }; }; +&gmac0 { + assigned-clocks = <&ccu CLK_GMAC0_PHY>; + assigned-clock-rates = <25000000>; + phy-mode = "rgmii"; /* MAC applies TX and RX delays */ + phy-handle = <&ext_rgmii_phy>; + phy-supply = <®_swout1>; + tx-internal-delay-ps = <2160>; + rx-internal-delay-ps = <3780>; + status = "okay"; +}; + +&mdio0 { + ext_rgmii_phy: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + clocks = <&ccu CLK_GMAC0_PHY>; + motorcomm,clk-out-frequency-hz = <125000000>; + reset-gpios = <&pio 7 16 GPIO_ACTIVE_LOW>; /* PH16 */ + reset-assert-us = <10000>; + reset-deassert-us = <150000>; + }; +}; + &mmc0 { vmmc-supply = <®_dldo1>; cd-gpios = <&pio 5 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PF6 */ @@ -34,6 +58,10 @@ &mmc0 { status = "okay"; }; +&pio { + vcc-ph-supply = <®_swout2>; +}; + &r_i2c0 { pinctrl-names = "default"; pinctrl-0 = <&r_i2c0_pins>; -- 2.53.0