I am trying to access the generic PHY registers to know the results of auto-negotiation in my ethernet driver for dm6446. But the read is failing, i.e., the ACK bit is not getting set.
The phy is not getting detected. A read of the ALIVE register returns 0. However, the u-boot shows that the active phy is 1 which is what being passed to the mdio_read function.
These are the steps followed for initializing mdio:
1. do a software reset and wait until it clears. (copied from a test-code found here in the forum). even if this is not done, the behavior is same
2. set the enable bit in MDIO_CONTROL register
3. set the clk_div bits in MDIO_CONTROL register. The value is set to 63. U-boot shows ARM Clock: 297MHz, DDR Clock: 162 MHz.
After this (and a delay of 5,00,000 us), read the ALIVE reg, which is a fail.
These are the steps followed for a PHY reg read:
1. poll GO bit until it clears.
2. set the appropriate bits in USERACCESS0 (register indicated in highest-user-channel bit of MDIO_CONTROL).
3. set a delay (500000 us).
4. poll for GO bit to clear and ACK bit to set.
5. read the data bits in USERACCESS0.
If I override checking of the ACK bit and read the data bits in USERACCESS0, the value is 0.
I don't know what is wrong here. Please help. Thanks a lot in advance.