Skip to content

Clear force-link-good in the DP83867 PHY control register at init - #198

Merged
danielinux merged 1 commit into
wolfSSL:masterfrom
dgarske:dp83867_force_link
Nov 18, 2026
Merged

danielinux merged 1 commit into
wolfSSL:masterfrom
dgarske:dp83867_force_link

Conversation

@dgarske

@dgarske dgarske commented Nov 17, 2026

Copy link
Copy Markdown
Member

Found on an AMD Versal VMK180 booting from QSPI: some cold boots came up with no network, and only a power cycle recovered them.

Force-link-good survived the driver's PHY setup

dp83867_init() sets the RGMII FIFO depth with a read-modify-write of the PHY Control Register (PHYCR, 0x10) so that strap-selected settings are kept. On the failing boots the strap status register (STRAP_STS1) reads differently from a good boot and the PHY comes up with the force-link-good bit (PHYCR bit 10) set. The BMCR soft reset does not clear it and the read-modify-write wrote it straight back.

With force-link-good set the PHY reports link up in BMSR and PHYSTS but never completes autonegotiation: the link partner ability registers stay zero, the autonegotiation wait times out, and the MAC is programmed for a speed that was never negotiated. Because BMSR shows link, it looked like a MAC speed or RGMII delay problem rather than a PHY that was not negotiating at all.

The fix clears force-link-good in the same PHYCR write. Normal operation never wants that bit, so it is cleared unconditionally for a DP83867.

Hardware / test status

Validated on a VMK180 (GEM0, DP83867 at MDIO address 1) with repeated cold power cycles: the fault no longer appears, and every boot negotiates 1000 Mbps full duplex and passes traffic. The ZCU102 and Versal builds compile; the ZCU102 and Zynq-7000 boards were not re-tested on hardware.

Copilot AI balanced review requested due to automatic review settings November 17, 2026 14:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

There are no active review issues for the change to clear the PHY’s force-link-good bit during initialization.

No open issues 🎉

What changed in this PR

This PR addresses intermittent cold-boot network failures on the AMD Versal VMK180 by clearing the DP83867 PHY’s force-link-good bit during initialization, preventing false link-up reports without completed autonegotiation.

Changes:

  • Adds a named mask for PHYCR’s force-link-good bit.
  • Clears that bit in the existing FIFO-depth configuration write while preserving other register settings.
File Description
src/​port/​amd/​ip/​phy_dp83867.c Clears force-link-good during PHY initialization and documents why it must be cleared after soft reset.

Review effort: Balanced

@dgarske dgarske self-assigned this Nov 17, 2026
@danielinux
danielinux merged commit 394d71b into wolfSSL:master Nov 18, 2026
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants