www.ti.com
EMAC Functional Architecture
2.7.2MDIO Module Operational Overview
The MDIO module implements the 802.3 serial management interface to simultaneously interrogate and control up to two Ethernet PHYs, using a shared
Application software uses the MDIO module to configure the
The MDIO module powers up in an idle state until it is enabled by setting the ENABLE bit in the CONTROL register. This also configures the MDIO clock divider and preamble mode selection. The MDIO preamble is enabled by default, but it can be disabled if none of the connected PHYs require it.
Once the MDIO module is enabled, the MDIO interface state machine continuously polls the PHY link status (by reading the generic PHY Status register) of all possible 32 PHY addresses and records the results in the ALIVE and LINK registers. The corresponding bit for each PHY
The USERPHYSELn register is used to track the link status of any two of the 32 possible PHY addresses. Changes in the link status of the two monitored PHYs sets the appropriate bit in the LINKINTRAW and LINKINTMASKED registers, if they are enabled by the LINKINTENB bit in USERPHYSELn.
While the MDIO module is enabled, the host can issue a read or write transaction over the management interface using the DATA, PHYADR, REGADR, and WRITE bits in the USERACCESSn register. When the application sets the GO bit in USERACCESSn, the MDIO module begins the transaction without any further intervention from the CPU. Upon completion, the MDIO module clears the GO bit and sets the
A
2.7.2.1Initializing the MDIO Module
To have the application software or device driver initialize the MDIO device, perform the following:
1.Configure the PREAMBLE and CLKDIV bits in the CONTROL register.
2.Enable the MDIO module by setting the ENABLE bit in the CONTROL register.
3.The ALIVE register can be read after a delay to determine which PHYs responded, and the LINK register can determine which of those (if any) already have a link.
4.Set up the appropriate PHY addresses in the USERPHYSELn register, and set the LINKINTENB bit to enable a link change event interrupt if desirable.
5.If an interrupt on a general MDIO register access is desired, set the corresponding bit in the USERINTMASKSET register to use the USERACCESSn register. If only one PHY is to be used, the application software can set up one of the USERACCESSn registers to trigger a completion interrupt. The other register is not set up.
40 | Ethernet Media Access Controller (EMAC)/Management Data Input/Output (MDIO) | SPRU975B |