The MDIO module includes a user access register (MDIO_USERACCESS0/1) to directly access a specified PHY device.To write a PHY register, perform the following:
- Check to ensure that the GO bit in the MDIO user access register (MDIO_USERACCESS0/1) is cleared.
- Write to the GO, WRITE, REGADR, PHYADR, and DATA bits in MDIO_USERACCESS0/1 corresponding to the PHY and PHY register you want to write.
- The write operation to the PHY is scheduled and completed by the MDIO module. Completion of the write operation can be determined by polling the GO bit in MDIO_USERACCESS0/1 for a 0.
- Completion of the operation sets the corresponding USERINTRAW bit (0 or 1) in the MDIO user command complete interrupt register (MDIO_USERINTRAW) corresponding to MDIO_USERACCESS0/1 used. If interrupts have been enabled on this bit using the MDIO user command complete interrupt mask set register (MDIO_USERINTMASKSET), then the bit is also set in the MDIO user command complete interrupt register (MDIO_USERINTMASKED) and an interrupt is triggered on the host processor.