This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

am335x PHY 0:00 jumps to PHY 0:02

Hi, I have various custom am335x designed boards and One of them:

comes with a single PHY SMSC8710A with MII connection (same with beaglebone original).

50% of the time: it boots up successfully with PHY 0:00 fully functional. 50% of the time it boots with incorrect mdio address PHY 0:02. resulting networking not functional (error: PHY 0:00 not found)

Kernel messages:

correct:
[ 1.206085] CAN bus driver for Bosch D_CAN controller 1.0
[ 1.253601] davinci_mdio davinci_mdio.0: davinci mdio revision 1.6
[ 1.260040] davinci_mdio davinci_mdio.0: detected phy mask fffffffe
[ 1.267333] davinci_mdio.0: probed
[ 1.270874] davinci_mdio davinci_mdio.0: phy[0]: device 0:00, driver SMSC LAN8710/LAN8720

wrong:
[ 1.186248] CAN bus driver for Bosch D_CAN controller 1.0
[ 1.233612] davinci_mdio davinci_mdio.0: davinci mdio revision 1.6
[ 1.240051] davinci_mdio davinci_mdio.0: detected phy mask fffffffb
[ 1.247283] davinci_mdio.0: probed
[ 1.250823] davinci_mdio davinci_mdio.0: phy[2]: device 0:02, driver SMSC LAN8710/LAN8720

I took some further investigation. It appeared to me in the file drivers/net/phy/mdio_bus.c after bus->reset(bus);

the phy mask changed from 0xfffffffe to 0xfffffffb, resulting PHY addr change from 0 to 2.

I have also tried to use phy_register_fixup_for_uid( BBB_PHY_ID, BBB_PHY_MASK, dummy);  in order to manually setting the phy_mask back to 0xfffffffe, but It helped nothing.

Can anyone point me some directions? Thanks