Dp83640Reset() actually enables LOOPBACK (BMCR bit 14) instead of initiating a Full Software RESET (BMCR bit 15).
void Dp83640Reset(uint32 mdioBaseAddr, uint32 phyAddr)
{
uint32 delay = 0x1FFFU;
MDIOPhyRegWrite(mdioBaseAddr, phyAddr, PHY_BCR, PHY_LPBK_ENABLE);
/* A wait of 3us is required before allowing further operation. */
while(delay > 0U)
{
delay--;
}
}
Additionally, according to docs:
This bit, which is self-clearing, returns a value of one until the reset process is complete.
The configuration is re-strapped.
So instead of a fixed loop-delay, why not read the register 'til the bit is cleared?