Repository navigation
Clear force-link-good in the DP83867 PHY control register at init - #198
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 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
force-pushed
the
dp83867_force_link
branch
from
November 18, 2026 00:47
ca26e31 to
24f8ebb
Compare
danielinux
approved these changes
Nov 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.