![Xilinx Virtex-4 RocketIO Скачать руководство пользователя страница 157](http://html1.mh-extra.com/html/xilinx/virtex-4-rocketio/virtex-4-rocketio_user-manual_3383739157.webp)
Embedded Tri-Mode Ethernet MAC User Guide
157
UG074 (v2.2) February 22, 2010
Interfacing to the Processor DCR
R
Interfacing to the Processor DCR
As described in the Host Interface section, the host interface allows the user to:
•
Access the Ethernet MAC configuration registers.
•
Access the optional accumulated statistics IP registers if implemented in the fabric.
•
Access the configuration and multicast address table registers for the Address Filter
block.
•
Access the MDIO registers of the PHY.
•
Access the Virtex®-4 FX FPGA processor blocks. For additional information on these
processor blocks, see
,
PowerPC405 Processor Block Reference Guide
.
The following subsections describe sample codes of various transactions for interfacing to
the processor DCR.
Reading from the Ethernet MAC Configuration Register
1.
Write to cntlReg register with the desired address of the Ethernet MAC configuration
register.
2.
Poll the RDYstatus register until the configuration Read-Ready bit is asserted.
3.
Read from the dataRegLSW register to show the value of the Ethernet MAC
configuration register.
Assuming the DCR base address is
0x0
, to read from the EMAC0 transmitter
configuration register:
// EMAC Configuration Register 0x280 (EMAC0 Transmitter Configuration)
// Write the address of EMAC0 Transmitter Configuration register to the
// cntlReg register
mtdcr(0x0 + 14, 0x280);
// Poll the RDYstatus register
while ( !(mfdcr(0x0 + 15) & 0x00000020) );
// Read the dataRegLSW with the values returned from the EMAC0
// Transmitter Configuration register
mfdcr (0x0 + 13);
Writing to the Ethernet MAC Configuration Register
1.
Write to dataRegLSW register with the desired value for the Ethernet MAC
configuration register.
2.
Write to cntlReg register with the desired address of the Ethernet MAC configuration
register.
3.
Poll the RDYstatus register until the configuration write ready bit is asserted.
Assuming the DCR base address is
0x0
, to write to the EMAC1 flow control register:
// EMAC Configuration Register 0x6C0 (EMAC1 Flow Control)
// Write to enable the flow control on both the transmit and receive
// side of EMAC1, set bits 29 and 30 to “1”
mtdcr(0x0 + 13, 0x60000000)
// Write the address of EMAC1 Flow Control register to the cntlReg
// register
mtdcr(0x0 + 14, 0x86C0);
// Poll the RDYstatus register
while ( !(mfdcr(0x0 + 15) & 0x00004000) );
www.BDTIC.com/XILINX