I have a custom DM8168 board using the Micrel KSZ9031MNX gigabit PHY chip.
I have the most recent Micrel linux phy driver on the system and the driver attaches without issue. I then use the generic davinci emac driver to attach the mac.
But I am having issues getting the gigabit ethernet to work.
I am aware of the errata (copied below) and have tried implementing it to no avail.
I have followed the errata as closely as possible. So far my process is:
- uboot boots without phy connected (i hold it in reset)
- Linux boots and i pull the phy out of reset
- Linux MDIO probe finds the PHY device and attaches the micrel driver
- Rootfs network script initializes MAC.
- On first "set_phy_config" from davinci_emac.c, force Phy Control register to be 100Mb/s no autoneg.
- emac_stop is called.
- emac_start is then called
- This time set_phy_config knows it is not the first time and it sets it to 1000Mb/s autoneg.
- Reports that micrel driver attached successfully
- No link is detected.
When using ethtool to set the speed and autoneg enable/disable, setting the device to 100Mb/s autoneg off results in a link up and i am able to ping and everything. I then switch it to autoneg on speed 1000Mb/s, and nothing works.
Can anyone please provide some sample code or reccommendations on how to properly implement this errata? Is there anything on the hardware we can look for? We quickly sampled the EMACs output clock and it was only 25MHz even when switching to 1Gig. Obviously the clock should be 125MHz for gig.
Any direction/help would be greatly appreciated.
DM8168 Gigabit PHY Errata Software Workaround
EMAC requires a clock on EMAC_TXCLK only on initialization.
Enable EMAC as PHY (can be written only via MDIO), then disable auto-negotiation and
force 100-Mbps full-duplex GMII copper mode so that the PHY starts outputting the clock
on EMAC_TXCLK. Then restart the EMAC so it is reinitialized while the clock is running.
After that, auto-negotiation is enabled by the generic driver and the Ethernet works in
both U-Boot and Linux in all modes.