Preliminary
Architecture
www.ti.com
3.2.15.3 MDIO Module Initialization
The MDIO module is used to initially configure and monitor one or more external PHY devices. Other
than initializing the software state machine (details on this state machine can be found in the IEEE
802.3 standard), all that needs to be done for the MDIO module is to enable the MDIO engine and to
configure the clock divider. To set the clock divider, supply an MDIO clock of 1 MHz. For example,
since the base clock used is the peripheral clock (SYSCLK5), for a SYSCLK5 at a frequency of 250
MHz the divider can be set to 99, with slower MDIO clocks for slower peripheral clock frequencies
being perfectly acceptable.
Both the state machine enable and the MDIO clock divider are controlled through the MDIO control
register (CONTROL). If none of the potentially connected PHYs require the access preamble, the
PREAMBLE bit in CONTROL can also be set to speed up PHY register access. The code for this may
appear as in
.
Example 3-5. MDIO Module Initialization Code
#define PCLK 99
...
/* Enable MDIO and setup divider */
MDIO_REGS->CONTROL = CSL_FMKT( MDIO_CONTROL_ENABLE, YES) |
CSL_FMK( MDIO_CONTROL_CLKDIV, PCLK ) ;
If the MDIO module is to operate on an interrupt basis, the interrupts can be enabled at this time using
the MDIO user command complete interrupt mask set register (USERINTMASKSET) for register access
and the MDIO user PHY select register (USERPHYSELn ) if a target PHY is already known.
Once the MDIO state machine has been initialized and enabled, it starts polling all 32 PHY addresses
on the MDIO bus, looking for an active PHY. Since it can take up to 50
μ
s to read one register, it can
be some time before the MDIO module provides an accurate representation of whether a PHY is
available. Also, a PHY can take up to 3 seconds to negotiate a link. Thus, it is advisable to run the
MDIO software off a time-based event rather than polling.
For more information on PHY control registers, see your PHY device documentation.
448
EMAC/MDIO Module
SPRUGX9 – 15 April 2011
© 2011, Texas Instruments Incorporated
Содержание TMS320C6A816 Series
Страница 2: ...Preliminary 2 SPRUGX9 15 April 2011 Submit Documentation Feedback 2011 Texas Instruments Incorporated...
Страница 92: ...92 Read This First SPRUGX9 15 April 2011 Submit Documentation Feedback 2011 Texas Instruments Incorporated...
Страница 1122: ...1122 Multichannel Audio Serial Port McASP SPRUGX9 15 April 2011 Submit Documentation Feedback 2011 Texas Instruments Incorporated...
Страница 1562: ...1562 Real Time Clock RTC SPRUGX9 15 April 2011 Submit Documentation Feedback 2011 Texas Instruments Incorporated...
Страница 1658: ...1658 Timers SPRUGX9 15 April 2011 Submit Documentation Feedback 2011 Texas Instruments Incorporated...
Страница 1750: ...1750 UART IrDA CIR Module SPRUGX9 15 April 2011 Submit Documentation Feedback 2011 Texas Instruments Incorporated...
Страница 1984: ...1984 Universal Serial Bus USB SPRUGX9 15 April 2011 Submit Documentation Feedback 2011 Texas Instruments Incorporated...