Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the W5500 PHY configuration #130

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

brianrho
Copy link

Not sure there's any activity still happening in this repo, so this is more for anyone else who runs into the same PHY configuration issue.

This commit fixes the following:

  • Whenever the application specifies PHY_MODE_AUTONEGO in the wizphy_setphyconf argument, the function would unconditionally configure the PHY for "All Modes Capable". This is not quite in line with the datasheet, which permits 100BT+HDX to be paired with Auto-Negotiation.
  • PHYCFGR_OPMDC_100FA seems to have been misnamed all this time -- it should've been called PHYCFGR_OPMDC_100HA since the Auto-negotiation is paired with 100BT-HDX, not 100BT-FDX.
  • When reading the current PHY conf in wizphy_getphyconf, the above misnaming meant that the function would incorrectly return 100BT-FDX + Auto-nego, when the real conf is actually 100BT-HDX + Auto-Nego.
  • Avoid unintentional PHY reset when setting the configuration -- this is done by masking all but the RST bit of the PHYCFGR, when assembling the bits for the requested configuration.

Before this, the setter function handled auto-negotiation incorrectly -- specifically it had no provision for 100FA, now correctly renamed 100HA.
The getter function would also incorrectly return 100BT full-duplex for 100HA.
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.

1 participant