20.06.2013 Views

Xilinx UG194 Virtex-5 FPGA Embedded Tri-Mode Ethernet MAC ...

Xilinx UG194 Virtex-5 FPGA Embedded Tri-Mode Ethernet MAC ...

Xilinx UG194 Virtex-5 FPGA Embedded Tri-Mode Ethernet MAC ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 4: Host/DCR Bus Interfaces<br />

Reading the PHY Registers using MDIO<br />

To read from a configuration register either in the <strong>Ethernet</strong> <strong>MAC</strong> PCS/PMA layer or from<br />

an external PHY, the user must perform the following sequence of operations on the DCR<br />

bus:<br />

1. Write to the dataRegLSW register with the PHYAD and register to be accessed. This<br />

value should be formatted as shown in Figure 4-9.<br />

2. Write to the cntlReg register with the decode address for MDIO transaction (0x3B4)<br />

and the write enable bit cleared to indicate a read operation. Use<br />

E<strong>MAC</strong>0_DCRBASEADDR to perform the transaction on the E<strong>MAC</strong>0 MDIO interface<br />

and E<strong>MAC</strong>1_DCRBASEADDR to perform the transaction on the E<strong>MAC</strong>1 MDIO<br />

interface.<br />

3. Poll the RDYstatus_e# register until the MDIO Write-Ready bit is set or wait until the<br />

DCRHOSTDONEIR interrupt is asserted.<br />

4. Read the PHY register contents from the dataRegLSW.<br />

To read PHYAD 0x1 and PHY register 0x4 through the E<strong>MAC</strong>0 MDIO interface, MDIO<br />

must be enabled by writing to the management configuration register with the clock<br />

divider for MDC, as described in “Writing to an <strong>Ethernet</strong> <strong>MAC</strong> Configuration Register.”<br />

// Write the PHY address and PHY register to be accessed to the<br />

// dataRegLSW register<br />

dcr_write(E<strong>MAC</strong>0_DCRBASEADDR + 1, (0x1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!