Created attachment 152469 [details] patch to support rtl8211f Description: I'm in the process of bringing up the ethernet interface on the ODROID-C1 which uses the DWC MAC and the RTL8211F PHYS. Currently the interface fails to see link or the negotiated speed / duplex since rgephyreg.c uses a phys specific status register that doesn't exist on rev 6 of the silicon. How-To-Repeat: Build FreeBSD for the ODROID-C1 (this requires patches not yet committed to the source tree) and attempt to use the dwc0 ethernet interface. Fix: With the supplied patch ifconfig reports the correct link status and negotiated speed / duplex. There are other issues preventing DWC from sending / receiving packets which I'm still looking at.
Created attachment 152860 [details] patch to support rtl8211f Rev 2 Rev 2 of the patch also handles the fact that the MID / MIDX bits are in a different location and when possible uses RGEPHY_MII_BMSR to check for link instead of silicon revision specific code.
Pyun, you seem to have done most of the non-tree-sweep changes to rgephy. Can you review this?
Created attachment 154127 [details] Patch for RTL8211F PHY
Thanks for the patch. I didn't test your patch on real H/W yet but patch looks good to me. To improve readability I've slightly reorganized your patch and regenerated it against HEAD. One difference against your diff is direct access of RGEPHY_F_MII_SSR register in MII_TICK handler. I wanted to remove RGEPHY_MII_BMSR, RGEPHY_MII_BMCR register accesses in the handler and rely on RGEPHY_F_MII_SSR or RGEPHY_MII_SSR register for non-re(4) drivers. Of course this assumes RGEPHY_F_MII_SSR reports correct link state in various timings. Would you try attached patch and let me know how it goes?
In a quick smoke test of cycling through the various ifconfig media / mediaopt options your patch seems fine.
A commit references this bug: Author: yongari Date: Thu Mar 12 07:05:29 UTC 2015 New revision: 279903 URL: https://svnweb.freebsd.org/changeset/base/279903 Log: Add RTL8211F gigabit PHY support. PR: 197265 MFC after: 2 weeks Changes: head/sys/dev/mii/rgephy.c head/sys/dev/mii/rgephyreg.h
Take.
I believe in rgephy_reset the old code switched to MDIX_AUTO for revision B or newer. The new code doesn't switch to MDIX_AUTO in the case of revision C due to the break in the switch. Is that intentional? The break would need to be removed to match the original meaning.
Ah, you're right. Fixed in r279941. Thanks a lot!
A commit references this bug: Author: yongari Date: Thu Mar 26 05:44:22 UTC 2015 New revision: 280667 URL: https://svnweb.freebsd.org/changeset/base/280667 Log: MFC r279903,279941: Add RTL8211F gigabit PHY support. PR: 197265 Changes: _U stable/10/ stable/10/sys/dev/mii/rgephy.c stable/10/sys/dev/mii/rgephyreg.h
A commit references this bug: Author: yongari Date: Thu Mar 26 05:45:22 UTC 2015 New revision: 280668 URL: https://svnweb.freebsd.org/changeset/base/280668 Log: MFC r279903,279941: Add RTL8211F gigabit PHY support. PR: 197265 Changes: _U stable/9/sys/ _U stable/9/sys/dev/ stable/9/sys/dev/mii/rgephy.c stable/9/sys/dev/mii/rgephyreg.h
MFC done. Thanks a lot!