MDI Register Access
BCM5718 Programmer’s Guide
Broadcom
®
January 29, 2016 • 5718-PG108-R
Page 211
Access Method
The MAC provides the auto-access method to access the Physical Device register via the MDIO interface.
Auto-Access Method
The Ethernet controller has a built-in interface to access physical device registers without having to control MDC
and MDIO pins by software/firmware. It provides an easy way to access the physical device register.
To use this mode, MDI_Control_Register.MDI_Select has to be cleared to 0. The MII_Communication_Register
is used to access physical device.
For example, to read a 16-bit PHY register at offset 0x2 of a PHY device which is strapped to PHY address 1,
perform the following steps:
1.
MII_Communication_Register.Register_Address is set to 0x2.
2.
MII_Communication_Register.PHY_Addr is set to 1.
3.
MII_Communication_Register.Command is set to 0x2.
4.
MII_Communication_Register.Start_Busy is set to 1.
5.
Poll Until MII_Communication_Register.Start_Busy is cleared to 0.
6.
MII_Communication_Register.Transaction_Data contains 16-bit data of the PHY register.
See
“Configuring the GMII/MII PHY” on page 204
for example code.
To write a value of 0x1000 into 16-bit PHY register at offset 0x0 of a PHY device which is strapped to PHY
address 1, perform the following steps:
1.
MII_Communication_Register.Register_Address is set to 0x0.
2.
MII_Communication_Register.PHY_Addr is set to 1.
3.
MII_Communication_Register.Command is set to 0x1.
4.
MII_Communication_Register.Transaction_Data is set to 0x1000
5.
MII_Communication_Register.Start_Busy is set to 1.
6.
Poll Until MII_Communication_Register.Start_Busy is cleared to 0.
See
“Configuring the GMII/MII PHY” on page 204
for example code.
Note:
Programmers must be careful to wait for the start _busy bit to clear. Writing to the MI
Communication register prior to the completion of a previous MDI access will yield unpredictable
MDI data. The previous access will not complete successfully.