[PATCH v2 7/7] arm64: dts: allwinner: sun60i-a733-orangepi-4-pro: Enable GMAC0 Ethernet

Alastair D'Silva alastair at d-silva.org
Sun Nov 29 17:30:02 PST 2026


The Orange Pi 4 Pro connects A733 GMAC0 to a Motorcomm YT8531 Gigabit
PHY over RGMII without PCB trace delays, relies on the PHY 125 MHz
CLK_OUT for external GMII TX clocking (allwinner,rgmii-clk-ext), and
powers the PHY and PH bank at 3.3V via AXP318W swout1 and swout2.

Use phy-mode = "rgmii-id" with no tx/rx-internal-delay-ps overrides so
the MAC/PHY pair handles standard RGMII timing (MAC inverts RXC via
ERXIE and PHY adds the 2 ns TX delay).

Add the reg_swout1 and reg_swout2 switch regulator nodes and enable
GMAC0 with its reset GPIO and supplies.

Assisted-by: LLM
Signed-off-by: Alastair D'Silva <alastair at d-silva.org>
---
 .../allwinner/sun60i-a733-orangepi-4-pro.dts  | 37 +++++++++++++++++++
 1 file changed, 37 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 374287d962a8..59d3a699c9a7 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
@@ -15,6 +15,7 @@ / {
 	compatible = "xunlong,orangepi-4-pro", "allwinner,sun60i-a733";
 
 	aliases {
+		ethernet0 = &gmac0;
 		serial0 = &uart0;
 	};
 
@@ -23,10 +24,32 @@ chosen {
 	};
 };
 
+&gmac0 {
+	assigned-clocks = <&ccu CLK_GMAC0_PHY>;
+	assigned-clock-rates = <25000000>;
+	phy-mode = "rgmii-id";
+	phy-handle = <&ext_rgmii_phy>;
+	phy-supply = <&reg_swout1>;
+	allwinner,rgmii-clk-ext;
+	status = "okay";
+};
+
 &hosc {
 	clock-frequency = <26000000>;
 };
 
+&mdio0 {
+	ext_rgmii_phy: ethernet-phy at 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 {
 	bus-width = <4>;
 	cd-gpios = <&pio 5 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PF6 */
@@ -36,6 +59,10 @@ &mmc0 {
 	status = "okay";
 };
 
+&pio {
+	vcc-ph-supply = <&reg_swout2>;
+};
+
 &r_i2c0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&r_i2c0_pl_pins>;
@@ -64,6 +91,16 @@ reg_dldo1: dldo1 {
 				regulator-max-microvolt = <3300000>;
 				regulator-always-on;
 			};
+
+			reg_swout1: swout1 {
+				regulator-name = "vcc-ephy";
+				regulator-always-on;
+			};
+
+			reg_swout2: swout2 {
+				regulator-name = "vcc-gmac-io";
+				regulator-always-on;
+			};
 		};
 	};
 };
-- 
2.53.0




More information about the linux-arm-kernel mailing list