| Message ID | 20260916044119.475666-1-alastair@d-silva.org (mailing list archive) |
|---|---|
| Headers |
Return-Path: <linux-sunxi+bounces-25973-sunxi=pue.re@lists.linux.dev> X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mxe881.netcup.net (Postfix) with ESMTPS id E15E81C1FF4 for <noreply@patchwork.local>; Wed, 16 Sep 2026 06:41:53 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=d-silva.org; spf=pass (sender IP is 172.234.253.10) smtp.mailfrom=linux-sunxi+bounces-25973-noreply=patchwork.local@lists.linux.dev smtp.helo=sea.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.234.253.10 as permitted sender) client-ip=172.234.253.10; envelope-from=linux-sunxi+bounces-25973-noreply=patchwork.local@lists.linux.dev; helo=sea.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sea.lore.kernel.org (Postfix) with ESMTP id E007F277E4 for <noreply@patchwork.local>; Wed, 16 Sep 2026 04:41:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6A85F1A9F90; Wed, 16 Sep 2026 04:41:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=d-silva.org header.i=@d-silva.org header.b="UlWnZZ+U" X-Original-To: linux-sunxi@lists.linux.dev Received: from www.nmnhosting.com (watt.d-silva.org [119.15.109.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 824A23AF64D for <linux-sunxi@lists.linux.dev>; Wed, 16 Sep 2026 04:41:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=119.15.109.137 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789533692; cv=none; b=fBELkw0y5NXKpMcbQZhSb/TBMLCOamAuhYhm3SNL1xm15bVFE8p8iLukpviNELnNsB/tI8L4RIhU2iKe82BnKeezOgVQQGadsyTbRkVDpttyvH5liVEae2xcbJiVpRlpSU4hxYuxl/TToeqhBUFP2u06x74Nbt6GD9k/a3HkO60= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789533692; c=relaxed/simple; bh=uZjsORFcCwvkT2AAbXO2aZSM8USV3slRXFzd5UB31wU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ChzTmx4odY9YjZcCr2qHZs21ilOlALm0u8qHmFMDM1TYfQ5J+6CBb8vb4KJEAvSbJVIUioPNwwh8z6bm05XPB7Z0iPQwGJqi5dQjCcajRJWrXNfUI/qOWrwvThIhL8kxMrIh4PEKA+Au7xHxVsqRBAxIU80lDPeOOxIKrvS5x3U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=d-silva.org; spf=pass smtp.mailfrom=d-silva.org; dkim=pass (2048-bit key) header.d=d-silva.org header.i=@d-silva.org header.b=UlWnZZ+U; arc=none smtp.client-ip=119.15.109.137 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=d-silva.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=d-silva.org Received: from Hawking.lan (hawking.lan [10.0.1.4]) by www.nmnhosting.com (Postfix) with ESMTP id B042B40B5A; Wed, 16 Sep 2026 14:41:19 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=d-silva.org; s=2025a; t=1789533679; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=xTOSXHHE0Mp7WmhyDX8b5V5DuyvbmNcf+A+5A/N8sLo=; b=UlWnZZ+UVMEPdKCU7xcAFSbFO3th1cLIUDQAVgxHnxVx1R+lEdIoyMk1vV0Zvwe2nSIpwL ZFyTQtYBEJxngpet4wEa3OPi+HSxb4lNcF1PXZITorzVYPJT4u3LOS8vxeo3DLrUmsfe6B TewlUlT2TQQ1Jy3bYF7TtfNh9XyrThGWCMlvR+GJSfOutXpYKeisnXx9dwWGRF8qlWMsEG auLx73Cc4M2pirx+S2/HIHW1devcpDo59O9lqW8cz8l750238DpVNnbKOBNHEZyWKcO5j5 Zhfw65agxQeObJuk7lgCCccPAoV2TQR2qaioEusCk4c4fTDd7nGlets9PDlnOQ== X-GPT-Reason: legitimate; the email is a technical software patch submission for the Linux kernel (net-next) regarding Allwinner SoC hardware support. The sender (alastair@d-silva.org) matches the personal mailbox list provided in the environment context (alastair@d-silva.org), and the content is highly specific technical documentation with no marketing, phishing, or scam indicators. There are no URLs, no requests for sensitive information, and the subject line directly corresponds to the technical body describing driver and device tree updates. From: Alastair D'Silva <alastair@d-silva.org> To: Andrew Lunn <andrew+netdev@lunn.ch>, Heiner Kallweit <hkallweit1@gmail.com>, Russell King <linux@armlinux.org.uk>, Alexandre Torgue <alexandre.torgue@foss.st.com>, Maxime Chevallier <maxime.chevallier@bootlin.com>, "David S . Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzk+dt@kernel.org>, Conor Dooley <conor+dt@kernel.org> Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Chen-Yu Tsai <wens@kernel.org>, Jernej Skrabec <jernej.skrabec@gmail.com>, Samuel Holland <samuel@sholland.org>, Alastair D'Silva <alastair@d-silva.org> Subject: [PATCH net-next 0/4] net: Add Allwinner H616/H618 EMAC1 and AC300 EPHY support Date: Wed, 16 Sep 2026 14:41:15 +1000 Message-ID: <20260916044119.475666-1-alastair@d-silva.org> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: <linux-sunxi.lists.linux.dev> List-Subscribe: <mailto:linux-sunxi+subscribe@lists.linux.dev> List-Unsubscribe: <mailto:linux-sunxi+unsubscribe@lists.linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [4.84 / 15.00]; RBL_SENDERSCORE(2.00)[172.234.253.10:from]; SUSPICIOUS_RECIPS(1.50)[]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; MAILLIST(-0.15)[generic]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; TAGGED_RCPT(0.00)[netdev,dt]; FROM_HAS_DN(0.00)[]; PRECEDENCE_BULK(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[119.15.109.137:received,100.90.174.1:received]; RCPT_COUNT_TWELVE(0.00)[21]; FREEMAIL_CC(0.00)[vger.kernel.org,lists.linux.dev,lists.infradead.org,kernel.org,gmail.com,sholland.org,d-silva.org]; DBL_BLOCKED_OPENRESOLVER(0.00)[d-silva.org:dkim,sea.lore.kernel.org:rdns,sea.lore.kernel.org:helo]; FORGED_SENDER_MAILLIST(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; R_DKIM_ALLOW(0.00)[d-silva.org:s=2025a]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; DKIM_TRACE(0.00)[d-silva.org:+]; DMARC_POLICY_ALLOW(0.00)[d-silva.org,reject]; R_SPF_ALLOW(0.00)[+ip4:172.234.253.10]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[alastair@d-silva.org,linux-sunxi@lists.linux.dev]; FREEMAIL_TO(0.00)[lunn.ch,gmail.com,armlinux.org.uk,foss.st.com,bootlin.com,davemloft.net,google.com,kernel.org,redhat.com]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-25973-noreply=patchwork.local]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; ASN(0.00)[asn:63949, ipnet:172.234.224.0/19, country:SG]; RCVD_TLS_LAST(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[172.234.253.10:from] X-Rspamd-Queue-Id: E15E81C1FF4 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= |
| Series |
net: Add Allwinner H616/H618 EMAC1 and AC300 EPHY support
|
|
Message
Alastair D'Silva
Sept. 16, 2026, 4:41 a.m. UTC
This series adds support for the secondary Ethernet MAC controller (EMAC1)
and the co-packaged AC300 Fast Ethernet Physical Layer (EPHY) found on
Allwinner H616 and H618 SoCs.
The Allwinner H616/H618 SoCs feature two EMAC instances: EMAC0 (typically
used with an external RGMII Gigabit PHY) and EMAC1 (Fast Ethernet,
connected internally to the co-packaged AC300 EPHY). EMAC1 uses a
dedicated clock control register in the syscon register space, which is
accessed via an offset index in the DT syscon property.
The AC300 is an integrated 10/100M (100BASE-TX / 10BASE-T) Fast Ethernet
PHY communicating over MDIO at address 16 + phy_addr. It requires
retrieving factory bandgap calibration data from the SID nvmem controller,
managing internal power rails and clocks, and optimizing transceiver signal
parameters.
To ensure reliable link establishment and MAC software reset with the
internal PHY, dwmac-sun8i is updated to defer MAC software reset until
sun8i_dwmac_init() after the internal PHY has powered on and begun
clock generation.
The series is structured as follows:
- Patch 1: DT binding for Allwinner AC300 EPHY.
- Patch 2: PHY driver for Allwinner AC300 EPHY.
- Patch 3: DT binding update for Allwinner H616 EMAC1 and syscon index.
- Patch 4: dwmac-sun8i driver support for H616 EMAC1 clock index and
internal PHY deferred reset.
Testing:
- Tested on physical Mellow Fly-C5 hardware (Allwinner H618) running
Armbian with sustained 100Mbps full-duplex network traffic (DHCP,
iperf3, NFS rootfs).
- Device tree bindings validated with dt_binding_check.
- Separate SoC and board DTS additions will be submitted via the
linux-sunxi tree.
Alastair D'Silva (4):
dt-bindings: net: phy: Add Allwinner AC300 EPHY binding
net: phy: Add Allwinner AC300 EPHY driver
dt-bindings: net: allwinner,sun8i-a83t-emac: Add Allwinner H616 EMAC1
and syscon index
net: stmmac: dwmac-sun8i: Add Allwinner H616 EMAC clock index and
internal PHY support
.../net/allwinner,sun50i-h618-ac300-ephy.yaml | 79 +++++
.../net/allwinner,sun8i-a83t-emac.yaml | 14 +-
.../net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 65 +++-
drivers/net/phy/Kconfig | 9 +
drivers/net/phy/Makefile | 1 +
drivers/net/phy/ac300-phy.c | 331 ++++++++++++++++++
6 files changed, 486 insertions(+), 13 deletions(-)
create mode 100644 Documentation/devicetree/bindings/net/allwinner,sun50i-h618-ac300-ephy.yaml
create mode 100644 drivers/net/phy/ac300-phy.c
Comments
On Wed, Sep 16, 2026 at 12:41 PM Alastair D'Silva <alastair@d-silva.org> wrote: > > This series adds support for the secondary Ethernet MAC controller (EMAC1) > and the co-packaged AC300 Fast Ethernet Physical Layer (EPHY) found on > Allwinner H616 and H618 SoCs. > > The Allwinner H616/H618 SoCs feature two EMAC instances: EMAC0 (typically > used with an external RGMII Gigabit PHY) and EMAC1 (Fast Ethernet, > connected internally to the co-packaged AC300 EPHY). EMAC1 uses a > dedicated clock control register in the syscon register space, which is > accessed via an offset index in the DT syscon property. > > The AC300 is an integrated 10/100M (100BASE-TX / 10BASE-T) Fast Ethernet > PHY communicating over MDIO at address 16 + phy_addr. It requires > retrieving factory bandgap calibration data from the SID nvmem controller, > managing internal power rails and clocks, and optimizing transceiver signal > parameters. There is already a series from James covering the same thing. Please check the mailing list and possibly our wiki (linux-sunxi.org) to avoid duplicate work and subjecting the maintainers to the same discussions again. ChenYu > To ensure reliable link establishment and MAC software reset with the > internal PHY, dwmac-sun8i is updated to defer MAC software reset until > sun8i_dwmac_init() after the internal PHY has powered on and begun > clock generation. > > The series is structured as follows: > - Patch 1: DT binding for Allwinner AC300 EPHY. > - Patch 2: PHY driver for Allwinner AC300 EPHY. > - Patch 3: DT binding update for Allwinner H616 EMAC1 and syscon index. > - Patch 4: dwmac-sun8i driver support for H616 EMAC1 clock index and > internal PHY deferred reset. > > Testing: > - Tested on physical Mellow Fly-C5 hardware (Allwinner H618) running > Armbian with sustained 100Mbps full-duplex network traffic (DHCP, > iperf3, NFS rootfs). > - Device tree bindings validated with dt_binding_check. > - Separate SoC and board DTS additions will be submitted via the > linux-sunxi tree. > > Alastair D'Silva (4): > dt-bindings: net: phy: Add Allwinner AC300 EPHY binding > net: phy: Add Allwinner AC300 EPHY driver > dt-bindings: net: allwinner,sun8i-a83t-emac: Add Allwinner H616 EMAC1 > and syscon index > net: stmmac: dwmac-sun8i: Add Allwinner H616 EMAC clock index and > internal PHY support > > .../net/allwinner,sun50i-h618-ac300-ephy.yaml | 79 +++++ > .../net/allwinner,sun8i-a83t-emac.yaml | 14 +- > .../net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 65 +++- > drivers/net/phy/Kconfig | 9 + > drivers/net/phy/Makefile | 1 + > drivers/net/phy/ac300-phy.c | 331 ++++++++++++++++++ > 6 files changed, 486 insertions(+), 13 deletions(-) > create mode 100644 Documentation/devicetree/bindings/net/allwinner,sun50i-h618-ac300-ephy.yaml > create mode 100644 drivers/net/phy/ac300-phy.c > > -- > 2.53.0 >
On Tue, Sep 15, 2026 at 10:56 PM Chen-Yu Tsai <wens@kernel.org> wrote: > > On Wed, Sep 16, 2026 at 12:41 PM Alastair D'Silva <alastair@d-silva.org> wrote: > > > > This series adds support for the secondary Ethernet MAC controller (EMAC1) > > and the co-packaged AC300 Fast Ethernet Physical Layer (EPHY) found on > > Allwinner H616 and H618 SoCs. > > > > The Allwinner H616/H618 SoCs feature two EMAC instances: EMAC0 (typically > > used with an external RGMII Gigabit PHY) and EMAC1 (Fast Ethernet, > > connected internally to the co-packaged AC300 EPHY). EMAC1 uses a > > dedicated clock control register in the syscon register space, which is > > accessed via an offset index in the DT syscon property. > > > > The AC300 is an integrated 10/100M (100BASE-TX / 10BASE-T) Fast Ethernet > > PHY communicating over MDIO at address 16 + phy_addr. It requires > > retrieving factory bandgap calibration data from the SID nvmem controller, > > managing internal power rails and clocks, and optimizing transceiver signal > > parameters. > > There is already a series from James covering the same thing. Please check > the mailing list and possibly our wiki (linux-sunxi.org) to avoid duplicate > work and subjecting the maintainers to the same discussions again. See: https://git.kernel.org/netdev/net-next/c/783f6f1fdcd5 https://git.kernel.org/netdev/net-next/c/6cc2fbceb49b https://lore.kernel.org/all/20260915-submit-h616-emac1-v1-v2-2-322b32e40eb9@gmail.com/ > > > ChenYu > > > To ensure reliable link establishment and MAC software reset with the > > internal PHY, dwmac-sun8i is updated to defer MAC software reset until > > sun8i_dwmac_init() after the internal PHY has powered on and begun > > clock generation. > > > > The series is structured as follows: > > - Patch 1: DT binding for Allwinner AC300 EPHY. > > - Patch 2: PHY driver for Allwinner AC300 EPHY. > > - Patch 3: DT binding update for Allwinner H616 EMAC1 and syscon index. > > - Patch 4: dwmac-sun8i driver support for H616 EMAC1 clock index and > > internal PHY deferred reset. > > > > Testing: > > - Tested on physical Mellow Fly-C5 hardware (Allwinner H618) running > > Armbian with sustained 100Mbps full-duplex network traffic (DHCP, > > iperf3, NFS rootfs). > > - Device tree bindings validated with dt_binding_check. > > - Separate SoC and board DTS additions will be submitted via the > > linux-sunxi tree. > > > > Alastair D'Silva (4): > > dt-bindings: net: phy: Add Allwinner AC300 EPHY binding > > net: phy: Add Allwinner AC300 EPHY driver > > dt-bindings: net: allwinner,sun8i-a83t-emac: Add Allwinner H616 EMAC1 > > and syscon index > > net: stmmac: dwmac-sun8i: Add Allwinner H616 EMAC clock index and > > internal PHY support > > > > .../net/allwinner,sun50i-h618-ac300-ephy.yaml | 79 +++++ > > .../net/allwinner,sun8i-a83t-emac.yaml | 14 +- > > .../net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 65 +++- > > drivers/net/phy/Kconfig | 9 + > > drivers/net/phy/Makefile | 1 + > > drivers/net/phy/ac300-phy.c | 331 ++++++++++++++++++ > > 6 files changed, 486 insertions(+), 13 deletions(-) > > create mode 100644 Documentation/devicetree/bindings/net/allwinner,sun50i-h618-ac300-ephy.yaml > > create mode 100644 drivers/net/phy/ac300-phy.c > > > > -- > > 2.53.0 > >
On Tue, 2026-09-15 at 23:12 -0600, James Hilliard wrote: > On Tue, Sep 15, 2026 at 10:56 PM Chen-Yu Tsai <wens@kernel.org> > wrote: > > <snip> > > There is already a series from James covering the same thing. > > Please check > > the mailing list and possibly our wiki (linux-sunxi.org) to avoid > > duplicate > > work and subjecting the maintainers to the same discussions again. > > See: > https://git.kernel.org/netdev/net-next/c/783f6f1fdcd5 > https://git.kernel.org/netdev/net-next/c/6cc2fbceb49b > https://lore.kernel.org/all/20260915-submit-h616-emac1-v1-v2-2- > 322b32e40eb9@gmail.com/ > > > Thanks, I'll withdraw this series. There is one subtle timing issue worth highlighting from our Armbian testing on the Mellow Fly-C5 (H618): In James's dwmac patch, setting soc_has_internal_phy = false causes sun8i_dwmac_probe() to fall through to sun8i_dwmac_reset(priv). The Synopsys EMAC DMA soft reset (EMAC_BASIC_CTL1 bit 0) requires a running RMII clock from the PHY to clear. While this reset succeeds when the PHY driver is built-in and probes synchronously, if CONFIG_XPOWERS_ACX00_PHY is built as a module (=m) or if the PHY probe defers (-EPROBE_DEFER on regulator/clock/nvmem), the PHY is unpowered and not clocking when sun8i_dwmac_probe() runs. This causes sun8i_dwmac_reset() to time out after 100ms ("EMAC reset timeout"), failing MAC driver probe. In our testing, deferring the MAC reset until sun8i_dwmac_init() (which runs upon ndo_open after phylink has attached and the PHY is active) avoided this probe failure. Cheers,
Hi, On 9/16/26 08:49, Alastair D'Silva wrote: > There is one subtle timing issue worth highlighting from our Armbian > testing on the Mellow Fly-C5 (H618): > > In James's dwmac patch, setting soc_has_internal_phy = false causes > sun8i_dwmac_probe() to fall through to sun8i_dwmac_reset(priv). The > Synopsys EMAC DMA soft reset (EMAC_BASIC_CTL1 bit 0) requires a running > RMII clock from the PHY to clear. > > While this reset succeeds when the PHY driver is built-in and probes > synchronously, if CONFIG_XPOWERS_ACX00_PHY is built as a module (=m) > or if the PHY probe defers (-EPROBE_DEFER on regulator/clock/nvmem), > the PHY is unpowered and not clocking when sun8i_dwmac_probe() runs. > > This causes sun8i_dwmac_reset() to time out after 100ms ("EMAC reset > timeout"), failing MAC driver probe. In our testing, deferring the MAC > reset until sun8i_dwmac_init() (which runs upon ndo_open after phylink > has attached and the PHY is active) avoided this probe failure. I'm OK with going with James' version, however this seems like a valid point that needs to be figured out. James, can you add Alastair in CC of your next iterations, and Alastair it would be great if you could give James's patches a test when he submits them :) There's more stuff in the dwmac part for Alastair's version, some -EPROBEFER handling for clocks, the reset thing as well as the MUX part, for which use-cases is all of that required ? If that's something that needs to land with proper EMAC1 support, maybe this could be split out from Alastair's work (in individual patches please), and integrated in James's series ? Maxime
On Wed, 2026-09-16 at 09:06 +0200, Maxime Chevallier wrote: > Hi, > On 9/16/26 08:49, Alastair D'Silva wrote: > > > There is one subtle timing issue worth highlighting from our > > Armbian > > testing on the Mellow Fly-C5 (H618): > > > > In James's dwmac patch, setting soc_has_internal_phy = false causes > > sun8i_dwmac_probe() to fall through to sun8i_dwmac_reset(priv). The > > Synopsys EMAC DMA soft reset (EMAC_BASIC_CTL1 bit 0) requires a > > running > > RMII clock from the PHY to clear. > > > > While this reset succeeds when the PHY driver is built-in and > > probes > > synchronously, if CONFIG_XPOWERS_ACX00_PHY is built as a module > > (=m) > > or if the PHY probe defers (-EPROBE_DEFER on > > regulator/clock/nvmem), > > the PHY is unpowered and not clocking when sun8i_dwmac_probe() > > runs. > > > > This causes sun8i_dwmac_reset() to time out after 100ms ("EMAC > > reset > > timeout"), failing MAC driver probe. In our testing, deferring the > > MAC > > reset until sun8i_dwmac_init() (which runs upon ndo_open after > > phylink > > has attached and the PHY is active) avoided this probe failure. > > I'm OK with going with James' version, however this seems like a > valid > point that needs to be figured out. > > James, can you add Alastair in CC of your next iterations, and > Alastair > it would be great if you could give James's patches a test when he > submits them :) > > There's more stuff in the dwmac part for Alastair's version, some > -EPROBEFER handling for clocks, the reset thing as well as the MUX > part, for which use-cases is all of that required ? > > If that's something that needs to land with proper EMAC1 support, > maybe > this could be split out from Alastair's work (in individual patches > please), and integrated in James's series ? > > Maxime Thanks Maxime. Here is the breakdown of why those pieces were in my earlier patch and how they relate to James's series: 1. MDIO MUX & H3_EPHY_SELECT: These are NOT needed for James's series. My initial test tree was using the legacy "allwinner,sun8i-h3-mdio-mux" node inherited from older vendor/Armbian DTs. That mux driver attempts to toggle H3_EPHY_SELECT (bit 0 of SYSCON), which on H616 register 0x34 is actually SYSCON_EPIT (interface type), so I had to mask it out. With James's series, there is no fake mdio-mux node (direct MDIO bus with the ethernet-phy-package), which is much cleaner and completely bypasses all H3 mux code. 2. -EPROBE_DEFER handling in get_ephy_nodes(): Also NOT needed for H616 EMAC1. get_ephy_nodes() is only called when soc_has_internal_phy = true. In James's series, all PHY clocks, regulators, and NVMEM cells are managed inside the PHY package driver (drivers/net/phy/xpowers/ac300.c), where -EPROBE_DEFER is already handled cleanly via dev_err_probe(). (The get_ephy_nodes() fix is only relevant as an independent cleanup for legacy H3/V3s platforms). 3. MAC Soft Reset timing (The one piece that IS needed): This is the one issue that affects James's series. Because emac_variant_h616_emac1 sets soc_has_internal_phy = false, sun8i_dwmac_probe() falls through to line 1221: ret = sun8i_dwmac_reset(priv); The Allwinner EMAC DMA soft reset (EMAC_BASIC_CTL1 bit 0) requires the RMII clock from the PHY to toggle in order to complete. If CONFIG_XPOWERS_ACX00_PHY is built as a module (=m), or if any of the AC300 package resources defer probe, the PHY is unpowered and not clocking during sun8i_dwmac_probe(). sun8i_dwmac_reset() will time out after 100ms ("EMAC reset timeout"), aborting the MAC probe completely. For EMAC1, skipping sun8i_dwmac_reset() during probe and letting it run in sun8i_dwmac_init() (which runs upon ndo_open after phylink has connected and the PHY is clocked) avoids this probe failure. James, I'm happy to test your next revision on physical Mellow Fly-C5 (H618) hardware as both a builtin driver, and a module.